Create and use new list view item colors

* B_LIST_BACKGROUND_COLOR
* B_LIST_SELECTED_BACKGROUND_COLOR
* B_LIST_ITEM_TEXT_COLOR
* B_LIST_SELECTED_ITEM_TEXT_COLOR
This commit is contained in:
John Scipione
2012-08-22 00:28:24 -04:00
parent f49d27c7ed
commit 91c78f092f
9 changed files with 49 additions and 27 deletions
+14 -9
View File
@@ -306,27 +306,32 @@ enum color_which {
B_MENU_SELECTED_ITEM_TEXT_COLOR = 8,
B_MENU_SELECTED_BORDER_COLOR = 9,
B_LIST_BACKGROUND_COLOR = 28,
B_LIST_SELECTED_BACKGROUND_COLOR = 29,
B_LIST_ITEM_TEXT_COLOR = 30,
B_LIST_SELECTED_ITEM_TEXT_COLOR = 31,
B_TOOL_TIP_BACKGROUND_COLOR = 20,
B_TOOL_TIP_TEXT_COLOR = 21,
B_SUCCESS_COLOR = 100,
B_FAILURE_COLOR = 101,
// Old name synonyms.
B_KEYBOARD_NAVIGATION_COLOR = B_NAVIGATION_BASE_COLOR,
B_MENU_SELECTION_BACKGROUND_COLOR = B_MENU_SELECTED_BACKGROUND_COLOR,
// These are deprecated -- do not use in new code. See BScreen for
// the replacement for B_DESKTOP_COLOR.
B_DESKTOP_COLOR = 5,
B_WINDOW_TAB_COLOR = 3,
B_WINDOW_TEXT_COLOR = 22,
B_WINDOW_INACTIVE_TAB_COLOR = 23,
B_WINDOW_INACTIVE_TEXT_COLOR = 24,
B_WINDOW_BORDER_COLOR = 25,
B_WINDOW_INACTIVE_BORDER_COLOR = 26
B_WINDOW_INACTIVE_BORDER_COLOR = 26,
// Old name synonyms.
B_KEYBOARD_NAVIGATION_COLOR = B_NAVIGATION_BASE_COLOR,
B_MENU_SELECTION_BACKGROUND_COLOR = B_MENU_SELECTED_BACKGROUND_COLOR,
// These are deprecated -- do not use in new code. See BScreen for
// the replacement for B_DESKTOP_COLOR.
B_DESKTOP_COLOR = 5
};
+5 -5
View File
@@ -13,7 +13,7 @@
#include <InterfaceDefs.h>
static const int32 kNumColors = 32;
static const int32 kNumColors = 34;
struct server_read_only_memory {
rgb_color colors[kNumColors];
@@ -26,10 +26,10 @@ 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_CONTROL_MARK_COLOR)
if (which <= B_LIST_SELECTED_ITEM_TEXT_COLOR)
return which - 1;
if (which >= B_SUCCESS_COLOR && which <= B_FAILURE_COLOR)
return which - B_SUCCESS_COLOR + B_CONTROL_MARK_COLOR;
return which - B_SUCCESS_COLOR + B_LIST_SELECTED_ITEM_TEXT_COLOR;
return -1;
}
@@ -39,11 +39,11 @@ static inline color_which
index_to_color_which(int32 index)
{
if (index >= 0 && index < kNumColors) {
if ((color_which)index < B_CONTROL_MARK_COLOR)
if ((color_which)index < B_LIST_SELECTED_ITEM_TEXT_COLOR)
return (color_which)(index + 1);
else {
return (color_which)(index + B_SUCCESS_COLOR
- B_CONTROL_MARK_COLOR);
- B_LIST_SELECTED_ITEM_TEXT_COLOR);
}
}