diff options
| author | Mattias Andrée <m@maandree.se> | 2026-10-13 23:00:56 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-10-13 23:00:56 +0200 |
| commit | 0476071164c36b41de5b19e3e8a768feb422f27f (patch) | |
| tree | 09d16e177042b14020a48030176d99e9024bea66 /events.c | |
| parent | Third commit (diff) | |
| download | gbild-0476071164c36b41de5b19e3e8a768feb422f27f.tar.gz gbild-0476071164c36b41de5b19e3e8a768feb422f27f.tar.bz2 gbild-0476071164c36b41de5b19e3e8a768feb422f27f.tar.xz | |
Fourth commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | events.c | 37 |
1 files changed, 31 insertions, 6 deletions
@@ -26,16 +26,14 @@ transform(enum transformation augment) static void set_zoom_fit(GtkToggleAction *action, enum zoom_mode mode) { - GdkPixbuf *image; - + struct image image; if (gtk_toggle_action_get_active(action)) { zoom_mode = mode; - if ((image = get_image())) - set_zoom_and_recentre(calculate_zoom_mode(image, zoom_mode)); + if (get_image(&image)) + set_zoom_and_recentre(calculate_zoom_mode(&image, zoom_mode)); } else if (zoom_mode == mode) { zoom_mode = ZOOM_CUSTOM; /* deselect zoom */ } - clear_toggles(GROUP_ZOOM, action); } @@ -70,9 +68,11 @@ reload_action(GtkAction *action, void *user) void print_action(GtkAction *action, void *user) { + struct image image; (void) action; (void) user; - open_print(get_image()); + if (get_image(&image)) + open_print(&image); } void @@ -84,6 +84,28 @@ properties_action(GtkAction *action, void *user) } void +preferences_action(GtkAction *action, void *user) +{ + (void) action; + (void) user; + open_preferences(); +} + +void +property_pane_action(GtkToggleAction *action, void *user) +{ + (void) user; + set_property_pane_visible(gtk_toggle_action_get_active(action)); +} + +void +collection_pane_action(GtkToggleAction *action, void *user) +{ + (void) user; + set_collection_pane_visible(gtk_toggle_action_get_active(action)); +} + +void close_action(GtkAction *action, void *user) { (void) action; @@ -278,6 +300,9 @@ key_pressed(GtkWidget *widget, GdkEventKey *event, void *user) if (event->state & GDK_CONTROL_MASK) return 0; + if (gtk_window_get_focus(GTK_WINDOW(window)) != display_area) + return 0; + amount = (event->state & GDK_MOD1_MASK) ? 1 : SCROLL_AMOUNT; hamount = (double)amount; vamount = (double)amount; |
