[gnome-documents] utils: remove obsolete set_activate_on_single_click() utility function
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] utils: remove obsolete set_activate_on_single_click() utility function
- Date: Tue, 2 Apr 2013 21:10:32 +0000 (UTC)
commit 2c7007d0463ccac392b7a16240605165350eec36
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Apr 2 17:05:52 2013 -0400
utils: remove obsolete set_activate_on_single_click() utility function
GtkTreeView now has the same feature built-in.
src/lib/gd-utils.c | 51 ---------------------------------------------------
src/lib/gd-utils.h | 3 ---
src/manager.js | 4 ++--
3 files changed, 2 insertions(+), 56 deletions(-)
---
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index f9e3dab..1d1e367 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -113,57 +113,6 @@ gd_queue_thumbnail_job_for_file_finish (GAsyncResult *res)
return g_simple_async_result_get_op_res_gboolean (simple);
}
-/* taken from eel/eel-gtk-extensions.c */
-static gboolean
-tree_view_button_press_callback (GtkWidget *tree_view,
- GdkEventButton *event,
- gpointer data)
-{
- GtkTreePath *path;
- GtkTreeViewColumn *column;
-
- if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
- if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (tree_view),
- event->x, event->y,
- &path,
- &column,
- NULL,
- NULL)) {
- gtk_tree_view_row_activated
- (GTK_TREE_VIEW (tree_view), path, column);
- }
- }
-
- return FALSE;
-}
-
-void
-gd_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
- gboolean should_activate)
-{
- guint button_press_id;
-
- button_press_id = GPOINTER_TO_UINT
- (g_object_get_data (G_OBJECT (tree_view),
- "gd-tree-view-activate"));
-
- if (button_press_id && !should_activate) {
- g_signal_handler_disconnect (tree_view, button_press_id);
- g_object_set_data (G_OBJECT (tree_view),
- "gd-tree-view-activate",
- NULL);
- } else if (!button_press_id && should_activate) {
- button_press_id = g_signal_connect
- (tree_view,
- "button_press_event",
- G_CALLBACK (tree_view_button_press_callback),
- NULL);
- g_object_set_data (G_OBJECT (tree_view),
- "gd-tree-view-activate",
- GUINT_TO_POINTER (button_press_id));
- }
-}
-
const char *
gd_filename_get_extension_offset (const char *filename)
{
diff --git a/src/lib/gd-utils.h b/src/lib/gd-utils.h
index 583ffb0..daac363 100644
--- a/src/lib/gd-utils.h
+++ b/src/lib/gd-utils.h
@@ -32,9 +32,6 @@ void gd_queue_thumbnail_job_for_file_async (GFile *file,
gboolean gd_queue_thumbnail_job_for_file_finish (GAsyncResult *res);
-void gd_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
- gboolean should_activate);
-
const char *gd_filename_get_extension_offset (const char *filename);
char *gd_filename_strip_extension (const char * filename_with_extension);
diff --git a/src/manager.js b/src/manager.js
index 1a9d08c..57267a2 100644
--- a/src/manager.js
+++ b/src/manager.js
@@ -230,10 +230,10 @@ const BaseView = new Lang.Class({
this._model = new BaseModel(manager);
this._manager = manager;
- this.widget = new Gtk.TreeView({ headers_visible: false,
+ this.widget = new Gtk.TreeView({ activate_on_single_click: true,
+ headers_visible: false,
enable_search: false });
this._treeView = this.widget;
- GdPrivate.gtk_tree_view_set_activate_on_single_click(this._treeView, true);
this._treeView.set_model(this._model.model);
let selection = this._treeView.get_selection();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]