[haiku-commits] haiku: hrev44343 - headers/private/app src/kits/interface src/preferences/appearance src/bin headers/os/interface

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 15 Jul 2012 21:09:27 +0200 (CEST)

hrev44343 adds 1 changeset to branch 'master'
old head: 17ef26a9f8319415aa24e54aae6cfdbea1624071
new head: 4bb5af765fc7c9e4daf911d5ad8db763403fdd21

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

4bb5af7: Add control mark color setting. #8054
  
  An enhancement adding a setting to Colors under Appearance to
  set the mark color of radio button and check box controls.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev44343
Commit:      4bb5af765fc7c9e4daf911d5ad8db763403fdd21
URL:         http://cgit.haiku-os.org/haiku/commit/?id=4bb5af7
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Sun Jul 15 19:05:59 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/8054

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

6 files changed, 10 insertions(+), 8 deletions(-)
headers/os/interface/InterfaceDefs.h       |    1 +
headers/private/app/ServerReadOnlyMemory.h |    9 +++++----
src/bin/WindowShade.cpp                    |    1 +
src/kits/interface/ControlLook.cpp         |    5 +----
src/kits/interface/InterfaceDefs.cpp       |    1 +
src/preferences/appearance/ColorSet.cpp    |    1 +

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

diff --git a/headers/os/interface/InterfaceDefs.h 
b/headers/os/interface/InterfaceDefs.h
index 0f85a48..82c4bb7 100644
--- a/headers/os/interface/InterfaceDefs.h
+++ b/headers/os/interface/InterfaceDefs.h
@@ -294,6 +294,7 @@ enum color_which {
        B_CONTROL_TEXT_COLOR = 14,
        B_CONTROL_BORDER_COLOR = 15,
        B_CONTROL_HIGHLIGHT_COLOR = 16,
+       B_CONTROL_MARK_COLOR = 27,
        B_NAVIGATION_BASE_COLOR = 4,
        B_NAVIGATION_PULSE_COLOR = 17,
        B_SHINE_COLOR = 18,
diff --git a/headers/private/app/ServerReadOnlyMemory.h 
b/headers/private/app/ServerReadOnlyMemory.h
index 6ceadfd..821de03 100644
--- a/headers/private/app/ServerReadOnlyMemory.h
+++ b/headers/private/app/ServerReadOnlyMemory.h
@@ -26,23 +26,24 @@ static inline int32
 color_which_to_index(color_which which)
 {
        // NOTE: this must be kept in sync with InterfaceDefs.h color_which!
-       if (which <= B_WINDOW_INACTIVE_BORDER_COLOR)
+       if (which <= B_CONTROL_MARK_COLOR)
                return which - 1;
        if (which >= B_SUCCESS_COLOR && which <= B_FAILURE_COLOR)
-               return which - B_SUCCESS_COLOR + B_WINDOW_INACTIVE_BORDER_COLOR;
+               return which - B_SUCCESS_COLOR + B_CONTROL_MARK_COLOR;
 
        return -1;
 }
 
+
 static inline color_which
 index_to_color_which(int32 index)
 {
        if (index >= 0 && index < kNumColors) {
-               if ((color_which)index < B_WINDOW_INACTIVE_BORDER_COLOR)
+               if ((color_which)index < B_CONTROL_MARK_COLOR)
                        return (color_which)(index + 1);
                else {
                        return (color_which)(index + B_SUCCESS_COLOR
-                         - B_WINDOW_INACTIVE_BORDER_COLOR);
+                         - B_CONTROL_MARK_COLOR);
                }
        }
 
diff --git a/src/bin/WindowShade.cpp b/src/bin/WindowShade.cpp
index dcca8d2..d8e29a6 100644
--- a/src/bin/WindowShade.cpp
+++ b/src/bin/WindowShade.cpp
@@ -43,6 +43,7 @@ static struct option const kLongOptions[] = {
        I(control_text_color, B_CONTROL_TEXT_COLOR),
        I(control_border_color, B_CONTROL_BORDER_COLOR),
        I(control_highlight_color, B_CONTROL_HIGHLIGHT_COLOR),
+       I(control_mark_color, B_CONTROL_MARK_COLOR)
        I(navigation_base_color, B_NAVIGATION_BASE_COLOR),
        I(navigation_pulse_color, B_NAVIGATION_PULSE_COLOR),
        I(shine_color, B_SHINE_COLOR),
diff --git a/src/kits/interface/ControlLook.cpp 
b/src/kits/interface/ControlLook.cpp
index cc3e686..a0d8a11 100644
--- a/src/kits/interface/ControlLook.cpp
+++ b/src/kits/interface/ControlLook.cpp
@@ -3197,10 +3197,7 @@ BControlLook::_RadioButtonAndCheckBoxMarkColor(const 
rgb_color& base,
                return false;
        }
 
-       // TODO: Get from UI settings
-       color.red = 27;
-       color.green = 82;
-       color.blue = 140;
+       color = ui_color(B_CONTROL_MARK_COLOR);
 
        float mix = 1.0;
 
diff --git a/src/kits/interface/InterfaceDefs.cpp 
b/src/kits/interface/InterfaceDefs.cpp
index 1c53538..2a397a9 100644
--- a/src/kits/interface/InterfaceDefs.cpp
+++ b/src/kits/interface/InterfaceDefs.cpp
@@ -96,6 +96,7 @@ static const rgb_color _kDefaultColors[kNumColors] = {
        {80, 80, 80, 255},              // B_WINDOW_INACTIVE_TEXT_COLOR
        {224, 224, 224, 255},   // B_WINDOW_BORDER_COLOR
        {232, 232, 232, 255},   // B_WINDOW_INACTIVE_BORDER_COLOR
+       {27, 82, 140, 255},     // B_CONTROL_MARK_COLOR
        // 100...
        {0, 255, 0, 255},               // B_SUCCESS_COLOR
        {255, 0, 0, 255},               // B_FAILURE_COLOR
diff --git a/src/preferences/appearance/ColorSet.cpp 
b/src/preferences/appearance/ColorSet.cpp
index 757f711..ccd6728 100644
--- a/src/preferences/appearance/ColorSet.cpp
+++ b/src/preferences/appearance/ColorSet.cpp
@@ -34,6 +34,7 @@ static ColorDescription sColorDescriptionTable[] =
        { B_CONTROL_TEXT_COLOR, B_TRANSLATE_MARK("Control text") },
        { B_CONTROL_BORDER_COLOR, B_TRANSLATE_MARK("Control border") },
        { B_CONTROL_HIGHLIGHT_COLOR, B_TRANSLATE_MARK("Control highlight") },
+       { B_CONTROL_MARK_COLOR, B_TRANSLATE_MARK("Control mark") },
        { B_NAVIGATION_BASE_COLOR, B_TRANSLATE_MARK("Navigation base") },
        { B_NAVIGATION_PULSE_COLOR, B_TRANSLATE_MARK("Navigation pulse") },
        { B_SHINE_COLOR, B_TRANSLATE_MARK("Shine") },


Other related posts:

  • » [haiku-commits] haiku: hrev44343 - headers/private/app src/kits/interface src/preferences/appearance src/bin headers/os/interface - jscipione