Commit f4a23f68 authored by Paolo Bacchilega's avatar Paolo Bacchilega

image rotation: converted accelerators to customizable shortcuts

parent 04d5370c
......@@ -42,6 +42,12 @@ static const GActionEntry actions[] = {
};
static const GthShortcut shortcuts[] = {
{ "rotate-right", N_("Rotate Right"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketright" },
{ "rotate-left", N_("Rotate Left"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_EDIT, "bracketleft" },
};
static const GthMenuEntry tools1_action_entries[] = {
{ N_("Rotate Left"), "win.rotate-left", "bracketleft", "object-rotate-left-symbolic" },
{ N_("Rotate Right"), "win.rotate-right", "bracketright", "object-rotate-right-symbolic" },
......@@ -84,6 +90,11 @@ ir__gth_browser_construct_cb (GthBrowser *browser)
actions,
G_N_ELEMENTS (actions),
browser);
gth_window_add_shortcuts (GTH_WINDOW (browser),
shortcuts,
G_N_ELEMENTS (shortcuts));
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_TOOLS),
tools1_action_entries,
G_N_ELEMENTS (tools1_action_entries));
......@@ -108,31 +119,6 @@ ir__gth_browser_update_sensitivity_cb (GthBrowser *browser)
}
gpointer
ir__gth_browser_file_list_key_press_cb (GthBrowser *browser,
GdkEventKey *event)
{
gpointer result = NULL;
switch (event->keyval) {
case GDK_KEY_bracketright:
gth_browser_activate_rotate_right (NULL, NULL, browser);
result = GINT_TO_POINTER (1);
break;
case GDK_KEY_bracketleft:
gth_browser_activate_rotate_left (NULL, NULL, browser);
result = GINT_TO_POINTER (1);
break;
default:
break;
}
return result;
}
static void
viewer_image_changed_cb (GtkWidget *widget,
GthBrowser *browser)
......
......@@ -26,8 +26,6 @@
void ir__gth_browser_construct_cb (GthBrowser *browser);
void ir__gth_browser_update_sensitivity_cb (GthBrowser *browser);
gpointer ir__gth_browser_file_list_key_press_cb (GthBrowser *browser,
GdkEventKey *event);
void ir__gth_browser_activate_viewer_page_cb (GthBrowser *browser);
void ir__gth_browser_deactivate_viewer_page_cb (GthBrowser *browser);
......
......@@ -39,7 +39,6 @@ gthumb_extension_activate (void)
gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (ir__gth_browser_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (ir__gth_browser_update_sensitivity_cb), NULL);
gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (ir__gth_browser_file_list_key_press_cb), NULL);
gth_hook_add_callback ("gth-browser-activate-viewer-page", 10, G_CALLBACK (ir__gth_browser_activate_viewer_page_cb), NULL);
gth_hook_add_callback ("gth-browser-deactivate-viewer-page", 10, G_CALLBACK (ir__gth_browser_deactivate_viewer_page_cb), NULL);
}
......
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