Skip to content

Commit f063933

Browse files
committed
add drag area and close button to settings view
1 parent fce6f64 commit f063933

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

kintree/gui/views/settings.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@
306306

307307
# Settings AppBar
308308
settings_appbar = ft.AppBar(
309-
title=ft.Text('Ki-nTree Settings'),
309+
title=ft.WindowDragArea(ft.Container(ft.Text('Ki-nTree Settings'),
310+
width=10000), maximizable=True),
310311
bgcolor=ft.colors.SURFACE_VARIANT
311312
)
312313

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

375376
# Init view
376377
super().__init__(page=page, appbar=settings_appbar, navigation_rail=settings_navrail)
378+
if not self.appbar.actions:
379+
self.appbar.actions.extend(
380+
[
381+
ft.IconButton(
382+
ft.icons.CLOSE,
383+
on_click=lambda _: page.window.close(),
384+
),
385+
]
386+
)
377387

378388
# Update navigation rail
379389
self.navigation_rail.on_change = self.nav_rail_redirect

0 commit comments

Comments
 (0)