Ticket #4197: 0001-Expand-rows-on-tap-click-SL-4197.patch

File 0001-Expand-rows-on-tap-click-SL-4197.patch, 1.7 KB (added by humitos, 11 years ago)
  • readactivity.py

    From d2f6f15d2de098fb0f4cac1a57eece029b1f9708 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Mon, 26 Nov 2012 12:58:48 -0300
    Subject: [PATCH Read] Expand rows on tap/click SL #4197
    
    This patch changes the normal behaviour of the clicks on rows, so they
    are expanded just tapping/clicking once on them. This is helpful when
    the XO is used in eBook mode because the arrows are really small and
    difficult to tap with the finger.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     readactivity.py | 14 ++++++++++++++
     1 file changed, 14 insertions(+)
    
    diff --git a/readactivity.py b/readactivity.py
    index beed2b4..fc08aec 100644
    a b class ReadActivity(activity.Activity): 
    392392        self._view_toolbar.show_nav_button()
    393393
    394394    def _create_navigator(self):
     395        def __cursor_changed_cb(treeview):
     396            selection = treeview.get_selection()
     397            store, iter = selection.get_selected()
     398            if iter is None:
     399                # Nothing selected. This happens at startup
     400                return
     401            if store.iter_has_child(iter):
     402                path = store.get_path(iter)
     403                if treeview.row_expanded(path):
     404                    treeview.collapse_row(path)
     405                else:
     406                    treeview.expand_row(path, False)
     407
    395408        self._toc_visible = False
    396409        self._update_toc_view = False
    397410        toc_navigator = Gtk.TreeView()
    398411        toc_navigator.set_enable_search(False)
     412        toc_navigator.connect('cursor-changed', __cursor_changed_cb)
    399413        toc_selection = toc_navigator.get_selection()
    400414        toc_selection.set_mode(Gtk.SelectionMode.SINGLE)
    401415