[evince] Change the opacity of the annotation window



commit b968cfb2cd25854f5f2e3a32079bda9a826bb084
Author: Giselle Machado <giselle mnr gmail com>
Date:   Fri Jun 20 15:15:00 2014 +0200

    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

 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 f31dec6..64d5504 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -161,6 +161,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)
@@ -183,6 +191,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);
@@ -394,6 +413,7 @@ ev_annotation_window_constructor (GType                  type,
        GdkColor            color;
        EvRectangle        *rect;
        gdouble             scale;
+       gdouble             opacity;
 
        object = G_OBJECT_CLASS (ev_annotation_window_parent_class)->constructor (type,
                                                                                  n_construct_properties,
@@ -419,6 +439,10 @@ ev_annotation_window_constructor (GType                  type,
 
        ev_annotation_get_color (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);
@@ -437,6 +461,9 @@ ev_annotation_window_constructor (GType                  type,
        g_signal_connect (annot, "notify::color",
                          G_CALLBACK (ev_annotation_window_color_changed),
                          window);
+       g_signal_connect (annot, "notify::opacity",
+                         G_CALLBACK (ev_annotation_window_opacity_changed),
+                         window);
 
        return object;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]