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.
This commit is contained in:
John Scipione 2012-07-15 15:05:59 -04:00
parent 17ef26a9f8
commit 4bb5af765f
6 changed files with 10 additions and 8 deletions

View File

@ -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,

View File

@ -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);
}
}

View File

@ -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),

View File

@ -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;

View File

@ -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

View File

@ -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") },