1
0
Fork 0
forked from Fuji/Fuji

Add restart button to snackbar on Settings page

This commit is contained in:
mily 2025-03-07 21:35:57 +01:00
parent ed6d3f1df4
commit 50a52ce311
2 changed files with 17 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import flet as ft
from constants import *
from utils import setthemecolor, setlanguage
from utils import setthemecolor, setlanguage, restart
from i18n import _
def SettingsPage():
@ -18,6 +18,11 @@ def SettingsPage():
ft.Icon(ft.icons.INFO_OUTLINED, color=ft.colors.AMBER),
ft.Text(_("Settings changed. Restart required for changes to take effect."),
color=ft.colors.BLACK, expand=True),
ft.TextButton(
text=_("Restart"),
on_click=lambda e: restart(e.page),
style=ft.ButtonStyle(color=ft.colors.BLUE),
),
ft.IconButton(
icon=ft.icons.CLOSE,
icon_color=ft.colors.GREY_800,
@ -26,6 +31,7 @@ def SettingsPage():
)
])
)
def hide_notification():
notification.visible = False
@ -98,4 +104,4 @@ def SettingsPage():
main_container.content = main_content
main_container.expand = True # Make the main container expand
return main_container
return main_container