diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-03 00:59:50 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-01-14 13:47:17 (GMT) |
commit | 0bf9d535f55ed4b93e951de0fb980196cff84815 (patch) | |
tree | c339e371a63e1a98cea100e9f8df480ac3f354d9 | |
parent | 1ad55d78cb819e9f632b16ceac6a676166db86bc (diff) |
Start the activity when the treeview row is activated
This makes the "activate" accessible action work, which is useful
both for the UI tests (sugar-build) and accessibility.
It shouldn't interfer with the normal mouse behavior because gtk
only calls row_activated on a double click.
Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | src/jarabe/desktop/activitieslist.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py index 6594ee9..738a54f 100644 --- a/src/jarabe/desktop/activitieslist.py +++ b/src/jarabe/desktop/activitieslist.py @@ -80,6 +80,8 @@ class ActivitiesTreeView(Gtk.TreeView): column.add_attribute(cell_icon, 'file-name', ListModel.COLUMN_ICON) self.append_column(column) + self._icon_column = column + cell_text = Gtk.CellRendererText() cell_text.props.ellipsize = Pango.EllipsizeMode.MIDDLE cell_text.props.ellipsize_set = True @@ -143,6 +145,9 @@ class ActivitiesTreeView(Gtk.TreeView): not row[ListModel.COLUMN_FAVORITE]) def __icon_clicked_cb(self, cell, path): + self._start_activity(path) + + def _start_activity(self, path): row = self.get_model()[path] registry = bundleregistry.get_registry() @@ -165,6 +170,9 @@ class ActivitiesTreeView(Gtk.TreeView): title = normalize_string(title.decode('utf-8')) return title is not None and title.find(self._query) > -1 + def do_row_activated(self, path, column): + if column == self._icon_column: + self._start_activity(path) class ListModel(Gtk.TreeModelSort): __gtype_name__ = 'SugarListModel' |