[gnome-shell] magnifier: crosshairs opacity is now a double



commit 4c2d9ca16e397d4654a12277392b49d201180c6b
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Feb 12 15:24:18 2011 +0000

    magnifier: crosshairs opacity is now a double
    
    The type of the opacity has been changed in
    gsettings-desktop-schemas, and a range was added for it.
    
    See also bug 642032
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642175

 js/ui/magnifier.js |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 3e60c24..935d849 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -268,7 +268,7 @@ Magnifier.prototype = {
 
         let thickness = this._settings.get_int(CROSS_HAIRS_THICKNESS_KEY);
         let color = this._settings.get_string(CROSS_HAIRS_COLOR_KEY);
-        let opacity = this._settings.get_int(CROSS_HAIRS_OPACITY_KEY);
+        let opacity = this._settings.get_double(CROSS_HAIRS_OPACITY_KEY);
         let length = this._settings.get_int(CROSS_HAIRS_LENGTH_KEY);
         let clip = this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY);
 
@@ -354,22 +354,22 @@ Magnifier.prototype = {
 
     /**
      * setCrosshairsOpacity:
-     * @opacity:    Value between 0 (transparent) and 255 (fully opaque).
+     * @opacity:    Value between 0.0 (transparent) and 1.0 (fully opaque).
      */
     setCrosshairsOpacity: function(opacity) {
         if (this._crossHairs)
-            this._crossHairs.setOpacity(opacity);
+            this._crossHairs.setOpacity(opacity * 255);
     },
 
     /**
      * getCrosshairsOpacity:
-     * @return:     Value between 0 (transparent) and 255 (fully opaque).
+     * @return:     Value between 0.0 (transparent) and 1.0 (fully opaque).
      */
     getCrosshairsOpacity: function() {
         if (this._crossHairs)
-            return this._crossHairs.getOpacity();
+            return this._crossHairs.getOpacity() / 255.0;
         else
-            return 0;
+            return 0.0;
     },
 
     /**
@@ -495,7 +495,7 @@ Magnifier.prototype = {
 
         this._settings.connect('changed::' + CROSS_HAIRS_OPACITY_KEY,
                                Lang.bind(this, function() {
-            this.setCrosshairsOpacity(this._settings.get_int(CROSS_HAIRS_OPACITY_KEY));
+            this.setCrosshairsOpacity(this._settings.get_double(CROSS_HAIRS_OPACITY_KEY));
         }));
 
         this._settings.connect('changed::' + CROSS_HAIRS_LENGTH_KEY,



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