diff --git a/panels/main_menu.py b/panels/main_menu.py index f9fb10a9..759be0ea 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -29,7 +29,7 @@ class MainPanel(MenuPanel): if i > 3: break self.labels[x] = self._gtk.ButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0)) - col = 0 if len(self._printer.get_tools()) == 1 else (i%2 if self._screen.lang_ltr else 1 - i%2) + col = 0 if len(self._printer.get_tools()) == 1 else i%2 row = i/2 eq_grid.attach(self.labels[x], col, row, 1, 1) i += 1 @@ -47,12 +47,8 @@ class MainPanel(MenuPanel): self.grid.set_row_homogeneous(True) self.grid.set_column_homogeneous(True) - if self._screen.lang_ltr: - grid.attach(eq_grid, 0, 0, 1, 1) - grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1) - else: - grid.attach(eq_grid, 1, 0, 1, 1) - grid.attach(self.arrangeMenuItems(items, 2, True), 0, 0, 1, 1) + grid.attach(eq_grid, 0, 0, 1, 1) + grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1) self.grid = grid diff --git a/panels/menu.py b/panels/menu.py index 02065d62..00f30a7e 100644 --- a/panels/menu.py +++ b/panels/menu.py @@ -42,14 +42,12 @@ class MenuPanel(ScreenPanel): if not self.evaluate_enable(item[key]['enable']): continue - col = i % columns if self._screen.lang_ltr == True else (columns - (i % columns) - 1) + col = i % columns row = int(i/columns) width = 1 if expandLast == True and i+1 == l and l%2 == 1: width = 2 - if not self._screen.lang_ltr: - col = col - 1 self.grid.attach(self.labels[key], col, row, width, 1) i += 1 diff --git a/screen.py b/screen.py index 2b60a010..06ee4ae4 100644 --- a/screen.py +++ b/screen.py @@ -108,6 +108,7 @@ class KlipperScreen(Gtk.Window): for lang in self.rtl_languages: if os.getenv('LANG').lower().startswith(lang): self.lang_ltr = False + Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL) logger.debug("Enabling RTL mode") break