diff --git a/panels/bed_level.py b/panels/bed_level.py index 82468dad..a73e461c 100644 --- a/panels/bed_level.py +++ b/panels/bed_level.py @@ -90,10 +90,16 @@ class BedLevelPanel(ScreenPanel): self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 3, 3) self.labels['fr'].connect("clicked", self.go_to_position, self.screws[1]) - grid.attach(self.labels['bl'], 1, 0, 1, 1) - grid.attach(self.labels['br'], 2, 0, 1, 1) - grid.attach(self.labels['fl'], 1, 1, 1, 1) - grid.attach(self.labels['fr'], 2, 1, 1, 1) + if self._screen.lang_ltr: + grid.attach(self.labels['bl'], 1, 0, 1, 1) + grid.attach(self.labels['br'], 2, 0, 1, 1) + grid.attach(self.labels['fl'], 1, 1, 1, 1) + grid.attach(self.labels['fr'], 2, 1, 1, 1) + else: + grid.attach(self.labels['bl'], 2, 0, 1, 1) + grid.attach(self.labels['br'], 1, 0, 1, 1) + grid.attach(self.labels['fl'], 2, 1, 1, 1) + grid.attach(self.labels['fr'], 1, 1, 1, 1) self.labels['home'] = self._gtk.ButtonImage("home",_("Home All"),"color2") self.labels['home'].connect("clicked", self.home) diff --git a/panels/move.py b/panels/move.py index 75a7b6d1..f5ff7d5e 100644 --- a/panels/move.py +++ b/panels/move.py @@ -40,9 +40,12 @@ class MovePanel(ScreenPanel): self.labels['home'] = self._gtk.ButtonImage("home", _("Home All")) self.labels['home'].connect("clicked", self.home) - - grid.attach(self.labels['x+'], 2, 1, 1, 1) - grid.attach(self.labels['x-'], 0, 1, 1, 1) + if self._screen.lang_ltr: + grid.attach(self.labels['x+'], 2, 1, 1, 1) + grid.attach(self.labels['x-'], 0, 1, 1, 1) + else: + grid.attach(self.labels['x+'], 0, 1, 1, 1) + grid.attach(self.labels['x-'], 2, 1, 1, 1) grid.attach(self.labels['y+'], 1, 0, 1, 1) grid.attach(self.labels['y-'], 1, 1, 1, 1) grid.attach(self.labels['z+'], 3, 0, 1, 1) @@ -54,11 +57,12 @@ class MovePanel(ScreenPanel): j = 0; for i in self.distances: self.labels[i] = self._gtk.ToggleButton(i) + self.labels[i].set_direction(Gtk.TextDirection.LTR) self.labels[i].connect("clicked", self.change_distance, i) ctx = self.labels[i].get_style_context() - if j == 0: + if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1): ctx.add_class("distbutton_top") - elif j == len(self.distances)-1: + elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1): ctx.add_class("distbutton_bottom") else: ctx.add_class("distbutton") @@ -76,6 +80,7 @@ class MovePanel(ScreenPanel): box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) bottomgrid = self._gtk.HomogeneousGrid() + bottomgrid.set_direction(Gtk.TextDirection.LTR) self.labels['pos_x'] = Gtk.Label("X: 0") self.labels['pos_y'] = Gtk.Label("Y: 0") self.labels['pos_z'] = Gtk.Label("Z: 0") diff --git a/panels/temperature.py b/panels/temperature.py index 70221fa3..db34c778 100644 --- a/panels/temperature.py +++ b/panels/temperature.py @@ -113,6 +113,7 @@ class TemperaturePanel(ScreenPanel): _ = self.lang.gettext numpad = self._gtk.HomogeneousGrid() + numpad.set_direction(Gtk.TextDirection.LTR) keys = [ ['1','numpad_tleft'], diff --git a/panels/zcalibrate.py b/panels/zcalibrate.py index e47203e4..6564989b 100644 --- a/panels/zcalibrate.py +++ b/panels/zcalibrate.py @@ -43,11 +43,12 @@ class ZCalibratePanel(ScreenPanel): j = 0; for i in self.distances: self.labels[i] = self._gtk.ToggleButton(i) + self.labels[i].set_direction(Gtk.TextDirection.LTR) self.labels[i].connect("clicked", self.change_distance, i) ctx = self.labels[i].get_style_context() - if j == 0: + if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1): ctx.add_class("distbutton_top") - elif j == len(self.distances)-1: + elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1): ctx.add_class("distbutton_bottom") else: ctx.add_class("distbutton")