Enter -> next in the intro screen name page.
This commit is contained in:
parent
d4ea1f8101
commit
377fdbe9b6
1
NEWS
1
NEWS
@ -1,3 +1,4 @@
|
||||
* #2486 In the intro screen name page enter goes to next page. (marco)
|
||||
* #2570 Accept correctly image drops from Record.
|
||||
* Add Greek translation. (simosx)
|
||||
* #2564 Use the activity service name as the base name for translation files.
|
||||
|
@ -52,21 +52,30 @@ class _Page(hippo.CanvasBox):
|
||||
return self.valid
|
||||
|
||||
class _NamePage(_Page):
|
||||
def __init__(self):
|
||||
def __init__(self, intro):
|
||||
_Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,
|
||||
background_color=_BACKGROUND_COLOR.get_int(),
|
||||
spacing=style.DEFAULT_SPACING,
|
||||
orientation=hippo.ORIENTATION_HORIZONTAL,)
|
||||
|
||||
self._intro = intro
|
||||
|
||||
label = hippo.CanvasText(text=_("Name:"))
|
||||
self.append(label)
|
||||
|
||||
self._entry = CanvasEntry(box_width=style.zoom(300))
|
||||
self._entry.set_background(_BACKGROUND_COLOR.get_html())
|
||||
self._entry.props.widget.set_max_length(45)
|
||||
self._entry.connect('notify::text', self._text_changed_cb)
|
||||
|
||||
widget = self._entry.props.widget
|
||||
widget.set_max_length(45)
|
||||
widget.connect('activate', self._entry_activate_cb)
|
||||
|
||||
self.append(self._entry)
|
||||
|
||||
def _entry_activate_cb(self, entry):
|
||||
self._intro.next()
|
||||
|
||||
def _text_changed_cb(self, entry, pspec):
|
||||
valid = len(entry.props.text.strip()) > 0
|
||||
self.set_valid(valid)
|
||||
@ -112,12 +121,16 @@ class _IntroBox(hippo.CanvasBox):
|
||||
background_color=_BACKGROUND_COLOR.get_int())
|
||||
|
||||
self._page = self.PAGE_NAME
|
||||
self._name_page = _NamePage()
|
||||
self._name_page = _NamePage(self)
|
||||
self._color_page = _ColorPage()
|
||||
self._current_page = None
|
||||
|
||||
self._setup_page()
|
||||
|
||||
def next(self):
|
||||
self._page += 1
|
||||
self._setup_page()
|
||||
|
||||
def _setup_page(self):
|
||||
self.remove_all()
|
||||
|
||||
@ -165,8 +178,7 @@ class _IntroBox(hippo.CanvasBox):
|
||||
self._setup_page()
|
||||
|
||||
def _next_activated_cb(self, item):
|
||||
self._page += 1
|
||||
self._setup_page()
|
||||
self.next()
|
||||
|
||||
def _done_activated_cb(self, item):
|
||||
path = os.path.join(os.path.dirname(__file__), 'default-picture.png')
|
||||
|
Loading…
Reference in New Issue
Block a user