1
1

* gscreen.c (panel_tree_button_release): New function, opens a

new window on middle click.
(panel_create_tree_view): Bind panel_tree_button_release() to
"button_release_event".
Этот коммит содержится в:
Pavel Roskin 2001-07-16 00:05:50 +00:00
родитель 209488dc6e
Коммит 76c41d4726
2 изменённых файлов: 40 добавлений и 0 удалений

Просмотреть файл

@ -1,5 +1,10 @@
2001-07-15 Pavel Roskin <proski@gnu.org>
* gscreen.c (panel_tree_button_release): New function, opens a
new window on middle click.
(panel_create_tree_view): Bind panel_tree_button_release() to
"button_release_event".
* gmain.c (xtoolkit_create_dialog): Don't use "layout" - abort
instead.
* layout: Remove.

Просмотреть файл

@ -2137,6 +2137,38 @@ panel_tree_button_press (GtkWidget *widget, GdkEventButton *event, WPanel *panel
}
#endif
/*
* Middle click on the directory tree opens a new window.
*/
static void
panel_tree_button_release (GtkWidget *widget, GdkEventButton *event, WPanel *panel)
{
GtkDTree *dtree;
GtkCTreeNode *node;
int row;
char *path;
if (event->type != GDK_BUTTON_RELEASE)
return;
if (event->button != 2)
return;
dtree = GTK_DTREE (widget);
if (!gtk_clist_get_selection_info (GTK_CLIST (dtree), event->x, event->y, &row, NULL))
return;
node = gtk_ctree_node_nth (GTK_CTREE (dtree), row);
if (!node)
return;
path = gtk_dtree_get_row_path (dtree, node);
if (!path)
return;
new_panel_at (path);
}
/**
* panel_create_tree_view:
*
@ -2198,6 +2230,9 @@ panel_create_tree_view (WPanel *panel)
GTK_SIGNAL_FUNC (panel_tree_button_press), panel);
gtk_clist_set_button_actions (GTK_CLIST (tree), 2, GTK_BUTTON_SELECTS);
#endif
gtk_signal_connect_after (GTK_OBJECT (tree), "button_release_event",
GTK_SIGNAL_FUNC (panel_tree_button_release), panel);
return tree;
}