summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-annotation-window.c27
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;
}