Interface: Rework and use B_CONTROL_BACKGROUND_COLOR for controls.
Presently, the control color is heavily tinted almost everywere it's used, making it difficult to set from Appearance preferences, and making the default theme not look so good in "dark mode." After this patch, the defaults are changed to something much closer to the actual final color used in buttons and scrollbars, and the tints thus heavily reduced as a result. B_CONTROL_BACKGROUND_COLOR wasn't present on BeOS, so it should be safe to change its default. Some logic is added to app_server to automatically migrate to the new color if the old default is present. (This is based on nephele's initial patch, but significantly reworked so that existing installs are upgraded as seamlessly as possible, with few or very minor visual differences.) Co-authored-by: Pascal Abresch <[email protected]> Change-Id: Ida9fbaa61df9aeb89a9daf59cd9901a34737d5f9 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8878 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
waddlesplash
co-authored by
Pascal Abresch
parent
2a349a0a41
commit
91bed92e07
@@ -171,6 +171,9 @@ public:
|
|||||||
const BMessage* message);
|
const BMessage* message);
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
|
void AdoptSystemColors();
|
||||||
|
bool HasSystemColors() const;
|
||||||
|
|
||||||
bool IsEnabled() const { return fIsEnabled; }
|
bool IsEnabled() const { return fIsEnabled; }
|
||||||
virtual void SetEnabled(bool enable) { fIsEnabled = enable; };
|
virtual void SetEnabled(bool enable) { fIsEnabled = enable; };
|
||||||
|
|
||||||
@@ -322,7 +325,7 @@ SpinnerButton::AttachedToWindow()
|
|||||||
{
|
{
|
||||||
fParent = static_cast<BAbstractSpinner*>(Parent());
|
fParent = static_cast<BAbstractSpinner*>(Parent());
|
||||||
|
|
||||||
AdoptParentColors();
|
AdoptSystemColors();
|
||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,8 +428,6 @@ SpinnerButton::Draw(BRect updateRect)
|
|||||||
if (rect.IntegerHeight() % 2 != 0)
|
if (rect.IntegerHeight() % 2 != 0)
|
||||||
rect.bottom -= 1;
|
rect.bottom -= 1;
|
||||||
|
|
||||||
SetHighColor(tint_color(bgColor, fgTint));
|
|
||||||
|
|
||||||
// draw the +/-
|
// draw the +/-
|
||||||
float halfHeight = floorf(rect.Height() / 2);
|
float halfHeight = floorf(rect.Height() / 2);
|
||||||
StrokeLine(BPoint(rect.left, rect.top + halfHeight),
|
StrokeLine(BPoint(rect.left, rect.top + halfHeight),
|
||||||
@@ -441,6 +442,26 @@ SpinnerButton::Draw(BRect updateRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SpinnerButton::AdoptSystemColors()
|
||||||
|
{
|
||||||
|
SetViewUIColor(B_CONTROL_BACKGROUND_COLOR);
|
||||||
|
SetLowUIColor(B_CONTROL_BACKGROUND_COLOR);
|
||||||
|
SetHighUIColor(B_CONTROL_TEXT_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SpinnerButton::HasSystemColors() const
|
||||||
|
{
|
||||||
|
float tint = B_NO_TINT;
|
||||||
|
|
||||||
|
return ViewUIColor(&tint) == B_CONTROL_BACKGROUND_COLOR && tint == B_NO_TINT
|
||||||
|
&& LowUIColor(&tint) == B_CONTROL_BACKGROUND_COLOR && tint == B_NO_TINT
|
||||||
|
&& HighUIColor(&tint) == B_CONTROL_TEXT_COLOR && tint == B_NO_TINT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SpinnerButton::MouseDown(BPoint where)
|
SpinnerButton::MouseDown(BPoint where)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -162,15 +162,7 @@ _BMCMenuBar_::AttachedToWindow()
|
|||||||
if (fFixedSize && (Flags() & B_SUPPORTS_LAYOUT) == 0)
|
if (fFixedSize && (Flags() & B_SUPPORTS_LAYOUT) == 0)
|
||||||
SetResizingMode(B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
|
SetResizingMode(B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
|
||||||
|
|
||||||
if (Parent() != NULL) {
|
SetLowUIColor(B_CONTROL_BACKGROUND_COLOR);
|
||||||
color_which which = Parent()->LowUIColor();
|
|
||||||
if (which == B_NO_COLOR)
|
|
||||||
SetLowColor(Parent()->LowColor());
|
|
||||||
else
|
|
||||||
SetLowUIColor(which);
|
|
||||||
|
|
||||||
} else
|
|
||||||
SetLowUIColor(B_MENU_BACKGROUND_COLOR);
|
|
||||||
|
|
||||||
fPreviousWidth = Bounds().Width();
|
fPreviousWidth = Bounds().Width();
|
||||||
}
|
}
|
||||||
@@ -198,7 +190,6 @@ _BMCMenuBar_::Draw(BRect updateRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BRect rect(Bounds());
|
BRect rect(Bounds());
|
||||||
rgb_color base = ui_color(B_MENU_BACKGROUND_COLOR);
|
|
||||||
uint32 flags = 0;
|
uint32 flags = 0;
|
||||||
if (!IsEnabled())
|
if (!IsEnabled())
|
||||||
flags |= BControlLook::B_DISABLED;
|
flags |= BControlLook::B_DISABLED;
|
||||||
@@ -206,7 +197,7 @@ _BMCMenuBar_::Draw(BRect updateRect)
|
|||||||
flags |= BControlLook::B_FOCUSED;
|
flags |= BControlLook::B_FOCUSED;
|
||||||
|
|
||||||
be_control_look->DrawMenuFieldBackground(this, rect,
|
be_control_look->DrawMenuFieldBackground(this, rect,
|
||||||
updateRect, base, fShowPopUpMarker, flags);
|
updateRect, LowColor(), fShowPopUpMarker, flags);
|
||||||
|
|
||||||
DrawItems(updateRect);
|
DrawItems(updateRect);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ BButton::Draw(BRect updateRect)
|
|||||||
BRect rect(Bounds());
|
BRect rect(Bounds());
|
||||||
rgb_color background = ViewColor();
|
rgb_color background = ViewColor();
|
||||||
rgb_color base = LowColor();
|
rgb_color base = LowColor();
|
||||||
|
rgb_color text = HighColor();
|
||||||
|
|
||||||
uint32 flags = be_control_look->Flags(this);
|
uint32 flags = be_control_look->Flags(this);
|
||||||
if (_Flag(FLAG_DEFAULT))
|
if (_Flag(FLAG_DEFAULT))
|
||||||
@@ -156,7 +157,7 @@ BButton::Draw(BRect updateRect)
|
|||||||
| (IsEnabled() ? 0 : B_DISABLED_ICON_BITMAP));
|
| (IsEnabled() ? 0 : B_DISABLED_ICON_BITMAP));
|
||||||
|
|
||||||
be_control_look->DrawLabel(this, Label(), icon, rect, updateRect, base, flags,
|
be_control_look->DrawLabel(this, Label(), icon, rect, updateRect, base, flags,
|
||||||
BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
|
BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE), &text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -221,12 +222,7 @@ void
|
|||||||
BButton::AttachedToWindow()
|
BButton::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BControl::AttachedToWindow();
|
BControl::AttachedToWindow();
|
||||||
|
SetLowUIColor(B_CONTROL_BACKGROUND_COLOR);
|
||||||
// tint low color to match background
|
|
||||||
if (ViewColor().IsLight())
|
|
||||||
SetLowUIColor(B_CONTROL_BACKGROUND_COLOR, 1.115);
|
|
||||||
else
|
|
||||||
SetLowUIColor(B_CONTROL_BACKGROUND_COLOR, 0.885);
|
|
||||||
SetHighUIColor(B_CONTROL_TEXT_COLOR);
|
SetHighUIColor(B_CONTROL_TEXT_COLOR);
|
||||||
|
|
||||||
if (IsDefault())
|
if (IsDefault())
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ BChannelSlider::DrawThumb(BView* into, int32 channel, BPoint where,
|
|||||||
rect.top = floorf(rect.top);
|
rect.top = floorf(rect.top);
|
||||||
rect.right = ceilf(rect.right + 0.5);
|
rect.right = ceilf(rect.right + 0.5);
|
||||||
rect.bottom = ceilf(rect.bottom + 0.5);
|
rect.bottom = ceilf(rect.bottom + 0.5);
|
||||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
rgb_color base = ui_color(B_CONTROL_BACKGROUND_COLOR);
|
||||||
uint32 flags = 0;
|
uint32 flags = 0;
|
||||||
be_control_look->DrawSliderThumb(into, rect, rect, base,
|
be_control_look->DrawSliderThumb(into, rect, rect, base,
|
||||||
flags, Orientation());
|
flags, Orientation());
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
static const float kEdgeBevelLightTint = 0.59;
|
|
||||||
static const float kEdgeBevelShadowTint = 1.0735;
|
|
||||||
static const float kHoverTintFactor = 0.85;
|
static const float kHoverTintFactor = 0.85;
|
||||||
|
|
||||||
static const int32 kButtonPopUpIndicatorWidth = B_USE_ITEM_SPACING;
|
static const int32 kButtonPopUpIndicatorWidth = B_USE_ITEM_SPACING;
|
||||||
@@ -2779,7 +2777,10 @@ HaikuControlLook::_DrawButtonBackground(BView* view, BRect& rect,
|
|||||||
&& (flags & (B_ACTIVATED | B_PARTIALLY_ACTIVATED)) == 0
|
&& (flags & (B_ACTIVATED | B_PARTIALLY_ACTIVATED)) == 0
|
||||||
&& ((flags & (B_HOVER | B_FOCUSED)) == 0
|
&& ((flags & (B_HOVER | B_FOCUSED)) == 0
|
||||||
|| (flags & B_DISABLED) != 0)) {
|
|| (flags & B_DISABLED) != 0)) {
|
||||||
_DrawFlatButtonBackground(view, rect, updateRect, base, popupIndicator,
|
rgb_color flatBase = base;
|
||||||
|
if (view->Parent() != NULL)
|
||||||
|
flatBase = view->Parent()->LowColor();
|
||||||
|
_DrawFlatButtonBackground(view, rect, updateRect, flatBase, popupIndicator,
|
||||||
flags, borders, orientation);
|
flags, borders, orientation);
|
||||||
} else {
|
} else {
|
||||||
BRegion clipping(rect);
|
BRegion clipping(rect);
|
||||||
@@ -2829,12 +2830,12 @@ HaikuControlLook::_DrawNonFlatButtonBackground(BView* view, BRect& rect,
|
|||||||
rgb_color bevelLightColor = _BevelLightColor(base, flags);
|
rgb_color bevelLightColor = _BevelLightColor(base, flags);
|
||||||
rgb_color bevelShadowColor = _BevelShadowColor(base, flags);
|
rgb_color bevelShadowColor = _BevelShadowColor(base, flags);
|
||||||
|
|
||||||
// button background color
|
// button corners color
|
||||||
rgb_color buttonBgColor;
|
rgb_color buttonCornerColor;
|
||||||
if ((flags & B_DISABLED) != 0)
|
if ((flags & B_DISABLED) != 0)
|
||||||
buttonBgColor = tint_color(base, 0.7);
|
buttonCornerColor = tint_color(base, 0.84 /* lighten "< 1" */);
|
||||||
else
|
else
|
||||||
buttonBgColor = tint_color(base, B_LIGHTEN_1_TINT);
|
buttonCornerColor = tint_color(base, 0.7 /* lighten "< 1" */);
|
||||||
|
|
||||||
// surface top gradient
|
// surface top gradient
|
||||||
BGradientLinear fillGradient;
|
BGradientLinear fillGradient;
|
||||||
@@ -2929,7 +2930,7 @@ HaikuControlLook::_DrawNonFlatButtonBackground(BView* view, BRect& rect,
|
|||||||
_DrawFrame(view, rect,
|
_DrawFrame(view, rect,
|
||||||
bevelLightColor, bevelLightColor,
|
bevelLightColor, bevelLightColor,
|
||||||
bevelShadowColor, bevelShadowColor,
|
bevelShadowColor, bevelShadowColor,
|
||||||
buttonBgColor, buttonBgColor, borders);
|
buttonCornerColor, buttonCornerColor, borders);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (popupIndicator) {
|
if (popupIndicator) {
|
||||||
@@ -3679,7 +3680,7 @@ HaikuControlLook::_EdgeColor(const rgb_color& base, bool shadow, uint32 flags)
|
|||||||
|
|
||||||
edgeColor = (rgb_color){ value, value, value, alpha };
|
edgeColor = (rgb_color){ value, value, value, alpha };
|
||||||
} else {
|
} else {
|
||||||
float tint = shadow ? kEdgeBevelShadowTint : kEdgeBevelLightTint;
|
float tint = shadow ? 1.0735 : 0.59;
|
||||||
if ((flags & B_DEFAULT_BUTTON) != 0) {
|
if ((flags & B_DEFAULT_BUTTON) != 0) {
|
||||||
if ((flags & B_DISABLED) != 0)
|
if ((flags & B_DISABLED) != 0)
|
||||||
tint = B_NO_TINT + (tint - B_NO_TINT) * 0.3;
|
tint = B_NO_TINT + (tint - B_NO_TINT) * 0.3;
|
||||||
@@ -3718,7 +3719,7 @@ HaikuControlLook::_FrameLightColor(const rgb_color& base, uint32 flags)
|
|||||||
if ((flags & B_BLEND_FRAME) != 0)
|
if ((flags & B_BLEND_FRAME) != 0)
|
||||||
frameLightColor = (rgb_color){ 0, 0, 0, 75 };
|
frameLightColor = (rgb_color){ 0, 0, 0, 75 };
|
||||||
else
|
else
|
||||||
frameLightColor = tint_color(base, 1.33);
|
frameLightColor = tint_color(base, 1.35);
|
||||||
|
|
||||||
if ((flags & B_DEFAULT_BUTTON) != 0)
|
if ((flags & B_DEFAULT_BUTTON) != 0)
|
||||||
frameLightColor = tint_color(frameLightColor, 1.35);
|
frameLightColor = tint_color(frameLightColor, 1.35);
|
||||||
@@ -3741,7 +3742,7 @@ HaikuControlLook::_FrameShadowColor(const rgb_color& base, uint32 flags)
|
|||||||
|
|
||||||
if ((flags & B_DISABLED) != 0) {
|
if ((flags & B_DISABLED) != 0) {
|
||||||
// TODO: B_BLEND_FRAME
|
// TODO: B_BLEND_FRAME
|
||||||
frameShadowColor = tint_color(base, 1.24);
|
frameShadowColor = tint_color(base, 1.26);
|
||||||
|
|
||||||
if ((flags & B_DEFAULT_BUTTON) != 0) {
|
if ((flags & B_DEFAULT_BUTTON) != 0) {
|
||||||
frameShadowColor = tint_color(base, 1.145);
|
frameShadowColor = tint_color(base, 1.145);
|
||||||
@@ -3759,7 +3760,7 @@ HaikuControlLook::_FrameShadowColor(const rgb_color& base, uint32 flags)
|
|||||||
if ((flags & B_BLEND_FRAME) != 0)
|
if ((flags & B_BLEND_FRAME) != 0)
|
||||||
frameShadowColor = (rgb_color){ 0, 0, 0, 95 };
|
frameShadowColor = (rgb_color){ 0, 0, 0, 95 };
|
||||||
else
|
else
|
||||||
frameShadowColor = tint_color(base, 1.47);
|
frameShadowColor = tint_color(base, 1.485);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3770,13 +3771,14 @@ HaikuControlLook::_FrameShadowColor(const rgb_color& base, uint32 flags)
|
|||||||
rgb_color
|
rgb_color
|
||||||
HaikuControlLook::_BevelLightColor(const rgb_color& base, uint32 flags)
|
HaikuControlLook::_BevelLightColor(const rgb_color& base, uint32 flags)
|
||||||
{
|
{
|
||||||
rgb_color bevelLightColor = tint_color(base, 0.2);
|
rgb_color bevelLightColor;
|
||||||
|
|
||||||
if ((flags & B_DISABLED) != 0)
|
|
||||||
bevelLightColor = tint_color(base, B_LIGHTEN_1_TINT);
|
|
||||||
|
|
||||||
if ((flags & B_ACTIVATED) != 0)
|
if ((flags & B_ACTIVATED) != 0)
|
||||||
bevelLightColor = tint_color(base, B_DARKEN_1_TINT);
|
bevelLightColor = tint_color(base, 1.17);
|
||||||
|
else if ((flags & B_DISABLED) != 0)
|
||||||
|
bevelLightColor = tint_color(base, B_LIGHTEN_1_TINT);
|
||||||
|
else
|
||||||
|
bevelLightColor = tint_color(base, 0.2);
|
||||||
|
|
||||||
return bevelLightColor;
|
return bevelLightColor;
|
||||||
}
|
}
|
||||||
@@ -3785,13 +3787,14 @@ HaikuControlLook::_BevelLightColor(const rgb_color& base, uint32 flags)
|
|||||||
rgb_color
|
rgb_color
|
||||||
HaikuControlLook::_BevelShadowColor(const rgb_color& base, uint32 flags)
|
HaikuControlLook::_BevelShadowColor(const rgb_color& base, uint32 flags)
|
||||||
{
|
{
|
||||||
rgb_color bevelShadowColor = tint_color(base, 1.08);
|
rgb_color bevelShadowColor;
|
||||||
|
|
||||||
if ((flags & B_DISABLED) != 0)
|
|
||||||
bevelShadowColor = base;
|
|
||||||
|
|
||||||
if ((flags & B_ACTIVATED) != 0)
|
if ((flags & B_ACTIVATED) != 0)
|
||||||
bevelShadowColor = tint_color(base, B_DARKEN_1_TINT);
|
bevelShadowColor = tint_color(base, 1.17);
|
||||||
|
else if ((flags & B_DISABLED) != 0)
|
||||||
|
bevelShadowColor = base;
|
||||||
|
else
|
||||||
|
bevelShadowColor = tint_color(base, 1.105);
|
||||||
|
|
||||||
return bevelShadowColor;
|
return bevelShadowColor;
|
||||||
}
|
}
|
||||||
@@ -3857,14 +3860,14 @@ void
|
|||||||
HaikuControlLook::_MakeButtonGradient(BGradientLinear& gradient, BRect& rect,
|
HaikuControlLook::_MakeButtonGradient(BGradientLinear& gradient, BRect& rect,
|
||||||
const rgb_color& base, uint32 flags, orientation orientation) const
|
const rgb_color& base, uint32 flags, orientation orientation) const
|
||||||
{
|
{
|
||||||
float topTint = 0.49;
|
float topTint = 0.6;
|
||||||
float middleTint1 = 0.62;
|
float middleTint1 = 0.75;
|
||||||
float middleTint2 = 0.76;
|
float middleTint2 = 0.9;
|
||||||
float bottomTint = 0.90;
|
float bottomTint = 1.01;
|
||||||
|
|
||||||
if ((flags & B_ACTIVATED) != 0) {
|
if ((flags & B_ACTIVATED) != 0) {
|
||||||
topTint = 1.11;
|
topTint = 1.135;
|
||||||
bottomTint = 1.08;
|
bottomTint = 1.105;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & B_DISABLED) != 0) {
|
if ((flags & B_DISABLED) != 0) {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ static const rgb_color _kDefaultColors[kColorWhichCount] = {
|
|||||||
{0, 0, 0, 255}, // B_PANEL_TEXT_COLOR
|
{0, 0, 0, 255}, // B_PANEL_TEXT_COLOR
|
||||||
{255, 255, 255, 255}, // B_DOCUMENT_BACKGROUND_COLOR
|
{255, 255, 255, 255}, // B_DOCUMENT_BACKGROUND_COLOR
|
||||||
{0, 0, 0, 255}, // B_DOCUMENT_TEXT_COLOR
|
{0, 0, 0, 255}, // B_DOCUMENT_TEXT_COLOR
|
||||||
{245, 245, 245, 255}, // B_CONTROL_BACKGROUND_COLOR
|
{222, 222, 222, 255}, // B_CONTROL_BACKGROUND_COLOR
|
||||||
{0, 0, 0, 255}, // B_CONTROL_TEXT_COLOR
|
{0, 0, 0, 255}, // B_CONTROL_TEXT_COLOR
|
||||||
{172, 172, 172, 255}, // B_CONTROL_BORDER_COLOR
|
{172, 172, 172, 255}, // B_CONTROL_BORDER_COLOR
|
||||||
{102, 152, 203, 255}, // B_CONTROL_HIGHLIGHT_COLOR
|
{102, 152, 203, 255}, // B_CONTROL_HIGHLIGHT_COLOR
|
||||||
|
|||||||
@@ -1593,7 +1593,7 @@ BSlider::_DrawBlockThumb()
|
|||||||
BRect frame = ThumbFrame();
|
BRect frame = ThumbFrame();
|
||||||
BView* view = OffscreenView();
|
BView* view = OffscreenView();
|
||||||
|
|
||||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
rgb_color base = ui_color(B_CONTROL_BACKGROUND_COLOR);
|
||||||
uint32 flags = be_control_look->Flags(this);
|
uint32 flags = be_control_look->Flags(this);
|
||||||
be_control_look->DrawSliderThumb(view, frame, frame, base, flags,
|
be_control_look->DrawSliderThumb(view, frame, frame, base, flags,
|
||||||
fOrientation);
|
fOrientation);
|
||||||
@@ -1605,7 +1605,7 @@ BSlider::_DrawTriangleThumb()
|
|||||||
{
|
{
|
||||||
BRect frame = ThumbFrame();
|
BRect frame = ThumbFrame();
|
||||||
BView* view = OffscreenView();
|
BView* view = OffscreenView();
|
||||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
rgb_color base = ui_color(B_CONTROL_BACKGROUND_COLOR);
|
||||||
uint32 flags = be_control_look->Flags(this);
|
uint32 flags = be_control_look->Flags(this);
|
||||||
be_control_look->DrawSliderTriangle(view, frame, frame, base, flags,
|
be_control_look->DrawSliderTriangle(view, frame, frame, base, flags,
|
||||||
fOrientation);
|
fOrientation);
|
||||||
|
|||||||
@@ -336,15 +336,15 @@ ColorsView::_SetColor(color_which which, rgb_color color)
|
|||||||
const bool isDark = color.IsDark();
|
const bool isDark = color.IsDark();
|
||||||
|
|
||||||
_SetOneColor(B_MENU_BACKGROUND_COLOR, color);
|
_SetOneColor(B_MENU_BACKGROUND_COLOR, color);
|
||||||
_SetOneColor(B_SCROLL_BAR_THUMB_COLOR, color);
|
|
||||||
|
|
||||||
const rgb_color menuSelectedBackground
|
const rgb_color menuSelectedBackground
|
||||||
= tint_color(color, isDark ? 0.8 /* lighten "< 1" */ : B_DARKEN_2_TINT);
|
= tint_color(color, isDark ? 0.8 /* lighten "< 1" */ : B_DARKEN_2_TINT);
|
||||||
_SetOneColor(B_MENU_SELECTED_BACKGROUND_COLOR, menuSelectedBackground);
|
_SetOneColor(B_MENU_SELECTED_BACKGROUND_COLOR, menuSelectedBackground);
|
||||||
|
|
||||||
const rgb_color controlBackground = tint_color(color, isDark
|
const rgb_color controlBackground = tint_color(color,
|
||||||
? 0.8 /* lighten "< 1" */ : 0.25 /* lighten "> 2" */);
|
0.84 /* lighten "< 1" */);
|
||||||
_SetOneColor(B_CONTROL_BACKGROUND_COLOR, controlBackground);
|
_SetOneColor(B_CONTROL_BACKGROUND_COLOR, controlBackground);
|
||||||
|
_SetOneColor(B_SCROLL_BAR_THUMB_COLOR, controlBackground);
|
||||||
|
|
||||||
const rgb_color controlBorder
|
const rgb_color controlBorder
|
||||||
= tint_color(color, isDark ? 0.4875 : 1.20 /* lighten/darken "1.5" */);
|
= tint_color(color, isDark ? 0.4875 : 1.20 /* lighten/darken "1.5" */);
|
||||||
|
|||||||
@@ -547,6 +547,17 @@ Desktop::Init()
|
|||||||
const_cast<menu_info&>(fSettings->MenuInfo()).font_size = fontSize;
|
const_cast<menu_info&>(fSettings->MenuInfo()).font_size = fontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// Migrate old default UI control color to the new one.
|
||||||
|
// TODO: Drop this after R1/beta6 is released!
|
||||||
|
if (fSettings->UIColor(B_CONTROL_BACKGROUND_COLOR) == make_color(245, 245, 245)
|
||||||
|
&& fSettings->ControlLook().IsEmpty()) {
|
||||||
|
rgb_color newControlBackground = make_color(222, 222, 222);
|
||||||
|
fSettings->SetUIColor(B_CONTROL_BACKGROUND_COLOR, newControlBackground);
|
||||||
|
fSettings->SetUIColor(B_SCROLL_BAR_THUMB_COLOR, newControlBackground);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
HWInterface()->SetDPMSMode(B_DPMS_ON);
|
HWInterface()->SetDPMSMode(B_DPMS_ON);
|
||||||
|
|
||||||
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user