Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/BluetoothDeviceConnected.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def reload_devices(self):
self.paired_devices = devices
self.listview.controls = []
for device in devices:
ico = ft.Icon(ft.icons.DONE, visible=False)
ico = ft.Icon(ft.Icons.DONE, visible=False)
btn = ft.TextButton(
content=ft.Container(
content=ft.Row(
Expand Down
12 changes: 6 additions & 6 deletions components/BluetoothDiscoveryToggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class BluetoothDiscoveryToggle(ft.FilledButton):
ico_discovery_status = ft.Icon(ft.icons.BLUETOOTH_DISABLED)
ico_discovery_status = ft.Icon(ft.Icons.BLUETOOTH_DISABLED)
txt_discovery_status = ft.Text("Bluetooth nicht sichtbar", style=ft.TextStyle(size=20))

on_discovery_enabled = None
Expand All @@ -22,16 +22,16 @@ def __init__(self, on_dicovery_enabled, on_dicovery_disabled):
alignment=ft.MainAxisAlignment.CENTER,
controls=[self.ico_discovery_status, self.txt_discovery_status],
)
self.style = ft.ButtonStyle(bgcolor=ft.colors.RED)
self.style = ft.ButtonStyle(bgcolor=ft.Colors.RED)
self.width = 500
self.height = 80
self.on_click = lambda e: self.toggle_bluetooth_discovery()

def enable_discovery(self):
bluetooth_helper.bluetooth_discovery_on()
self.txt_discovery_status.value = "Bluetooth sichtbar"
self.ico_discovery_status.name = ft.icons.BLUETOOTH
self.style.bgcolor = ft.colors.GREEN
self.ico_discovery_status.name = ft.Icons.BLUETOOTH
self.style.bgcolor = ft.Colors.GREEN

self.txt_discovery_status.update()
self.ico_discovery_status.update()
Expand All @@ -42,8 +42,8 @@ def enable_discovery(self):
def disable_discovery(self):
bluetooth_helper.bluetooth_discovery_off()
self.txt_discovery_status.value = "Bluetooth nicht sichtbar"
self.ico_discovery_status.name = ft.icons.BLUETOOTH_DISABLED
self.style.bgcolor = ft.colors.RED
self.ico_discovery_status.name = ft.Icons.BLUETOOTH_DISABLED
self.style.bgcolor = ft.Colors.RED

self.txt_discovery_status.update()
self.ico_discovery_status.update()
Expand Down
34 changes: 16 additions & 18 deletions components/NavigationBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,40 @@ def update_color(self, color):

def get_destinations(self):
destinations = [
ft.NavigationDestination(
ft.NavigationBarDestination(
label="Radiosender",
icon_content=ft.Icon(
ft.icons.RADIO_OUTLINED, size=ICON_SIZE, color=ft.colors.ON_SURFACE
),
selected_icon_content=ft.Icon(ft.icons.RADIO, size=ICON_SIZE),
icon=ft.Icon(ft.Icons.RADIO_OUTLINED, size=ICON_SIZE, color=ft.Colors.ON_SURFACE),
selected_icon=ft.Icon(ft.Icons.RADIO, size=ICON_SIZE),
),
ft.NavigationDestination(
ft.NavigationBarDestination(
label="Bluetooth",
icon_content=ft.Icon(
ft.icons.BLUETOOTH_OUTLINED, size=ICON_SIZE, color=ft.colors.ON_SURFACE
icon=ft.Icon(
ft.Icons.BLUETOOTH_OUTLINED, size=ICON_SIZE, color=ft.Colors.ON_SURFACE
),
selected_icon_content=ft.Icon(ft.icons.BLUETOOTH, size=ICON_SIZE),
selected_icon=ft.Icon(ft.Icons.BLUETOOTH, size=ICON_SIZE),
),
]

if system_helper.is_party_mode():
destinations.append(
ft.NavigationDestination(
ft.NavigationBarDestination(
label="Soundboard",
icon_content=ft.Icon(
ft.icons.SPACE_DASHBOARD_OUTLINED,
icon=ft.Icon(
ft.Icons.SPACE_DASHBOARD_OUTLINED,
size=ICON_SIZE,
color=ft.colors.ON_SURFACE,
color=ft.Colors.ON_SURFACE,
),
selected_icon_content=ft.Icon(ft.icons.SPACE_DASHBOARD, size=ICON_SIZE),
selected_icon=ft.Icon(ft.Icons.SPACE_DASHBOARD, size=ICON_SIZE),
),
)

destinations.append(
ft.NavigationDestination(
ft.NavigationBarDestination(
label="Einstellungen",
icon_content=ft.Icon(
ft.icons.SETTINGS_OUTLINED, size=ICON_SIZE, color=ft.colors.ON_SURFACE
icon=ft.Icon(
ft.Icons.SETTINGS_OUTLINED, size=ICON_SIZE, color=ft.Colors.ON_SURFACE
),
selected_icon_content=ft.Icon(ft.icons.SETTINGS, size=ICON_SIZE),
selected_icon=ft.Icon(ft.Icons.SETTINGS, size=ICON_SIZE),
)
)

Expand Down
6 changes: 3 additions & 3 deletions components/RadioGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def reload(self):
controls=[
ft.Container(
alignment=ft.alignment.center,
bgcolor=ft.colors.SURFACE_VARIANT,
bgcolor=ft.Colors.SURFACE_CONTAINER_HIGHEST,
on_click=lambda e, src=station, index=i: self.change_radio_station(
src, index
),
Expand All @@ -87,8 +87,8 @@ def reload(self):
and favorite_station["id"] == station["id"]
),
content=ft.Icon(
name=ft.icons.FAVORITE,
color=ft.colors.RED,
name=ft.Icons.FAVORITE,
color=ft.Colors.RED,
size=36,
),
padding=10,
Expand Down
4 changes: 2 additions & 2 deletions components/SongInfoRow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def __init__(self, radio_grid: RadioGrid):
self.radio_search_dialog = RadioSearchDialog(radio_grid)
self.content = ft.Row(
[
ft.Icon(ft.icons.MUSIC_NOTE, size=28),
ft.Icon(ft.Icons.MUSIC_NOTE, size=28),
self.song_info_station,
self.song_info_title,
ft.TextButton(
text="Sendersuche",
icon=ft.icons.SEARCH,
icon=ft.Icons.SEARCH,
on_click=lambda e: self.radio_search_dialog.open_dialog(),
),
]
Expand Down
2 changes: 1 addition & 1 deletion components/SoundboardSearchBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, on_favorite_add):
ft.Text("", expand=True),
ft.TextButton(
"Soundboard durchsuchen",
icon=ft.icons.SEARCH,
icon=ft.Icons.SEARCH,
on_click=lambda e: self.soundboard_search_dialog.open_dialog(),
# style=ft.ButtonStyle(
# text_style=ft.TextStyle(size=16)
Expand Down
2 changes: 1 addition & 1 deletion components/ToastCard.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self):
alignment=ft.alignment.bottom_center,
on_click=lambda e: audio_helper.play_toast(),
height=130,
image_src=c.get_button_img(),
content=ft.Image(src=c.get_button_img(), opacity=0.7),
),
ft.Container(
ft.Text("Zufälliger Trinkspruch", size=20, text_align=ft.TextAlign.CENTER),
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/ErrorDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class ErrorDialog(ft.AlertDialog):
text = ft.Text("")
display_icon = ft.Icon(ft.icons.ERROR, size=36, visible=False)
display_icon = ft.Icon(ft.Icons.ERROR, size=36, visible=False)

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/RadioSearchDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def search_stations(self):

self.listview.controls = []
for el in stations:
img = ft.Container(ft.Icon(ft.icons.MUSIC_NOTE), width=60, height=60)
img = ft.Container(ft.Icon(ft.Icons.MUSIC_NOTE), width=60, height=60)
if el["logo"] != "":
img = ft.Image(
el["logo"],
Expand Down
4 changes: 2 additions & 2 deletions components/dialogs/SettingsAppControlDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.HIGHLIGHT_OFF,
ft.Icons.HIGHLIGHT_OFF,
icon_size=75,
on_click=lambda e: system_helper.stop_app(),
),
Expand All @@ -37,7 +37,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.REFRESH,
ft.Icons.REFRESH,
icon_size=75,
on_click=lambda e: system_helper.restart_app(),
),
Expand Down
4 changes: 2 additions & 2 deletions components/dialogs/SettingsShutdownDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.LOGOUT,
ft.Icons.LOGOUT,
icon_size=75,
on_click=lambda e: system_helper.shutdown_system(),
),
Expand All @@ -37,7 +37,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.RESTART_ALT,
ft.Icons.RESTART_ALT,
icon_size=75,
on_click=lambda e: system_helper.restart_system(),
),
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/SettingsUpdateDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_items(self, revisions: list[dict]):
content=ft.Row(
[
ft.Icon(
ft.icons.DONE,
ft.Icons.DONE,
visible=(r["name"] == self._get_current_revision()),
),
ft.Text(
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/SoundboardSearchDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def search_sounds(self):
self.listview.controls = []
for el in sounds:
fav_btn = ft.IconButton(
icon=ft.icons.PLAYLIST_ADD, on_click=lambda e, item=el: on_add(item)
icon=ft.Icons.PLAYLIST_ADD, on_click=lambda e, item=el: on_add(item)
)

def on_add(item):
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/SuccessDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class SuccessDialog(ft.AlertDialog):
text = ft.Text("")
display_icon = ft.Icon(ft.icons.DOWNLOAD_DONE, size=36, visible=False)
display_icon = ft.Icon(ft.Icons.DOWNLOAD_DONE, size=36, visible=False)

def __init__(self):
super().__init__()
Expand Down
4 changes: 2 additions & 2 deletions components/dialogs/UpdatesRestartDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.RESTART_ALT,
ft.Icons.RESTART_ALT,
icon_size=75,
on_click=lambda e: system_helper.restart_system(),
),
Expand All @@ -37,7 +37,7 @@ def __init__(self):
ft.Column(
[
ft.IconButton(
ft.icons.REFRESH,
ft.Icons.REFRESH,
icon_size=75,
on_click=lambda e: system_helper.restart_app(),
),
Expand Down
2 changes: 1 addition & 1 deletion components/dialogs/WifiDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def open_dialog(self):
networks = wifi_helper.get_networks()

for n in networks:
ico = ft.Icon(ft.icons.DONE, size=28, visible=False)
ico = ft.Icon(ft.Icons.DONE, size=28, visible=False)
btn = ft.TextButton(
content=ft.Container(content=ft.Row(controls=[ico, ft.Text(n, size=16)])),
on_click=lambda e, name=n: self.connection_dialog.open_dialog(name),
Expand Down
44 changes: 22 additions & 22 deletions components/view/Taskbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ class Taskbar(ft.AppBar):

ico_toggle_theme = ft.IconButton(
icon=(
ft.icons.LIGHT_MODE
ft.Icons.LIGHT_MODE
if theme_helper.get_theme() == ft.ThemeMode.LIGHT
else ft.icons.DARK_MODE
else ft.Icons.DARK_MODE
),
icon_size=25,
)
ico_wifi = ft.IconButton(icon=ft.icons.WIFI, icon_size=25, icon_color=ft.colors.GREEN)
ico_bluetooth = ft.Icon(name=ft.icons.BLUETOOTH, size=25)
ico_wifi = ft.IconButton(icon=ft.Icons.WIFI, icon_size=25, icon_color=ft.Colors.GREEN)
ico_bluetooth = ft.Icon(name=ft.Icons.BLUETOOTH, size=25)

ico_volume = ft.Icon(name=ft.icons.VOLUME_UP_ROUNDED, size=25)
ico_volume = ft.Icon(name=ft.Icons.VOLUME_UP_ROUNDED, size=25)
txt_volume = ft.Text(f"{audio_helper.get_volume()}%", size=18)

ico_bass = ft.Icon(name=ft.icons.SURROUND_SOUND, size=25)
ico_bass = ft.Icon(name=ft.Icons.SURROUND_SOUND, size=25)
txt_bass = ft.Text(f"{audio_effects.get_bass_value()} dB", size=18)

ico_pitch = ft.Icon(name=ft.icons.HEIGHT, size=25)
ico_pitch = ft.Icon(name=ft.Icons.HEIGHT, size=25)
txt_pitch = ft.Text(audio_effects.get_pitch_value(), size=18)

def __init__(self, on_volume_update, on_mute_update):
Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, on_volume_update, on_mute_update):
)
self.title = ft.Text("Retro.I")
self.center_title = True
self.bgcolor = ft.colors.SURFACE_VARIANT
self.bgcolor = ft.Colors.SURFACE_CONTAINER_HIGHEST
self.toolbar_height = 40
self.actions = [self.ico_toggle_theme, self.ico_wifi, self.ico_bluetooth]

Expand All @@ -92,48 +92,48 @@ def update(self):
def toggle_theme(self):
theme_helper.toggle_theme()
self.ico_toggle_theme.icon = (
ft.icons.LIGHT_MODE
ft.Icons.LIGHT_MODE
if theme_helper.get_theme() == ft.ThemeMode.LIGHT
else ft.icons.DARK_MODE
else ft.Icons.DARK_MODE
)
self.ico_toggle_theme.update()
PageState.page.theme_mode = theme_helper.get_theme()
PageState.page.update()

def update_wifi(self):
self.ico_wifi.icon = (
ft.icons.WIFI if wifi_helper.is_connected() else ft.icons.WIFI_OFF_ROUNDED
ft.Icons.WIFI if wifi_helper.is_connected() else ft.Icons.WIFI_OFF_ROUNDED
)
self.ico_wifi.color = (
ft.colors.GREEN if wifi_helper.is_connected() else ft.colors.ON_SURFACE
ft.Colors.GREEN if wifi_helper.is_connected() else ft.Colors.ON_SURFACE
)
self.ico_wifi.update()

def update_bluetooth_icon(self):
if bluetooth_helper.is_bluetooth_on():
self.ico_bluetooth.name = ft.icons.BLUETOOTH_ROUNDED
self.ico_bluetooth.color = ft.colors.ON_SURFACE
self.ico_bluetooth.name = ft.Icons.BLUETOOTH_ROUNDED
self.ico_bluetooth.color = ft.Colors.ON_SURFACE

if bluetooth_helper.is_discovery_on():
self.ico_bluetooth.color = ft.colors.GREEN
self.ico_bluetooth.color = ft.Colors.GREEN
else:
self.ico_bluetooth.color = ft.colors.ON_SURFACE
self.ico_bluetooth.color = ft.Colors.ON_SURFACE

else:
self.ico_bluetooth.name = ft.icons.BLUETOOTH_DISABLED_ROUNDED
self.ico_bluetooth.color = ft.colors.ON_SURFACE
self.ico_bluetooth.name = ft.Icons.BLUETOOTH_DISABLED_ROUNDED
self.ico_bluetooth.color = ft.Colors.ON_SURFACE

if bluetooth_helper.is_connected():
self.ico_bluetooth.name = ft.icons.BLUETOOTH_CONNECTED_ROUNDED
self.ico_bluetooth.color = ft.colors.GREEN
self.ico_bluetooth.name = ft.Icons.BLUETOOTH_CONNECTED_ROUNDED
self.ico_bluetooth.color = ft.Colors.GREEN

self.ico_bluetooth.update()

def update_volume_icon(self):
self.ico_volume.name = (
ft.icons.VOLUME_OFF_ROUNDED if audio_helper.is_mute() else ft.icons.VOLUME_UP_ROUNDED
ft.Icons.VOLUME_OFF_ROUNDED if audio_helper.is_mute() else ft.Icons.VOLUME_UP_ROUNDED
)
self.ico_volume.color = ft.colors.RED if audio_helper.is_mute() else ft.colors.ON_SURFACE
self.ico_volume.color = ft.Colors.RED if audio_helper.is_mute() else ft.Colors.ON_SURFACE
self.ico_volume.update()
self.txt_volume.value = (
f"{audio_helper.get_volume()}%" if not audio_helper.is_mute() else ""
Expand Down
6 changes: 3 additions & 3 deletions components/view/Theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ def get_scrollbar_theme(self) -> ft.ScrollbarTheme:
if system_helper.is_scrollbar_enabled():
scrollbar_theme = ft.ScrollbarTheme(
track_color={
ft.MaterialState.DEFAULT: ft.colors.TRANSPARENT,
ft.MaterialState.DEFAULT: ft.Colors.TRANSPARENT,
},
thumb_visibility=True,
thumb_color={
ft.MaterialState.HOVERED: ft.colors.GREY_500,
ft.MaterialState.DEFAULT: ft.colors.GREY_400,
ft.MaterialState.HOVERED: ft.Colors.GREY_500,
ft.MaterialState.DEFAULT: ft.Colors.GREY_400,
},
thickness=40,
radius=20,
Expand Down
Loading