...
  View open merge request
Commits (4)
...@@ -5,7 +5,7 @@ project('file-roller', 'c', ...@@ -5,7 +5,7 @@ project('file-roller', 'c',
) )
glib_version = '>=2.36' glib_version = '>=2.36'
gtk_version = '>=3.13.2' gtk_version = '>=3.22.0'
nautilus_version = '>=2.22.2' nautilus_version = '>=2.22.2'
json_glib_version = '>=0.14.0' json_glib_version = '>=0.14.0'
libnotify_version = '>=0.4.3' libnotify_version = '>=0.4.3'
......
...@@ -4811,48 +4811,68 @@ key_press_cb (GtkWidget *widget, ...@@ -4811,48 +4811,68 @@ key_press_cb (GtkWidget *widget,
gpointer data) gpointer data)
{ {
FrWindow *window = data; FrWindow *window = data;
gboolean retval = FALSE; gboolean retval = GDK_EVENT_PROPAGATE;
gboolean alt; gboolean alt;
guint modifiers;
if (gtk_widget_has_focus (window->priv->location_entry)) if (gtk_widget_has_focus (window->priv->location_entry))
return FALSE; return GDK_EVENT_PROPAGATE;
if (gtk_widget_has_focus (window->priv->filter_entry)) { if (gtk_widget_has_focus (window->priv->filter_entry))
switch (event->keyval) { return GDK_EVENT_PROPAGATE;
case GDK_KEY_Escape:
fr_window_deactivate_filter (window); modifiers = gtk_accelerator_get_default_mod_mask ();
retval = TRUE;
break;
default:
break;
}
return retval;
}
alt = (event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK; alt = (event->state & modifiers) == GDK_MOD1_MASK;
switch (event->keyval) { switch (event->keyval) {
case GDK_KEY_Escape: case GDK_KEY_Escape:
fr_window_stop (window); fr_window_stop (window);
if (window->priv->filter_mode) if (window->priv->filter_mode)
fr_window_deactivate_filter (window); fr_window_deactivate_filter (window);
retval = TRUE; retval = GDK_EVENT_STOP;
break; break;
case GDK_KEY_F10: case GDK_KEY_F10:
if (event->state & GDK_SHIFT_MASK) { case GDK_KEY_Menu:
if ((event->keyval == GDK_KEY_Menu) ||
((event->keyval == GDK_KEY_F10) &&
(event->state & modifiers) == GDK_SHIFT_MASK)) {
GtkTreeSelection *selection; GtkTreeSelection *selection;
GList *selected_rows;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (window->priv->list_view)); GtkTreePath *first_selected_row_path;
GtkTreeView *tree_view;
GdkRectangle rect;
GdkWindow *win;
tree_view = GTK_TREE_VIEW (window->priv->list_view);
win = gtk_tree_view_get_bin_window (tree_view);
selection = gtk_tree_view_get_selection (tree_view);
selected_rows = gtk_tree_selection_get_selected_rows (selection,
&window->priv->list_store);
if (selection == NULL) if (selection == NULL)
return FALSE; return GDK_EVENT_PROPAGATE;
gtk_menu_popup (GTK_MENU (window->priv->file_popup_menu), if (selected_rows == NULL)
NULL, NULL, NULL, return GDK_EVENT_PROPAGATE;
window,
3, first_selected_row_path = (GtkTreePath *) selected_rows->data;
GDK_CURRENT_TIME);
retval = TRUE; gtk_tree_view_get_cell_area (tree_view,
first_selected_row_path,
NULL,
&rect);
g_list_free_full (selected_rows, (GDestroyNotify) gtk_tree_path_free);
gtk_menu_popup_at_rect (GTK_MENU (window->priv->file_popup_menu),
win,
&rect,
GDK_GRAVITY_SOUTH_WEST,
GDK_GRAVITY_NORTH_WEST,
(const GdkEvent *) event);
retval = GDK_EVENT_STOP;
} }
break; break;
...@@ -4860,20 +4880,20 @@ key_press_cb (GtkWidget *widget, ...@@ -4860,20 +4880,20 @@ key_press_cb (GtkWidget *widget,
case GDK_KEY_KP_Up: case GDK_KEY_KP_Up:
if (alt) { if (alt) {
fr_window_go_up_one_level (window); fr_window_go_up_one_level (window);
retval = TRUE; retval = GDK_EVENT_STOP;
} }
break; break;
case GDK_KEY_BackSpace: case GDK_KEY_BackSpace:
fr_window_go_up_one_level (window); fr_window_go_up_one_level (window);
retval = TRUE; retval = GDK_EVENT_STOP;
break; break;
case GDK_KEY_Right: case GDK_KEY_Right:
case GDK_KEY_KP_Right: case GDK_KEY_KP_Right:
if (alt) { if (alt) {
fr_window_go_forward (window); fr_window_go_forward (window);
retval = TRUE; retval = GDK_EVENT_STOP;
} }
break; break;
...@@ -4881,7 +4901,7 @@ key_press_cb (GtkWidget *widget, ...@@ -4881,7 +4901,7 @@ key_press_cb (GtkWidget *widget,
case GDK_KEY_KP_Left: case GDK_KEY_KP_Left:
if (alt) { if (alt) {
fr_window_go_back (window); fr_window_go_back (window);
retval = TRUE; retval = GDK_EVENT_STOP;
} }
break; break;
...@@ -4889,14 +4909,14 @@ key_press_cb (GtkWidget *widget, ...@@ -4889,14 +4909,14 @@ key_press_cb (GtkWidget *widget,
case GDK_KEY_KP_Home: case GDK_KEY_KP_Home:
if (alt) { if (alt) {
fr_window_go_to_location (window, "/", FALSE); fr_window_go_to_location (window, "/", FALSE);
retval = TRUE; retval = GDK_EVENT_STOP;
} }
break; break;
case GDK_KEY_Delete: case GDK_KEY_Delete:
if (! gtk_widget_has_focus (window->priv->filter_entry)) { if (! gtk_widget_has_focus (window->priv->filter_entry)) {
fr_window_activate_delete (NULL, NULL, window); fr_window_activate_delete (NULL, NULL, window);
retval = TRUE; retval = GDK_EVENT_STOP;
} }
break; break;
...@@ -5435,6 +5455,12 @@ filter_entry_search_changed_cb (GtkEntry *entry, ...@@ -5435,6 +5455,12 @@ filter_entry_search_changed_cb (GtkEntry *entry,
fr_window_activate_filter (window); fr_window_activate_filter (window);
} }
static void
filter_entry_stop_search_cb (GtkSearchEntry *entry,
FrWindow *window)
{
fr_window_deactivate_filter (window);
}
static void static void
fr_window_attach (FrWindow *window, fr_window_attach (FrWindow *window,
...@@ -5720,6 +5746,10 @@ fr_window_construct (FrWindow *window) ...@@ -5720,6 +5746,10 @@ fr_window_construct (FrWindow *window)
"search-changed", "search-changed",
G_CALLBACK (filter_entry_search_changed_cb), G_CALLBACK (filter_entry_search_changed_cb),
window); window);
g_signal_connect (G_OBJECT (window->priv->filter_entry),
"stop-search",
G_CALLBACK (filter_entry_stop_search_cb),
window);
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (window->priv->filter_bar), GTK_ENTRY (window->priv->filter_entry)); gtk_search_bar_connect_entry (GTK_SEARCH_BAR (window->priv->filter_bar), GTK_ENTRY (window->priv->filter_entry));
gtk_container_add (GTK_CONTAINER (window->priv->filter_bar), filter_box); gtk_container_add (GTK_CONTAINER (window->priv->filter_bar), filter_box);
gtk_box_pack_start (GTK_BOX (filter_box), window->priv->filter_entry, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (filter_box), window->priv->filter_entry, TRUE, TRUE, 0);
......