Swap left/right
This commit is contained in:
parent
09b877eab6
commit
67649fa7c0
1 changed files with 10 additions and 10 deletions
|
@ -21,10 +21,18 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
# Main horizontal box to split the screen
|
# Main horizontal box to split the screen
|
||||||
main_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
main_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||||
|
|
||||||
# Left half - File list
|
# Left half
|
||||||
left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
left_box.set_valign(Gtk.Align.CENTER)
|
||||||
|
left_box.set_halign(Gtk.Align.CENTER)
|
||||||
|
left_label = Gtk.Label(label="Left Side")
|
||||||
|
left_box.append(left_label)
|
||||||
left_box.set_hexpand(True)
|
left_box.set_hexpand(True)
|
||||||
|
|
||||||
|
# Right half - File list
|
||||||
|
right_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
right_box.set_hexpand(True)
|
||||||
|
|
||||||
# Create list store and view
|
# Create list store and view
|
||||||
list_store = Gtk.StringList()
|
list_store = Gtk.StringList()
|
||||||
list_view = Gtk.ListView()
|
list_view = Gtk.ListView()
|
||||||
|
@ -43,15 +51,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
# Add list view to a scrolled window
|
# Add list view to a scrolled window
|
||||||
scrolled = Gtk.ScrolledWindow()
|
scrolled = Gtk.ScrolledWindow()
|
||||||
scrolled.set_child(list_view)
|
scrolled.set_child(list_view)
|
||||||
left_box.append(scrolled)
|
right_box.append(scrolled)
|
||||||
|
|
||||||
# Right half
|
|
||||||
right_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
||||||
right_box.set_valign(Gtk.Align.CENTER)
|
|
||||||
right_box.set_halign(Gtk.Align.CENTER)
|
|
||||||
right_label = Gtk.Label(label="Right Side")
|
|
||||||
right_box.append(right_label)
|
|
||||||
right_box.set_hexpand(True)
|
|
||||||
|
|
||||||
# Add both halves to main box
|
# Add both halves to main box
|
||||||
main_box.append(left_box)
|
main_box.append(left_box)
|
||||||
|
|
Loading…
Reference in a new issue