[gnome-shell/wip/aggregate-menu: 97/99] slider: Extend the trough to the allocation extents



commit 5363597a6f78a8d417ebb016a3e6cef71a2d69d0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 11 23:33:54 2013 -0400

    slider: Extend the trough to the allocation extents
    
    This aligns the edge of the slider with the allocation of items
    under it, which is what we want to happen in the new aggregate
    menu.

 js/ui/slider.js |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/slider.js b/js/ui/slider.js
index ba8b9f6..534b374 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -48,7 +48,6 @@ const Slider = new Lang.Class({
         let [hasHandleColor, handleBorderColor] =
             themeNode.lookup_color('-slider-handle-border-color', false);
 
-        let sliderWidth = width - 2 * handleRadius;
         let sliderHeight = themeNode.get_length('-slider-height');
 
         let sliderBorderWidth = themeNode.get_length('-slider-border-width');
@@ -64,7 +63,7 @@ const Slider = new Lang.Class({
             sliderActiveColor.green / 255,
             sliderActiveColor.blue / 255,
             sliderActiveColor.alpha / 255);
-        cr.rectangle(handleRadius, (height - sliderHeight) / 2, sliderWidth * this._value, sliderHeight);
+        cr.rectangle(0, (height - sliderHeight) / 2, width * this._value, sliderHeight);
         cr.fillPreserve();
         cr.setSourceRGBA (
             sliderActiveBorderColor.red / 255,
@@ -79,7 +78,7 @@ const Slider = new Lang.Class({
             sliderColor.green / 255,
             sliderColor.blue / 255,
             sliderColor.alpha / 255);
-        cr.rectangle(handleRadius + sliderWidth * this._value, (height - sliderHeight) / 2, sliderWidth * (1 
- this._value), sliderHeight);
+        cr.rectangle(width * this._value, (height - sliderHeight) / 2, width * (1 - this._value), 
sliderHeight);
         cr.fillPreserve();
         cr.setSourceRGBA (
             sliderBorderColor.red / 255,


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