aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-01-23 06:44:34 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-01-23 06:44:50 +0100
commit38670428dacaf44525db3710c8acea1bb543eab6 (patch)
treec8a61ce2f30a76ca3a7359109777213034f3e1db
parenta7e638207f402bc69466c8820743128c78211241 (diff)
downloadfiv-38670428dacaf44525db3710c8acea1bb543eab6.tar.gz
fiv-38670428dacaf44525db3710c8acea1bb543eab6.tar.xz
fiv-38670428dacaf44525db3710c8acea1bb543eab6.zip
Add keyboard shortcuts for thumbnail size
-rw-r--r--fiv-browser.c14
-rw-r--r--fiv.c2
2 files changed, 15 insertions, 1 deletions
diff --git a/fiv-browser.c b/fiv-browser.c
index 354d3b2..4b438ab 100644
--- a/fiv-browser.c
+++ b/fiv-browser.c
@@ -1321,7 +1321,8 @@ static gboolean
fiv_browser_key_press_event(GtkWidget *widget, GdkEventKey *event)
{
FivBrowser *self = FIV_BROWSER(widget);
- if (!(event->state & gtk_accelerator_get_default_mod_mask())) {
+ switch ((event->state & gtk_accelerator_get_default_mod_mask())) {
+ case 0:
switch (event->keyval) {
case GDK_KEY_Return:
if (self->selected)
@@ -1346,6 +1347,17 @@ fiv_browser_key_press_event(GtkWidget *widget, GdkEventKey *event)
move_selection_end(self);
return TRUE;
}
+ break;
+ case GDK_CONTROL_MASK:
+ case GDK_CONTROL_MASK | GDK_SHIFT_MASK:
+ switch (event->keyval) {
+ case GDK_KEY_plus:
+ set_item_size(self, self->item_size + 1);
+ return TRUE;
+ case GDK_KEY_minus:
+ set_item_size(self, self->item_size - 1);
+ return TRUE;
+ }
}
return GTK_WIDGET_CLASS(fiv_browser_parent_class)
diff --git a/fiv.c b/fiv.c
index 018e292..7102db0 100644
--- a/fiv.c
+++ b/fiv.c
@@ -86,6 +86,8 @@ static struct key_group help_keys_browser[] = {
{"F9", "Toggle navigation sidebar"},
{"F5 r <control>r", "Refresh"},
{"h <control>h", "Toggle hiding unsupported files"},
+ {"<control>plus", "Larger thumbnails"},
+ {"<control>minus", "Smaller thumbnails"},
{}
}},
{"Navigation", (struct key[]) {