[haiku-commits] haiku: hrev49144 - src/kits/interface

  • From: janus2@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 3 May 2015 19:58:13 +0200 (CEST)

hrev49144 adds 2 changesets to branch 'master'
old head: 10b4fed24fc5c2ad8f53145e91ca6caa6a3950ce
new head: d54a4f43ccb59bb0b9d5cc980e9cb7b2dab5a322
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=d54a4f43ccb5+%5E10b4fed24fc5

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

8fceacff2d74: InterfaceDef: Use a lighter grey for list selection.

* Use the BColumnListView grey for list selection.

d54a4f43ccb5: BColumListView: uses system colors.

* Partialy fixes #10840.

[ Janus <janus2@xxxxxxxxx> ]

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

2 files changed, 27 insertions(+), 20 deletions(-)
src/kits/interface/ColumnListView.cpp | 45 ++++++++++++++++++-------------
src/kits/interface/InterfaceDefs.cpp | 2 +-

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

Commit: 8fceacff2d74a7bd3a3e6c5eb925d205febaa1b3
URL: http://cgit.haiku-os.org/haiku/commit/?id=8fceacff2d74
Author: Janus <janus2@xxxxxxxxx>
Date: Sun May 3 17:24:12 2015 UTC

InterfaceDef: Use a lighter grey for list selection.

* Use the BColumnListView grey for list selection.

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

diff --git a/src/kits/interface/InterfaceDefs.cpp
b/src/kits/interface/InterfaceDefs.cpp
index e28a711..e303a62 100644
--- a/src/kits/interface/InterfaceDefs.cpp
+++ b/src/kits/interface/InterfaceDefs.cpp
@@ -98,7 +98,7 @@ static const rgb_color _kDefaultColors[kColorWhichCount] = {
{232, 232, 232, 255}, // B_WINDOW_INACTIVE_BORDER_COLOR
{27, 82, 140, 255}, // B_CONTROL_MARK_COLOR
{255, 255, 255, 255}, // B_LIST_BACKGROUND_COLOR
- {153, 153, 153, 255}, // B_LIST_SELECTED_BACKGROUND_COLOR
+ {190, 190, 190, 255}, // B_LIST_SELECTED_BACKGROUND_COLOR
{0, 0, 0, 255}, // B_LIST_ITEM_TEXT_COLOR
{0, 0, 0, 255}, // B_LIST_SELECTED_ITEM_TEXT_COLOR
{216, 216, 216, 255}, // B_SCROLL_BAR_THUMB_COLOR

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

Revision: hrev49144
Commit: d54a4f43ccb59bb0b9d5cc980e9cb7b2dab5a322
URL: http://cgit.haiku-os.org/haiku/commit/?id=d54a4f43ccb5
Author: Janus <janus2@xxxxxxxxx>
Date: Sun May 3 17:25:07 2015 UTC

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

BColumListView: uses system colors.

* Partialy fixes #10840.

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

diff --git a/src/kits/interface/ColumnListView.cpp
b/src/kits/interface/ColumnListView.cpp
index a93991f..bc28cc8 100644
--- a/src/kits/interface/ColumnListView.cpp
+++ b/src/kits/interface/ColumnListView.cpp
@@ -133,23 +133,6 @@ static const float kTitleSpacing = 1.4;
static const float kRowSpacing = 1.4;
static const float kLatchWidth = 15.0;

-
-static const rgb_color kColor[B_COLOR_TOTAL] =
-{
- {255, 255, 255, 255}, // B_COLOR_BACKGROUND
- { 0, 0, 0, 255}, // B_COLOR_TEXT
- {148, 148, 148, 255}, // B_COLOR_ROW_DIVIDER
- {190, 190, 190, 255}, // B_COLOR_SELECTION
- { 0, 0, 0, 255}, // B_COLOR_SELECTION_TEXT
- {200, 200, 200, 255}, // B_COLOR_NON_FOCUS_SELECTION
- {180, 180, 180, 180}, // B_COLOR_EDIT_BACKGROUND
- { 0, 0, 0, 255}, // B_COLOR_EDIT_TEXT
- {215, 215, 215, 255}, // B_COLOR_HEADER_BACKGROUND
- { 0, 0, 0, 255}, // B_COLOR_HEADER_TEXT
- { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_LINE
- { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_BORDER
-};
-
static const int32 kMaxDepth = 1024;
static const float kLeftMargin = kLatchWidth;
static const float kRightMargin = 8;
@@ -2053,8 +2036,32 @@ BColumnListView::_Init()
if (bounds.Height() <= 0)
bounds.bottom = 100;

- for (int i = 0; i < (int)B_COLOR_TOTAL; i++)
- fColorList[i] = kColor[i];
+ fColorList[B_COLOR_BACKGROUND] = ui_color(B_LIST_BACKGROUND_COLOR);
+ fColorList[B_COLOR_TEXT] = ui_color(B_LIST_ITEM_TEXT_COLOR);
+ fColorList[B_COLOR_ROW_DIVIDER] = tint_color(
+ ui_color(B_LIST_SELECTED_BACKGROUND_COLOR), B_DARKEN_2_TINT);
+ fColorList[B_COLOR_SELECTION] =
ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
+ fColorList[B_COLOR_SELECTION_TEXT] =
+ ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR);
+
+ // For non focus selection uses the selection color as BListView
+ fColorList[B_COLOR_NON_FOCUS_SELECTION] =
+ ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
+
+ // edit mode doesn't work very well
+ fColorList[B_COLOR_EDIT_BACKGROUND] = tint_color(
+ ui_color(B_LIST_SELECTED_BACKGROUND_COLOR), B_DARKEN_1_TINT);
+ fColorList[B_COLOR_EDIT_BACKGROUND].alpha = 180;
+
+ // Unused color
+ fColorList[B_COLOR_EDIT_TEXT] =
ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR);
+
+ fColorList[B_COLOR_HEADER_BACKGROUND] =
ui_color(B_PANEL_BACKGROUND_COLOR);
+ fColorList[B_COLOR_HEADER_TEXT] = ui_color(B_PANEL_TEXT_COLOR);
+
+ // Unused colors
+ fColorList[B_COLOR_SEPARATOR_LINE] = ui_color(B_LIST_ITEM_TEXT_COLOR);
+ fColorList[B_COLOR_SEPARATOR_BORDER] = ui_color(B_LIST_ITEM_TEXT_COLOR);

BRect titleRect;
BRect outlineRect;


Other related posts: