[haiku-commits] BRANCH looncraz-github.setviewuicolor [de6dc0d1bc4a] in src: apps/aboutsystem preferences/screensaver

  • From: looncraz-github.setviewuicolor <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 7 Oct 2015 22:01:57 +0200 (CEST)

added 2 changesets to branch 'refs/remotes/looncraz-github/setviewuicolor'
old head: a853f4c05e39fde6e1f1b90c295d643416906f22
new head: de6dc0d1bc4a9c00c0aa06758e183fe8df261bba
overview: https://github.com/looncraz/haiku/compare/a853f4c05e39...de6dc0d1bc4a

----------------------------------------------------------------------------

3af808aae1e4: Simplify AboutSystem Colors

Use mix_colors instead of a tint calculation.

de6dc0d1bc4a: Use disable_color

[ looncraz <looncraz@xxxxxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 6 insertions(+), 12 deletions(-)
src/apps/aboutsystem/AboutSystem.cpp | 14 ++++----------
src/preferences/screensaver/ScreenSaverWindow.cpp | 4 ++--

############################################################################

Commit: 3af808aae1e4d737c179072358228acb66235e80
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Wed Oct 7 20:44:30 2015 UTC

Simplify AboutSystem Colors

Use mix_colors instead of a tint calculation.

----------------------------------------------------------------------------

diff --git a/src/apps/aboutsystem/AboutSystem.cpp
b/src/apps/aboutsystem/AboutSystem.cpp
index a8a0bc9..311826a 100644
--- a/src/apps/aboutsystem/AboutSystem.cpp
+++ b/src/apps/aboutsystem/AboutSystem.cpp
@@ -848,26 +848,20 @@ AboutView::PickRandomHaiku()
void
AboutView::_AdjustTextColors()
{
- // Adjust tint for strings based on panel text color
- // The theory is that the user will use lighter panel text colors
- // with dark background - and vice versa, so we don't need to pay
- // attention to the background color ourselves.
- rgb_color color = ui_color(B_PANEL_TEXT_COLOR);
- float tintAdjust = (float)color.Brightness() / 510.0f;
- float tint = 0.75 + tintAdjust;
+ rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR);
+ rgb_color color = mix_color(ViewColor(), textColor, 192);

BView* view = NULL;
for (int32 index = 0; index < fSubTextViews.CountItems(); ++index) {
view = fSubTextViews.ItemAt(index);
- view->SetHighUIColor(B_PANEL_TEXT_COLOR, tint);
+ view->SetHighColor(color);
view->Invalidate();
}

// Labels
- tint = 1.25 - tintAdjust;
for (int32 index = 0; index < fTextViews.CountItems(); ++index) {
view = fTextViews.ItemAt(index);
- view->SetHighUIColor(B_PANEL_TEXT_COLOR, tint);
+ view->SetHighColor(textColor);
view->Invalidate();
}
}

############################################################################

Commit: de6dc0d1bc4a9c00c0aa06758e183fe8df261bba
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Wed Oct 7 20:47:18 2015 UTC

Use disable_color

----------------------------------------------------------------------------

diff --git a/src/preferences/screensaver/ScreenSaverWindow.cpp
b/src/preferences/screensaver/ScreenSaverWindow.cpp
index 1262104..e335707 100644
--- a/src/preferences/screensaver/ScreenSaverWindow.cpp
+++ b/src/preferences/screensaver/ScreenSaverWindow.cpp
@@ -294,8 +294,8 @@ FadeView::FadeView(const char* name, ScreenSaverSettings&
settings)
kMsgRunSliderUpdate);

// Turn Off
- rgb_color textColor = mix_color(ui_color(B_PANEL_TEXT_COLOR),
- ViewColor(), 192);
+ rgb_color textColor = disable_color(ui_color(B_PANEL_TEXT_COLOR),
+ ViewColor());

fTurnOffNotSupported = new BTextView("not_supported", be_plain_font,
&textColor, B_WILL_DRAW);


Other related posts:

  • » [haiku-commits] BRANCH looncraz-github.setviewuicolor [de6dc0d1bc4a] in src: apps/aboutsystem preferences/screensaver - looncraz-github . setviewuicolor