diff options
author | Giselle Machado <[email protected]> | 2014-06-20 15:15:00 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-28 16:04:00 +0200 |
commit | 0ff0828b0dfa9c70597382421f1ca3a3dd5ff260 (patch) | |
tree | be4d6bba75180844789af7ab293da447255903d9 /libview | |
parent | f071e6bc375f8107e92e88fe5b55268f5a127693 (diff) | |
download | atril-0ff0828b0dfa9c70597382421f1ca3a3dd5ff260.tar.bz2 atril-0ff0828b0dfa9c70597382421f1ca3a3dd5ff260.tar.xz |
Change the opacity of the annotation window
Implements the functions needed to change the
opacity of the annotation windows.
https://bugzilla.gnome.org/show_bug.cgi?id=725571
origin commit:
https://git.gnome.org/browse/evince/commit/?id=b968cfb
Diffstat (limited to 'libview')
-rw-r--r-- | libview/ev-annotation-window.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c index eadb6d65..e3c3783a 100644 --- a/libview/ev-annotation-window.c +++ b/libview/ev-annotation-window.c @@ -154,6 +154,14 @@ ev_annotation_window_set_color (EvAnnotationWindow *window, } static void +ev_annotation_window_set_opacity (EvAnnotationWindow *window, + gdouble opacity) +{ + gtk_widget_set_opacity (GTK_WIDGET (window), opacity); + gtk_widget_set_opacity (GTK_WIDGET (window->text_view), opacity); +} + +static void ev_annotation_window_label_changed (EvAnnotationMarkup *annot, GParamSpec *pspec, EvAnnotationWindow *window) @@ -176,6 +184,17 @@ ev_annotation_window_color_changed (EvAnnotation *annot, } static void +ev_annotation_window_opacity_changed (EvAnnotation *annot, + GParamSpec *pspec, + EvAnnotationWindow *window) +{ + gdouble opacity; + + opacity = ev_annotation_markup_get_opacity (EV_ANNOTATION_MARKUP (annot)); + ev_annotation_window_set_opacity (window, opacity); +} + +static void ev_annotation_window_dispose (GObject *object) { EvAnnotationWindow *window = EV_ANNOTATION_WINDOW (object); @@ -397,6 +416,7 @@ ev_annotation_window_constructor (GType type, GdkRGBA color; EvRectangle *rect; gdouble scale; + gdouble opacity; object = G_OBJECT_CLASS (ev_annotation_window_parent_class)->constructor (type, n_construct_properties, @@ -422,6 +442,10 @@ ev_annotation_window_constructor (GType type, ev_annotation_get_rgba (annot, &color); ev_annotation_window_set_color (window, &color); + + opacity = ev_annotation_markup_get_opacity (markup); + ev_annotation_window_set_opacity (window, opacity); + gtk_widget_set_name (GTK_WIDGET (window), ev_annotation_get_name (annot)); gtk_window_set_title (GTK_WINDOW (window), label); gtk_label_set_text (GTK_LABEL (window->title), label); @@ -440,6 +464,9 @@ ev_annotation_window_constructor (GType type, g_signal_connect (annot, "notify::rgba", G_CALLBACK (ev_annotation_window_color_changed), window); + g_signal_connect (annot, "notify::opacity", + G_CALLBACK (ev_annotation_window_opacity_changed), + window); return object; } |