From 06fceec84a1077e0d648d9b387c92ef2dc304379 Mon Sep 17 00:00:00 2001 From: alfrix Date: Thu, 30 Jun 2022 09:28:28 -0300 Subject: [PATCH] Change the deprecated VBox and HBox to oriented Boxes --- ks_includes/screen_panel.py | 2 +- panels/base_panel.py | 4 ++-- panels/bed_mesh.py | 6 +++--- panels/console.py | 4 ++-- panels/gcode_macros.py | 8 ++++---- panels/input_shaper.py | 4 ++-- panels/job_status.py | 6 +++--- panels/main_menu.py | 2 +- panels/move.py | 2 +- panels/network.py | 4 ++-- panels/temperature.py | 4 ++-- panels/zcalibrate.py | 2 +- screen.py | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ks_includes/screen_panel.py b/ks_includes/screen_panel.py index 3a72c762..361dde19 100644 --- a/ks_includes/screen_panel.py +++ b/ks_includes/screen_panel.py @@ -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) diff --git a/panels/base_panel.py b/panels/base_panel.py index 50b00584..3848c677 100644 --- a/panels/base_panel.py +++ b/panels/base_panel.py @@ -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']) diff --git a/panels/bed_mesh.py b/panels/bed_mesh.py index abb3886a..0f29557c 100644 --- a/panels/bed_mesh.py +++ b/panels/bed_mesh.py @@ -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) diff --git a/panels/console.py b/panels/console.py index 773eff23..36c733af 100644 --- a/panels/console.py +++ b/panels/console.py @@ -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) diff --git a/panels/gcode_macros.py b/panels/gcode_macros.py index 4e107d63..d634282e 100644 --- a/panels/gcode_macros.py +++ b/panels/gcode_macros.py @@ -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) diff --git a/panels/input_shaper.py b/panels/input_shaper.py index a6fb3c32..7eb0d9a5 100644 --- a/panels/input_shaper.py +++ b/panels/input_shaper.py @@ -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) diff --git a/panels/job_status.py b/panels/job_status.py index 174e6168..e6c37bfa 100644 --- a/panels/job_status.py +++ b/panels/job_status.py @@ -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']) diff --git a/panels/main_menu.py b/panels/main_menu.py index 0af0eed2..8fe65fc2 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -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 diff --git a/panels/move.py b/panels/move.py index b4cfd5cd..2ef226d2 100644 --- a/panels/move.py +++ b/panels/move.py @@ -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) diff --git a/panels/network.py b/panels/network.py index faca16c9..d516ceeb 100644 --- a/panels/network.py +++ b/panels/network.py @@ -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) diff --git a/panels/temperature.py b/panels/temperature.py index 47f8edf7..fc643c6a 100644 --- a/panels/temperature.py +++ b/panels/temperature.py @@ -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 diff --git a/panels/zcalibrate.py b/panels/zcalibrate.py index 4040605b..7b49d59c 100644 --- a/panels/zcalibrate.py +++ b/panels/zcalibrate.py @@ -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: diff --git a/screen.py b/screen.py index 14875c57..2fd8b5eb 100644 --- a/screen.py +++ b/screen.py @@ -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")