[gnome-photos/wip/rishi/zoom: 2/4] application: Add zoom-in/out actions
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/zoom: 2/4] application: Add zoom-in/out actions
- Date: Wed, 29 Mar 2017 09:06:07 +0000 (UTC)
commit 4c04c879cd2c525e368bcff8d3c055453e7e2017
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Mar 29 11:03:39 2017 +0200
application: Add zoom-in/out actions
src/photos-application.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 31da5d7..3ab889c 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -110,6 +110,8 @@ struct _PhotosApplication
GSimpleAction *set_ss_action;
GSimpleAction *share_action;
GSimpleAction *sharpen_action;
+ GSimpleAction *zoom_in_action;
+ GSimpleAction *zoom_out_action;
GtkWidget *main_window;
PhotosBaseManager *shr_pnt_mngr;
PhotosCameraCache *camera_cache;
@@ -367,6 +369,8 @@ photos_application_actions_update (PhotosApplication *self)
g_simple_action_set_enabled (self->gear_action, enable);
g_simple_action_set_enabled (self->set_bg_action, enable);
g_simple_action_set_enabled (self->set_ss_action, enable);
+ g_simple_action_set_enabled (self->zoom_in_action, enable);
+ g_simple_action_set_enabled (self->zoom_out_action, enable);
enable = ((load_state == PHOTOS_LOAD_STATE_FINISHED && mode == PHOTOS_WINDOW_MODE_PREVIEW)
|| (selection_mode && item != NULL));
@@ -1870,6 +1874,14 @@ photos_application_startup (GApplication *application)
self->sharpen_action = g_simple_action_new ("sharpen-current", G_VARIANT_TYPE_DOUBLE);
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->sharpen_action));
+ self->zoom_in_action = g_simple_action_new ("zoom-in", NULL);
+ //g_signal_connect_swapped (self->zoom_in_action, "activate", G_CALLBACK (photos_application_zoom_in),
self);
+ g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->zoom_in_action));
+
+ self->zoom_out_action = g_simple_action_new ("zoom-out", NULL);
+ //g_signal_connect_swapped (self->zoom_out_action, "activate", G_CALLBACK (photos_application_zoom_out),
self);
+ g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->zoom_out_action));
+
g_signal_connect_swapped (self->state->mode_cntrlr,
"window-mode-changed",
G_CALLBACK (photos_application_window_mode_changed),
@@ -1963,6 +1975,8 @@ photos_application_dispose (GObject *object)
g_clear_object (&self->set_ss_action);
g_clear_object (&self->share_action);
g_clear_object (&self->sharpen_action);
+ g_clear_object (&self->zoom_in_action);
+ g_clear_object (&self->zoom_out_action);
g_clear_object (&self->shr_pnt_mngr);
g_clear_object (&self->camera_cache);
g_clear_object (&self->sel_cntrlr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]