[gnac] Clicking on an empty line in the treeview has the same effect as clicking on 'add'.
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnac] Clicking on an empty line in the treeview has the same effect as clicking on 'add'.
- Date: Sat, 22 Aug 2009 18:21:14 +0000 (UTC)
commit d4b0e3018e51d7755df7039a3bb63bb3dbe9f8e6
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Sat Aug 22 20:20:59 2009 +0200
Clicking on an empty line in the treeview has the same effect as clicking on 'add'.
src/gnac-file-list.c | 38 ++++++++++++++++++++------------------
1 files changed, 20 insertions(+), 18 deletions(-)
---
diff --git a/src/gnac-file-list.c b/src/gnac-file-list.c
index d05ebed..b1c3e97 100644
--- a/src/gnac-file-list.c
+++ b/src/gnac-file-list.c
@@ -692,31 +692,33 @@ gnac_file_list_on_button_pressed(GtkWidget *treeview,
GdkEventButton *event,
gpointer user_data)
{
- GtkTreeRowReference *reference;
-
- if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
-
- if (gnac_file_list_count_selected_rows() <= 1) {
- GtkTreePath *path;
-
- if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview),
- (gint) event->x, (gint) event->y,
- &path, NULL, NULL, NULL))
- {
+ gboolean ret = FALSE;
+ if (event->type == GDK_BUTTON_PRESS) {
+ gboolean expanded;
+ GtkTreePath *path;
+
+ expanded = gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview),
+ (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL);
+
+ if (event->button == 1 && !expanded) {
+ gnac_on_ui_add_cb(treeview, NULL);
+ ret = TRUE;
+ } else if (event->button == 3) {
+ if (expanded && gnac_file_list_count_selected_rows() <= 1) {
+ GtkTreeRowReference *reference;
reference = gtk_tree_row_reference_new(model, path);
-
gnac_file_list_select_row(reference);
-
gtk_tree_row_reference_free(reference);
- gtk_tree_path_free(path);
}
+
+ gnac_ui_show_popup_menu(treeview, event, user_data);
+ ret = TRUE;
}
-
- gnac_ui_show_popup_menu(treeview, event, user_data);
- return TRUE;
+
+ gtk_tree_path_free(path);
}
- return FALSE;
+ return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]