popupMenu: Restyle the slider to use a color for the 'active' area

In the mockups the slider does not have an uniform color but uses
one color (shade of blue) to indicate the current value and one
to indicate "the rest" (shade of grey).

So adjust the slider to look like that to be closer to the look
in the mockups and thus to the design.

https://bugzilla.gnome.org/show_bug.cgi?id=644600
This commit is contained in:
Adel Gadllah 2011-03-12 23:49:03 +01:00
parent d3703516d9
commit 3466829766
2 changed files with 21 additions and 1 deletions

View File

@ -150,6 +150,8 @@ StTooltip StLabel {
-slider-height: 0.3em; -slider-height: 0.3em;
-slider-background-color: #333333; -slider-background-color: #333333;
-slider-border-color: #5f5f5f; -slider-border-color: #5f5f5f;
-slider-active-background-color: #76b0ec;
-slider-active-border-color: #1f6dbc;
-slider-border-width: 1px; -slider-border-width: 1px;
-slider-handle-radius: 0.5em; -slider-handle-radius: 0.5em;
} }

View File

@ -485,12 +485,30 @@ PopupSliderMenuItem.prototype = {
let sliderBorderColor = themeNode.get_color('-slider-border-color'); let sliderBorderColor = themeNode.get_color('-slider-border-color');
let sliderColor = themeNode.get_color('-slider-background-color'); let sliderColor = themeNode.get_color('-slider-background-color');
let sliderActiveBorderColor = themeNode.get_color('-slider-active-border-color');
let sliderActiveColor = themeNode.get_color('-slider-active-background-color');
cr.setSourceRGBA (
sliderActiveColor.red / 255,
sliderActiveColor.green / 255,
sliderActiveColor.blue / 255,
sliderActiveColor.alpha / 255);
cr.rectangle(handleRadius, (height - sliderHeight) / 2, sliderWidth * this._value, sliderHeight);
cr.fillPreserve();
cr.setSourceRGBA (
sliderActiveBorderColor.red / 255,
sliderActiveBorderColor.green / 255,
sliderActiveBorderColor.blue / 255,
sliderActiveBorderColor.alpha / 255);
cr.setLineWidth(sliderBorderWidth);
cr.stroke();
cr.setSourceRGBA ( cr.setSourceRGBA (
sliderColor.red / 255, sliderColor.red / 255,
sliderColor.green / 255, sliderColor.green / 255,
sliderColor.blue / 255, sliderColor.blue / 255,
sliderColor.alpha / 255); sliderColor.alpha / 255);
cr.rectangle(handleRadius, (height - sliderHeight) / 2, sliderWidth, sliderHeight); cr.rectangle(handleRadius + sliderWidth * this._value, (height - sliderHeight) / 2, sliderWidth * (1 - this._value), sliderHeight);
cr.fillPreserve(); cr.fillPreserve();
cr.setSourceRGBA ( cr.setSourceRGBA (
sliderBorderColor.red / 255, sliderBorderColor.red / 255,