Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gnome-photos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
GNOME
gnome-photos
Commits
2a6d97ad
Commit
2a6d97ad
authored
Jan 07, 2016
by
Debarshi Ray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
application, preview-view: Hook up saturation to a GAction
parent
37020eef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
src/photos-application.c
src/photos-application.c
+6
-0
src/photos-preview-view.c
src/photos-preview-view.c
+24
-1
No files found.
src/photos-application.c
View file @
2a6d97ad
...
...
@@ -81,6 +81,7 @@ struct _PhotosApplicationPrivate
GSimpleAction
*
open_action
;
GSimpleAction
*
print_action
;
GSimpleAction
*
properties_action
;
GSimpleAction
*
saturation_action
;
GSimpleAction
*
save_action
;
GSimpleAction
*
search_action
;
GSimpleAction
*
search_match_action
;
...
...
@@ -277,6 +278,7 @@ photos_application_actions_update (PhotosApplication *self)
g_simple_action_set_enabled
(
priv
->
edit_cancel_action
,
enable
);
g_simple_action_set_enabled
(
priv
->
edit_done_action
,
enable
);
g_simple_action_set_enabled
(
priv
->
insta_action
,
enable
);
g_simple_action_set_enabled
(
priv
->
saturation_action
,
enable
);
g_simple_action_set_enabled
(
priv
->
sharpen_action
,
enable
);
g_simple_action_set_enabled
(
priv
->
undo_action
,
enable
);
...
...
@@ -1417,6 +1419,9 @@ photos_application_startup (GApplication *application)
g_action_map_add_action
(
G_ACTION_MAP
(
self
),
G_ACTION
(
action
));
g_object_unref
(
action
);
priv
->
saturation_action
=
g_simple_action_new
(
"saturation-current"
,
G_VARIANT_TYPE_DOUBLE
);
g_action_map_add_action
(
G_ACTION_MAP
(
self
),
G_ACTION
(
priv
->
saturation_action
));
priv
->
save_action
=
g_simple_action_new
(
"save-current"
,
NULL
);
g_signal_connect_swapped
(
priv
->
save_action
,
"activate"
,
G_CALLBACK
(
photos_application_save
),
self
);
g_action_map_add_action
(
G_ACTION_MAP
(
self
),
G_ACTION
(
priv
->
save_action
));
...
...
@@ -1560,6 +1565,7 @@ photos_application_dispose (GObject *object)
g_clear_object
(
&
priv
->
open_action
);
g_clear_object
(
&
priv
->
print_action
);
g_clear_object
(
&
priv
->
properties_action
);
g_clear_object
(
&
priv
->
saturation_action
);
g_clear_object
(
&
priv
->
save_action
);
g_clear_object
(
&
priv
->
search_action
);
g_clear_object
(
&
priv
->
search_match_action
);
...
...
src/photos-preview-view.c
View file @
2a6d97ad
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013, 2014, 2015 Red Hat, Inc.
* Copyright © 2013, 2014, 2015
, 2016
Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -400,6 +400,22 @@ photos_preview_view_insta (PhotosPreviewView *self, GVariant *parameter)
}
static
void
photos_preview_view_saturation
(
PhotosPreviewView
*
self
,
GVariant
*
parameter
)
{
PhotosBaseItem
*
item
;
gfloat
scale
;
item
=
PHOTOS_BASE_ITEM
(
photos_base_manager_get_active_object
(
self
->
priv
->
item_mngr
));
if
(
item
==
NULL
)
return
;
scale
=
(
gfloat
)
g_variant_get_double
(
parameter
);
photos_base_item_operation_add
(
item
,
"photos:saturation"
,
"scale"
,
scale
,
NULL
);
photos_base_item_process_async
(
item
,
NULL
,
photos_preview_view_process
,
self
);
}
static
void
photos_preview_view_sharpen
(
PhotosPreviewView
*
self
,
GVariant
*
parameter
)
{
...
...
@@ -641,6 +657,13 @@ photos_preview_view_init (PhotosPreviewView *self)
action
=
g_action_map_lookup_action
(
G_ACTION_MAP
(
app
),
"load-previous"
);
g_signal_connect_swapped
(
action
,
"activate"
,
G_CALLBACK
(
photos_preview_view_navigate_previous
),
self
);
action
=
g_action_map_lookup_action
(
G_ACTION_MAP
(
app
),
"saturation-current"
);
g_signal_connect_object
(
action
,
"activate"
,
G_CALLBACK
(
photos_preview_view_saturation
),
self
,
G_CONNECT_SWAPPED
);
action
=
g_action_map_lookup_action
(
G_ACTION_MAP
(
app
),
"sharpen-current"
);
g_signal_connect_object
(
action
,
"activate"
,
G_CALLBACK
(
photos_preview_view_sharpen
),
self
,
G_CONNECT_SWAPPED
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment