Change the deprecated VBox and HBox to oriented Boxes

This commit is contained in:
alfrix 2022-06-30 09:28:28 -03:00 committed by Alfredo Monclus
parent 12d90bcffa
commit 06fceec84a
13 changed files with 25 additions and 25 deletions

View File

@ -25,7 +25,7 @@ class ScreenPanel:
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
self.content = Gtk.VBox()
self.content = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.content.get_style_context().add_class("content")
self.content.set_hexpand(True)
self.content.set_vexpand(True)

View File

@ -45,7 +45,7 @@ class BasePanel(ScreenPanel):
self.control['estop'].connect("clicked", self.emergency_stop)
# Action bar
self.action_bar = Gtk.VBox(spacing=5)
self.action_bar = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
if self._screen.vertical_mode:
self.action_bar.set_hexpand(True)
self.action_bar.set_vexpand(False)
@ -79,7 +79,7 @@ class BasePanel(ScreenPanel):
self.control['time_box'].set_halign(Gtk.Align.END)
self.control['time_box'].pack_end(self.control['time'], True, True, 5)
self.titlebar = Gtk.HBox(spacing=5)
self.titlebar = Gtk.Box(spacing=5)
self.titlebar.set_size_request(0, self._gtk.get_titlebar_height())
self.titlebar.set_valign(Gtk.Align.CENTER)
self.titlebar.add(self.control['temp_box'])

View File

@ -277,11 +277,11 @@ class BedMeshPanel(ScreenPanel):
save.set_hexpand(False)
save.connect("clicked", self.create_profile)
box = Gtk.HBox()
box = Gtk.Box()
box.pack_start(self.labels['profile_name'], True, True, 5)
box.pack_start(save, False, False, 5)
self.labels['create_profile'] = Gtk.VBox(spacing=5)
self.labels['create_profile'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
self.labels['create_profile'].set_valign(Gtk.Align.CENTER)
self.labels['create_profile'].set_hexpand(True)
self.labels['create_profile'].set_vexpand(True)
@ -350,7 +350,7 @@ class BedMeshPanel(ScreenPanel):
ax.zaxis.set_major_formatter('{x:.02f}')
fig.colorbar(surf, shrink=0.7, aspect=5, pad=0.25)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_hexpand(True)
box.set_vexpand(True)

View File

@ -50,7 +50,7 @@ class ConsolePanel(ScreenPanel):
o3_button = self._gtk.ButtonImage("refresh", _('Clear') + " ", None, .66, Gtk.PositionType.RIGHT, False)
o3_button.connect("clicked", self.clear)
options = Gtk.HBox()
options = Gtk.Box()
options.set_hexpand(True)
options.set_vexpand(False)
options.add(o1_lbl)
@ -99,7 +99,7 @@ class ConsolePanel(ScreenPanel):
"tv": tv
})
content_box = Gtk.VBox()
content_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
content_box.pack_start(options, False, False, 5)
content_box.add(sw)
content_box.pack_end(ebox, False, False, 0)

View File

@ -29,7 +29,7 @@ class MacroPanel(ScreenPanel):
adjust.connect("clicked", self.load_menu, 'options')
adjust.set_hexpand(False)
sbox = Gtk.HBox()
sbox = Gtk.Box()
sbox.set_vexpand(False)
sbox.pack_start(sort, False, False, 5)
sbox.pack_start(self.sort_btn, True, True, 5)
@ -39,7 +39,7 @@ class MacroPanel(ScreenPanel):
self.labels['macros'] = Gtk.Grid()
self.labels['macros_list'].add(self.labels['macros'])
self.labels['macros_menu'] = Gtk.VBox()
self.labels['macros_menu'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['macros_menu'].set_vexpand(True)
self.labels['macros_menu'].pack_start(sbox, False, False, 0)
self.labels['macros_menu'].pack_start(self.labels['macros_list'], True, True, 0)
@ -73,10 +73,10 @@ class MacroPanel(ScreenPanel):
btn.set_hexpand(False)
btn.set_halign(Gtk.Align.END)
labels = Gtk.VBox()
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.HBox(spacing=5)
dev = Gtk.Box(spacing=5)
dev.add(labels)
dev.add(btn)

View File

@ -87,14 +87,14 @@ class InputShaperPanel(ScreenPanel):
self.status.set_halign(Gtk.Align.START)
self.status.set_ellipsize(Pango.EllipsizeMode.END)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.add(auto_grid)
box.add(input_grid)
box.add(self.status)
self.content.add(box)
pobox = Gtk.VBox()
pobox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
test_x = self._gtk.Button(_("Measure X"))
test_x.connect("clicked", self.start_calibration, "x")
pobox.pack_start(test_x, True, True, 5)

View File

@ -89,7 +89,7 @@ class JobStatusPanel(ScreenPanel):
self.labels[label].set_halign(Gtk.Align.START)
self.labels[label].set_ellipsize(Pango.EllipsizeMode.END)
fi_box = Gtk.VBox()
fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
fi_box.add(self.labels['file'])
fi_box.add(self.labels['status'])
fi_box.add(self.labels['lcdmessage'])
@ -246,7 +246,7 @@ class JobStatusPanel(ScreenPanel):
szfe.attach(self.extrusion_button, 0, 1, 1, 1)
szfe.attach(self.fan_button, 1, 1, 1, 1)
info = Gtk.VBox()
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info.get_style_context().add_class("printing-info")
info.add(self.labels['temp_grid'])
info.add(szfe)
@ -286,7 +286,7 @@ class JobStatusPanel(ScreenPanel):
goback.set_hexpand(False)
goback.get_style_context().add_class("printing-info")
pos_box = Gtk.HBox(spacing=5)
pos_box = Gtk.Box(spacing=5)
pos_box.add(self.labels['pos_x'])
pos_box.add(self.labels['pos_y'])
pos_box.add(self.labels['pos_z'])

View File

@ -229,7 +229,7 @@ class MainPanel(MenuPanel):
self.labels['graph_show'].connect("clicked", self.graph_show_device)
popover = Gtk.Popover()
self.labels['popover_vbox'] = Gtk.VBox()
self.labels['popover_vbox'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
popover.add(self.labels['popover_vbox'])
popover.set_position(Gtk.PositionType.BOTTOM)
self.labels['popover'] = popover

View File

@ -134,7 +134,7 @@ class MovePanel(ScreenPanel):
bottomgrid.attach(self.labels['move_dist'], 0, 1, 3, 1)
bottomgrid.attach(adjust, 3, 0, 1, 2)
self.labels['move_menu'] = Gtk.VBox()
self.labels['move_menu'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['move_menu'].set_vexpand(True)
self.labels['move_menu'].pack_start(grid, True, True, 0)
self.labels['move_menu'].pack_start(bottomgrid, True, True, 0)

View File

@ -362,11 +362,11 @@ class NetworkPanel(ScreenPanel):
save.set_hexpand(False)
save.connect("clicked", self.add_new_network, ssid, True)
box = Gtk.HBox()
box = Gtk.Box()
box.pack_start(self.labels['network_psk'], True, True, 5)
box.pack_start(save, False, False, 5)
self.labels['add_network'] = Gtk.VBox(spacing=5)
self.labels['add_network'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
self.labels['add_network'].set_valign(Gtk.Align.CENTER)
self.labels['add_network'].set_hexpand(True)
self.labels['add_network'].set_vexpand(True)

View File

@ -126,7 +126,7 @@ class TemperaturePanel(ScreenPanel):
self.labels["deg" + self.tempdelta].set_active(True)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(Gtk.Label(_("Temperature") + " (°C)"), False, False, 8)
vbox.pack_end(tempgrid, True, True, 2)
@ -441,7 +441,7 @@ class TemperaturePanel(ScreenPanel):
self.labels['graph_show'].connect("clicked", self.graph_show_device)
popover = Gtk.Popover()
self.labels['popover_vbox'] = Gtk.VBox()
self.labels['popover_vbox'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
popover.add(self.labels['popover_vbox'])
popover.set_position(Gtk.PositionType.BOTTOM)
self.labels['popover'] = popover

View File

@ -57,7 +57,7 @@ class ZCalibratePanel(ScreenPanel):
self.widgets['cancel'].connect("clicked", self.abort)
functions = ["endstop", "probe", "mesh", "delta", "delta_manual"]
pobox = Gtk.VBox()
pobox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
endstop = (self._printer.config_section_exists("stepper_z") and
not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"))
if endstop:

View File

@ -1035,7 +1035,7 @@ class KlipperScreen(Gtk.Window):
keyboard = Gtk.Socket()
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_vexpand(False)
box.set_size_request(self.gtk.get_content_width(), self.gtk.get_keyboard_height())
box.get_style_context().add_class("keyboard_box")