Commit 06c8f092 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

shortcuts: make search and slideshow shortcuts customizable

parent 3450a75e
...@@ -40,6 +40,11 @@ static const GActionEntry actions[] = { ...@@ -40,6 +40,11 @@ static const GActionEntry actions[] = {
}; };
static const GthShortcut shortcuts[] = {
{ "find", N_("Find files"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "<Primary>f" },
};
typedef struct { typedef struct {
GtkWidget *refresh_button; GtkWidget *refresh_button;
} BrowserData; } BrowserData;
...@@ -63,12 +68,17 @@ search__gth_browser_construct_cb (GthBrowser *browser) ...@@ -63,12 +68,17 @@ search__gth_browser_construct_cb (GthBrowser *browser)
actions, actions,
G_N_ELEMENTS (actions), G_N_ELEMENTS (actions),
browser); browser);
gth_window_add_shortcuts (GTH_WINDOW (browser),
shortcuts,
G_N_ELEMENTS (shortcuts));
gth_browser_add_header_bar_button (browser, gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS, GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS,
"edit-find-symbolic", "edit-find-symbolic",
_("Find files"), _("Find files"),
"win.find", "win.find",
"<Control>F"); NULL);
data = g_new0 (BrowserData, 1); data = g_new0 (BrowserData, 1);
g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free); g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
......
...@@ -35,6 +35,11 @@ static const GActionEntry actions[] = { ...@@ -35,6 +35,11 @@ static const GActionEntry actions[] = {
}; };
static const GthShortcut shortcuts[] = {
{ "slideshow", N_("Presentation"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "F5" },
};
void void
ss__gth_browser_construct_cb (GthBrowser *browser) ss__gth_browser_construct_cb (GthBrowser *browser)
{ {
...@@ -45,12 +50,16 @@ ss__gth_browser_construct_cb (GthBrowser *browser) ...@@ -45,12 +50,16 @@ ss__gth_browser_construct_cb (GthBrowser *browser)
G_N_ELEMENTS (actions), G_N_ELEMENTS (actions),
browser); browser);
gth_window_add_shortcuts (GTH_WINDOW (browser),
shortcuts,
G_N_ELEMENTS (shortcuts));
gth_browser_add_header_bar_button (browser, gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW, GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW,
"view-presentation-symbolic", "view-presentation-symbolic",
_("Presentation"), _("Presentation"),
"win.slideshow", "win.slideshow",
"F5"); 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