mirror of
https://github.com/Afacanc38/gtk-examples-python.git
synced 2024-12-21 18:39:07 +03:00
updated 6-view-switcher.py
This commit is contained in:
parent
cc295c020d
commit
c09d764dbb
1 changed files with 16 additions and 6 deletions
|
@ -39,7 +39,9 @@ class MainWindow (Adw.ApplicationWindow):
|
|||
self.box_main
|
||||
)
|
||||
|
||||
self.hb = Adw.HeaderBar ()
|
||||
self.hb = Adw.HeaderBar (
|
||||
centering_policy = Adw.CenteringPolicy.STRICT
|
||||
)
|
||||
self.box_main.append (self.hb)
|
||||
|
||||
self.stack = Adw.ViewStack ()
|
||||
|
@ -47,8 +49,10 @@ class MainWindow (Adw.ApplicationWindow):
|
|||
self.stack
|
||||
)
|
||||
|
||||
# Squieezer
|
||||
self.sq_viewswitcher = Adw.Squeezer ()
|
||||
# Squeezer
|
||||
self.sq_viewswitcher = Adw.Squeezer (
|
||||
halign = Gtk.Align.FILL,
|
||||
)
|
||||
self.sq_viewswitcher.set_switch_threshold_policy (
|
||||
Adw.FoldThresholdPolicy.NATURAL
|
||||
)
|
||||
|
@ -62,7 +66,11 @@ class MainWindow (Adw.ApplicationWindow):
|
|||
)
|
||||
|
||||
# ViewSwitcher (wide)
|
||||
self.viewswitcher_wide = Adw.ViewSwitcher ()
|
||||
self.viewswitcher_wide = Adw.ViewSwitcher (
|
||||
halign = Gtk.Align.CENTER,
|
||||
margin_start = 50,
|
||||
margin_end = 50
|
||||
)
|
||||
self.viewswitcher_wide.set_policy(
|
||||
Adw.ViewSwitcherPolicy.WIDE
|
||||
)
|
||||
|
@ -74,7 +82,9 @@ class MainWindow (Adw.ApplicationWindow):
|
|||
)
|
||||
|
||||
# ViewSwitcher (narrow)
|
||||
self.viewswitcher_narrow = Adw.ViewSwitcher ()
|
||||
self.viewswitcher_narrow = Adw.ViewSwitcher (
|
||||
halign = Gtk.Align.CENTER,
|
||||
)
|
||||
self.viewswitcher_narrow.set_policy(
|
||||
Adw.ViewSwitcherPolicy.NARROW
|
||||
)
|
||||
|
@ -181,4 +191,4 @@ class MyApp (Adw.Application):
|
|||
app = MyApp (
|
||||
application_id = 'io.github.afacanc38.adw-viewswitcher'
|
||||
)
|
||||
app.run (sys.argv)
|
||||
app.run (sys.argv)
|
||||
|
|
Loading…
Reference in a new issue