aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-06-23 07:38:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-06-23 07:38:05 +0000
commit3a9ec8d4c45ad4e7170445c56c27e50064faa79d (patch)
treec5e1cc41262f990c81fe9b0eea950a43f4de1e78
parent393a54d2449c83770db36c7dbb6d1254ebc522f2 (diff)
modified the way to revert selection after menu popup.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@366 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/folderview.c21
-rw-r--r--src/folderview.h1
4 files changed, 25 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 0271a520..3a547ab6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-06-23
+ * src/folderview.[ch]: modified the way to revert selection after
+ menu popup.
+
+2005-06-23
+
* src/editldap.c: made bind password entry invisible.
2005-06-22
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 5e28b2a7..6ebd9112 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
2005-06-23
+ * src/folderview.[ch]: メニューのポップアップの後選択状態を元に戻す
+ 方法を変更。
+
+2005-06-23
+
* src/editldap.c: バインドパスワードのエントリを非表示にした。
2005-06-22
diff --git a/src/folderview.c b/src/folderview.c
index 8958d84d..1dceefe0 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -318,7 +318,7 @@ FolderView *folderview_create(void)
gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview),
COL_FOLDER_NAME);
gtk_tree_view_set_reorderable(GTK_TREE_VIEW(treeview), FALSE);
- //g_object_set(treeview, "fixed-height-mode", TRUE, NULL);
+ /* g_object_set(treeview, "fixed-height-mode", TRUE, NULL); */
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
@@ -1543,12 +1543,18 @@ static gboolean folderview_button_pressed(GtkWidget *widget,
if (event->button == 1 || event->button == 2) {
folderview->open_folder = TRUE;
} else if (event->button == 3) {
- gtk_tree_view_set_cursor(treeview, path, NULL, FALSE);
+ if (folderview->selected) {
+ folderview->prev_selected =
+ gtk_tree_row_reference_copy
+ (folderview->selected);
+ }
+ gtk_tree_selection_select_path(folderview->selection, path);
folderview_menu_popup(folderview, event);
+ gtk_tree_path_free(path);
+ return TRUE;
}
gtk_tree_path_free(path);
-
return FALSE;
}
@@ -1745,13 +1751,14 @@ static void folderview_popup_close(GtkMenuShell *menu_shell,
{
GtkTreePath *path;
- if (!folderview->opened) return;
+ if (!folderview->prev_selected) return;
- path = gtk_tree_row_reference_get_path(folderview->opened);
+ path = gtk_tree_row_reference_get_path(folderview->prev_selected);
+ gtk_tree_row_reference_free(folderview->prev_selected);
+ folderview->prev_selected = NULL;
if (!path)
return;
- gtk_tree_view_set_cursor(GTK_TREE_VIEW(folderview->treeview), path,
- NULL, FALSE);
+ gtk_tree_selection_select_path(folderview->selection, path);
gtk_tree_path_free(path);
}
diff --git a/src/folderview.h b/src/folderview.h
index 91532198..f921b489 100644
--- a/src/folderview.h
+++ b/src/folderview.h
@@ -51,6 +51,7 @@ struct _FolderView
GtkTreeRowReference *selected;
GtkTreeRowReference *opened;
+ GtkTreeRowReference *prev_selected;
gboolean open_folder;