diff --git a/components/BluetoothDeviceConnected.py b/components/BluetoothDeviceConnected.py index e2dc53d..28b9762 100644 --- a/components/BluetoothDeviceConnected.py +++ b/components/BluetoothDeviceConnected.py @@ -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( diff --git a/components/BluetoothDiscoveryToggle.py b/components/BluetoothDiscoveryToggle.py index 99ce12a..1815b33 100644 --- a/components/BluetoothDiscoveryToggle.py +++ b/components/BluetoothDiscoveryToggle.py @@ -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 @@ -22,7 +22,7 @@ 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() @@ -30,8 +30,8 @@ def __init__(self, on_dicovery_enabled, on_dicovery_disabled): 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() @@ -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() diff --git a/components/NavigationBar.py b/components/NavigationBar.py index 58baae9..803d33a 100644 --- a/components/NavigationBar.py +++ b/components/NavigationBar.py @@ -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), ) ) diff --git a/components/RadioGrid.py b/components/RadioGrid.py index 3380cb7..7050e66 100644 --- a/components/RadioGrid.py +++ b/components/RadioGrid.py @@ -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 ), @@ -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, diff --git a/components/SongInfoRow.py b/components/SongInfoRow.py index fdb0352..0eaa274 100644 --- a/components/SongInfoRow.py +++ b/components/SongInfoRow.py @@ -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(), ), ] diff --git a/components/SoundboardSearchBar.py b/components/SoundboardSearchBar.py index e192b95..46989ca 100644 --- a/components/SoundboardSearchBar.py +++ b/components/SoundboardSearchBar.py @@ -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) diff --git a/components/ToastCard.py b/components/ToastCard.py index 5b8f813..39fb414 100644 --- a/components/ToastCard.py +++ b/components/ToastCard.py @@ -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), diff --git a/components/dialogs/ErrorDialog.py b/components/dialogs/ErrorDialog.py index d418816..40e5fb4 100644 --- a/components/dialogs/ErrorDialog.py +++ b/components/dialogs/ErrorDialog.py @@ -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__() diff --git a/components/dialogs/RadioSearchDialog.py b/components/dialogs/RadioSearchDialog.py index 44737ed..e7b9b04 100644 --- a/components/dialogs/RadioSearchDialog.py +++ b/components/dialogs/RadioSearchDialog.py @@ -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"], diff --git a/components/dialogs/SettingsAppControlDialog.py b/components/dialogs/SettingsAppControlDialog.py index 6bb0ea4..c90a247 100644 --- a/components/dialogs/SettingsAppControlDialog.py +++ b/components/dialogs/SettingsAppControlDialog.py @@ -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(), ), @@ -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(), ), diff --git a/components/dialogs/SettingsShutdownDialog.py b/components/dialogs/SettingsShutdownDialog.py index bdbe229..a7edbfa 100644 --- a/components/dialogs/SettingsShutdownDialog.py +++ b/components/dialogs/SettingsShutdownDialog.py @@ -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(), ), @@ -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(), ), diff --git a/components/dialogs/SettingsUpdateDialog.py b/components/dialogs/SettingsUpdateDialog.py index 44a3239..aad3aa2 100644 --- a/components/dialogs/SettingsUpdateDialog.py +++ b/components/dialogs/SettingsUpdateDialog.py @@ -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( diff --git a/components/dialogs/SoundboardSearchDialog.py b/components/dialogs/SoundboardSearchDialog.py index 1403b4f..ece9b63 100644 --- a/components/dialogs/SoundboardSearchDialog.py +++ b/components/dialogs/SoundboardSearchDialog.py @@ -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): diff --git a/components/dialogs/SuccessDialog.py b/components/dialogs/SuccessDialog.py index fed57fd..241b662 100644 --- a/components/dialogs/SuccessDialog.py +++ b/components/dialogs/SuccessDialog.py @@ -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__() diff --git a/components/dialogs/UpdatesRestartDialog.py b/components/dialogs/UpdatesRestartDialog.py index ada5c5b..fc3e116 100644 --- a/components/dialogs/UpdatesRestartDialog.py +++ b/components/dialogs/UpdatesRestartDialog.py @@ -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(), ), @@ -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(), ), diff --git a/components/dialogs/WifiDialog.py b/components/dialogs/WifiDialog.py index f90deed..ec50868 100644 --- a/components/dialogs/WifiDialog.py +++ b/components/dialogs/WifiDialog.py @@ -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), diff --git a/components/view/Taskbar.py b/components/view/Taskbar.py index 89f1fd3..649ae08 100644 --- a/components/view/Taskbar.py +++ b/components/view/Taskbar.py @@ -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): @@ -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] @@ -92,9 +92,9 @@ 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() @@ -102,38 +102,38 @@ def toggle_theme(self): 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 "" diff --git a/components/view/Theme.py b/components/view/Theme.py index 0e89d3f..ea77e0b 100644 --- a/components/view/Theme.py +++ b/components/view/Theme.py @@ -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, diff --git a/components/view/tabs/SettingsTab.py b/components/view/tabs/SettingsTab.py index 1ca4b9d..aedd0d2 100644 --- a/components/view/tabs/SettingsTab.py +++ b/components/view/tabs/SettingsTab.py @@ -43,40 +43,40 @@ def __init__(self): run_spacing=50, controls=[ SettingsButton( - ft.icons.POWER_SETTINGS_NEW, + ft.Icons.POWER_SETTINGS_NEW, "Ausschalten", lambda e: self.shutdown_dialog.open_dialog(), ), SettingsButton( - ft.icons.EXIT_TO_APP, + ft.Icons.EXIT_TO_APP, "App", lambda e: self.app_control_dialog.open_dialog(), ), SettingsButton( - ft.icons.DEVICES, + ft.Icons.DEVICES, "System", lambda e: self.system_dialog.open_dialog(), ), SettingsButton( - ft.icons.DISPLAY_SETTINGS, + ft.Icons.DISPLAY_SETTINGS, "Anzeige", lambda e: self.display_dialog.open_dialog(), ), SettingsButton( - ft.icons.COLOR_LENS, + ft.Icons.COLOR_LENS, "LED-Streifen", lambda e: self.led_dialog.open_dialog(), ), SettingsButton( - ft.icons.INFO, "Info", lambda e: self.info_dialog.open_dialog() + ft.Icons.INFO, "Info", lambda e: self.info_dialog.open_dialog() ), SettingsButton( - ft.icons.FILE_DOWNLOAD_OUTLINED, + ft.Icons.FILE_DOWNLOAD_OUTLINED, "Updates", lambda e: self.update_dialog.open_dialog(), ), SettingsButton( - ft.icons.STAR, + ft.Icons.STAR, "Credits", lambda e: self.credits_dialog.open_dialog(), ), diff --git a/main.py b/main.py index 9d7220c..97e2c0f 100644 --- a/main.py +++ b/main.py @@ -58,8 +58,8 @@ def main(page: ft.Page): page.navigation_bar = theme.navbar page.appbar = taskbar - page.window_maximized = True - page.window_frameless = True + page.window.maximized = True + page.window.frameless = True page.spacing = 0 page.theme = theme.get() page.dark_theme = theme.get() diff --git a/requirements.txt b/requirements.txt index 021b3c8..693f61f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -flet==0.24.1 +flet==0.28.3 RPi.GPIO==0.7.1a4 lgpio==0.2.2.0 rpi-rotary-encoder==0.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index ea08388..6ce8d3a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -flet==0.24.1 +flet==0.28.3 RPi.GPIO==0.7.1a4 lgpio==0.2.2.0 rpi-rotary-encoder==0.2.0