Fix the layout to be less insane.

This commit is contained in:
June Tate-Gans 2023-10-28 13:06:15 -05:00
parent 88af73ade3
commit f026b0d815

View File

@ -38,17 +38,14 @@ class MainWindow(Gtk.ApplicationWindow, GtkObserver):
self._box = Gtk.Box(spacing=6, orientation=Gtk.Orientation.VERTICAL)
self._box.set_border_width(6)
self._box.set_margin_left(6)
self._box.set_margin_right(6)
self.add(self._box)
self._infoBar = Gtk.InfoBar()
self._infoBar.set_no_show_all(True)
self._infoBarLabel = Gtk.Label()
self._infoBar.get_content_area().add(self._infoBarLabel)
self._infoBarLabel.show()
self._box.add(self._infoBar)
self.setupG13ButtonGrid()
self.set_resizable(False)
self.show_all()
def _updateProfileRegistration(self):
@ -96,26 +93,37 @@ class MainWindow(Gtk.ApplicationWindow, GtkObserver):
def setupG13ButtonGrid(self):
self._mButtons = Gtk.ButtonBox(
spacing=3,
spacing=6,
orientation=Gtk.Orientation.HORIZONTAL,
baseline_position=Gtk.BaselinePosition.CENTER)
self._mButtons.set_layout(Gtk.ButtonBoxStyle.CENTER)
self._box.pack_start(self._mButtons, False, False, 6)
self._mButtons.set_hexpand(False)
self._mButtons.set_vexpand(False)
self._box.pack_start(self._mButtons, True, False, 6)
self._keyGrid = Gtk.Grid()
self._keyGrid.set_hexpand(False)
self._keyGrid.set_vexpand(False)
self._keyGrid.set_row_spacing(3)
self._keyGrid.set_column_spacing(3)
self._box.pack_start(self._keyGrid, False, False, 6)
self._keyGrid.set_row_spacing(6)
self._keyGrid.set_column_spacing(6)
self._keyGrid.set_row_homogeneous(True)
self._keyGrid.set_column_homogeneous(True)
self._box.pack_start(self._keyGrid, True, False, 6)
self._stickGrid = Gtk.Grid()
self._stickGrid.set_row_spacing(3)
self._stickGrid.set_column_spacing(3)
self._box.pack_start(self._stickGrid, False, False, 6)
self._stickGrid.set_hexpand(False)
self._stickGrid.set_vexpand(False)
self._stickGrid.set_row_spacing(6)
self._stickGrid.set_column_spacing(6)
self._stickGrid.set_row_homogeneous(True)
self._stickGrid.set_column_homogeneous(True)
self._box.pack_start(self._stickGrid, True, False, 6)
self._g13Buttons = {}
mrButton = self.newG13Button('MR')
mrButton.set_sensitive(False)
self._mButtons.pack_start(mrButton, False, False, 6)
self._mButtons.pack_start(self.newG13Button('M1'), False, False, 6)
self._mButtons.pack_start(self.newG13Button('M2'), False, False, 6)
self._mButtons.pack_start(self.newG13Button('M3'), False, False, 6)