Commit 10312f63 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

added other keybindings

allow to exit from fullscreen using the 'f' key
allow to rotate images with '[' and ']'
parent f954eeb9
......@@ -24,6 +24,7 @@
#include <config.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gdk/gdkkeysyms.h>
#include <gthumb.h>
#include "actions.h"
......@@ -66,6 +67,35 @@ browser_data_free (BrowserData *data)
}
static gboolean
gth_file_list_key_press_cb (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
GthBrowser *browser = user_data;
gboolean result = FALSE;
if (! (event->state & GDK_CONTROL_MASK) && ! (event->state & GDK_MOD1_MASK)) {
switch (gdk_keyval_to_lower (event->keyval)) {
case GDK_bracketright:
gth_browser_activate_action_tool_rotate_right (NULL, browser);
result = TRUE;
break;
case GDK_bracketleft:
gth_browser_activate_action_tool_rotate_left (NULL, browser);
result = TRUE;
break;
default:
break;
}
}
return result;
}
void
ir__gth_browser_construct_cb (GthBrowser *browser)
{
......@@ -88,6 +118,11 @@ ir__gth_browser_construct_cb (GthBrowser *browser)
g_clear_error (&error);
}
g_signal_connect (gth_browser_get_file_list (browser),
"key_press_event",
G_CALLBACK (gth_file_list_key_press_cb),
browser);
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
}
......
......@@ -262,6 +262,10 @@ viewer_key_press_cb (GtkWidget *widget,
case GDK_End:
gth_browser_show_last_image (self->priv->browser, TRUE, FALSE);
return TRUE;
case GDK_f:
gth_browser_fullscreen (self->priv->browser);
break;
}
return gth_hook_invoke_get ("gth-browser-file-list-key-press", self->priv->browser, event) != NULL;
......
......@@ -2763,31 +2763,6 @@ gth_file_list_key_press_cb (GtkWidget *widget,
result = TRUE;
break;
/* FIXME: add these to the image viewer
case GDK_b:
case GDK_BackSpace:
gth_browser_show_prev_image (browser, FALSE, FALSE);
result = TRUE;
break;
case GDK_n:
gth_browser_show_next_image (browser, FALSE, FALSE);
result = TRUE;
break;
*/
/* FIXME: add these to the rotate extension
case GDK_bracketright:
gth_window_activate_action_tools_jpeg_rotate_right (NULL, window);
result = TRUE;
break;
case GDK_bracketleft:
gth_window_activate_action_tools_jpeg_rotate_left (NULL, window);
result = TRUE;
break;
*/
default:
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment