Ticket #3108: intro.5.diff
| File intro.5.diff, 1.8 kB (added by khaled, 5 years ago) |
|---|
-
intro.py
old new 32 32 33 33 import colorpicker 34 34 35 from sugar.graphics.window import Window 36 if Window().get_direction() == gtk.TEXT_DIR_RTL: 37 _DIRECTION = 'rtl' 38 else: 39 _DIRECTION = 'ltr' 40 35 41 _BACKGROUND_COLOR = style.COLOR_PANEL_GREY 36 42 37 43 class _Page(hippo.CanvasBox): … … 75 81 widget.set_max_length(45) 76 82 77 83 self.append(self._entry) 84 85 if _DIRECTION == 'rtl': 86 self.reverse() 78 87 79 88 def _text_changed_cb(self, entry, pspec): 80 89 valid = len(entry.props.text.strip()) > 0 … … 144 153 145 154 if self._page != self.PAGE_FIRST: 146 155 back_button = hippo.CanvasButton(text=_('Back')) 147 image = Icon(icon_name='go-left') 156 if _DIRECTION == 'rtl': 157 image = Icon(icon_name='go-right') 158 else: 159 image = Icon(icon_name='go-left') 148 160 back_button.props.widget.set_image(image) 149 161 back_button.connect('activated', self._back_activated_cb) 150 162 button_box.append(back_button) … … 153 165 button_box.append(spacer, hippo.PACK_EXPAND) 154 166 155 167 self._next_button = hippo.CanvasButton() 156 image = Icon(icon_name='go-right') 168 if _DIRECTION == 'rtl': 169 image = Icon(icon_name='go-left') 170 else: 171 image = Icon(icon_name='go-right') 157 172 self._next_button.props.widget.set_image(image) 158 173 159 174 if self._page == self.PAGE_LAST: … … 172 187 self._page_valid_changed_cb) 173 188 self.append(button_box) 174 189 190 if _DIRECTION == 'rtl': 191 button_box.reverse() 192 175 193 def _update_next_button(self): 176 194 widget = self._next_button.props.widget 177 195 widget.props.sensitive = self._current_page.props.valid
