mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
feat: make back button optional
This commit is contained in:
1 parent
6c192741ec
commit
63beb61878
1 file changed
+4
-3
+4
-3
@@ -3224,7 +3224,7 @@ class EntryDialog(GenericDialog):
|
|||||||
|
|
||||||
|
|
||||||
class ScrollableNote(Gtk.Box):
|
class ScrollableNote(Gtk.Box):
|
||||||
def __init__(self, content_box: Gtk.Box):
|
def __init__(self, content_box: Gtk.Box, back_button=True):
|
||||||
super().__init__(orientation=Gtk.Orientation.VERTICAL)
|
super().__init__(orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
|
||||||
self.scrollable = Gtk.ScrolledWindow()
|
self.scrollable = Gtk.ScrolledWindow()
|
||||||
@@ -3233,12 +3233,13 @@ class ScrollableNote(Gtk.Box):
|
|||||||
self.back_button = Gtk.Button(
|
self.back_button = Gtk.Button(
|
||||||
label="Back", hexpand=True, halign=Gtk.Align.CENTER
|
label="Back", hexpand=True, halign=Gtk.Align.CENTER
|
||||||
)
|
)
|
||||||
self.back_button.connect("clicked", self._on_back_clicked)
|
|
||||||
|
|
||||||
self.gutter = Gtk.Box(
|
self.gutter = Gtk.Box(
|
||||||
orientation=Gtk.Orientation.HORIZONTAL, valign=Gtk.Align.END
|
orientation=Gtk.Orientation.HORIZONTAL, valign=Gtk.Align.END
|
||||||
)
|
)
|
||||||
self.gutter.add(self.back_button)
|
if back_button:
|
||||||
|
self.gutter.add(self.back_button)
|
||||||
|
self.back_button.connect("clicked", self._on_back_clicked)
|
||||||
|
|
||||||
self.scrollable.add(content_box)
|
self.scrollable.add(content_box)
|
||||||
self.add(self.scrollable)
|
self.add(self.scrollable)
|
||||||
|
|||||||
Reference in new issue
Block a user