summaryrefslogtreecommitdiff
path: root/src/eom-scroll-view.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-07-27 15:57:15 +0200
committerinfirit <[email protected]>2014-07-27 21:16:30 +0200
commit7a1720ee8a365ae6418de438d4c42068bf9a97d5 (patch)
tree3bb15008cb9c6e3774734738225f4ddaf63de8e2 /src/eom-scroll-view.c
parentf9308d5f86250219e6bf35208e517780d2de2772 (diff)
downloadeom-7a1720ee8a365ae6418de438d4c42068bf9a97d5.tar.bz2
eom-7a1720ee8a365ae6418de438d4c42068bf9a97d5.tar.xz
Switch scrollwheel zoom setting with GSettings
Based on eog commit 8c7cf9f8938673eda2843be650b558084b44303e From Felix Riemann <[email protected]>
Diffstat (limited to 'src/eom-scroll-view.c')
-rw-r--r--src/eom-scroll-view.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index 664d819..52bce7e 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -79,8 +79,9 @@ static GtkTargetEntry target_table[] = {
enum {
PROP_0,
- PROP_USE_BG_COLOR,
PROP_BACKGROUND_COLOR,
+ PROP_SCROLLWHEEL_ZOOM,
+ PROP_USE_BG_COLOR,
PROP_ZOOM_MULTIPLIER
};
@@ -2552,6 +2553,9 @@ eom_scroll_view_get_property (GObject *object, guint property_id,
//FIXME: This doesn't really handle the NULL color.
g_value_set_boxed (value, priv->background_color);
break;
+ case PROP_SCROLLWHEEL_ZOOM:
+ g_value_set_boolean (value, priv->scroll_wheel_zoom);
+ break;
case PROP_ZOOM_MULTIPLIER:
g_value_set_double (value, priv->zoom_multiplier);
break;
@@ -2582,6 +2586,9 @@ eom_scroll_view_set_property (GObject *object, guint property_id,
eom_scroll_view_set_background_color (view, color);
break;
}
+ case PROP_SCROLLWHEEL_ZOOM:
+ eom_scroll_view_set_scroll_wheel_zoom (view, g_value_get_boolean (value));
+ break;
case PROP_ZOOM_MULTIPLIER:
eom_scroll_view_set_zoom_multiplier (view, g_value_get_double (value));
break;
@@ -2628,6 +2635,11 @@ eom_scroll_view_class_init (EomScrollViewClass *klass)
-G_MAXDOUBLE, G_MAXDOUBLE, 0.05,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+ g_object_class_install_property (
+ gobject_class, PROP_SCROLLWHEEL_ZOOM,
+ g_param_spec_boolean ("scrollwheel-zoom", NULL, NULL, TRUE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
view_signals [SIGNAL_ZOOM_CHANGED] =
g_signal_new ("zoom_changed",
EOM_TYPE_SCROLL_VIEW,
@@ -2857,7 +2869,10 @@ eom_scroll_view_set_scroll_wheel_zoom (EomScrollView *view,
{
g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
- view->priv->scroll_wheel_zoom = scroll_wheel_zoom;
+ if (view->priv->scroll_wheel_zoom != scroll_wheel_zoom) {
+ view->priv->scroll_wheel_zoom = scroll_wheel_zoom;
+ g_object_notify (G_OBJECT (view), "scrollwheel-zoom");
+ }
}
void