Skip to content

Commit

Permalink
add drag area and close button to settings view
Browse files Browse the repository at this point in the history
  • Loading branch information
T0jan committed Oct 28, 2024
1 parent fce6f64 commit f063933
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion kintree/gui/views/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@

# Settings AppBar
settings_appbar = ft.AppBar(
title=ft.Text('Ki-nTree Settings'),
title=ft.WindowDragArea(ft.Container(ft.Text('Ki-nTree Settings'),
width=10000), maximizable=True),
bgcolor=ft.colors.SURFACE_VARIANT
)

Expand Down Expand Up @@ -374,6 +375,15 @@ def __init__(self, page: ft.Page):

# Init view
super().__init__(page=page, appbar=settings_appbar, navigation_rail=settings_navrail)
if not self.appbar.actions:
self.appbar.actions.extend(
[
ft.IconButton(
ft.icons.CLOSE,
on_click=lambda _: page.window.close(),
),
]
)

# Update navigation rail
self.navigation_rail.on_change = self.nav_rail_redirect
Expand Down

0 comments on commit f063933

Please sign in to comment.