[haiku-development] [RFC][PATCH] Tracker ui_color() fixes

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 14 Jan 2014 14:28:23 +0100

Hi,
I did some fixes to Tracker to behave a little better with dark themes:
http://revolf.free.fr/beos/shots/shot_themes_matrix2_001.png

On the count view, I used the panel text color as should be (although
some cases like typeahead I didn't touch).

On the pose view, I originally wanted to use document colors, but since
there isn't any setting for selected text, I went for the list colors,
besides the pose view is essentially a file list anyway.

I'm attaching the patch since I'm not very confident touching Tracker
due to all the side effects... I tried make them as minimal as possible
though. And on non-themed install it should be a no-op.

François.
diff --git a/src/kits/tracker/CountView.cpp b/src/kits/tracker/CountView.cpp
index f2dbf2b..0a9985b 100644
--- a/src/kits/tracker/CountView.cpp
+++ b/src/kits/tracker/CountView.cpp
@@ -245,7 +245,7 @@ BCountView::Draw(BRect updateRect)
                SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
                        B_DARKEN_4_TINT));
        } else
-               SetHighColor(0, 0, 0);
+               SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
 
        MovePenTo(textRect.LeftBottom());
        DrawString(itemString.String());
diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
index e4b57d3..03c0a94 100644
--- a/src/kits/tracker/PoseView.cpp
+++ b/src/kits/tracker/PoseView.cpp
@@ -953,6 +953,11 @@ BPoseView::AttachedToWindow()
        if (fIsDesktopWindow)
                AddFilter(new TPoseViewFilter(this));
 
+       if (!IsDesktopWindow()) {
+               SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
+               SetViewColor(ui_color(B_LIST_BACKGROUND_COLOR));
+       }
+
        AddFilter(new ShortcutFilter(B_RETURN, B_OPTION_KEY, kOpenSelection,
                this));
                // add Option-Return as a shortcut filter because AddShortcut
diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp
index 8a63e86..51d03a0 100644
--- a/src/kits/tracker/TextWidget.cpp
+++ b/src/kits/tracker/TextWidget.cpp
@@ -533,9 +533,9 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, float, 
BPoseView* view,
                        else
                                highColor = view->DeskTextColor();
                } else if (selected && view->Window()->IsActive()) {
-                       highColor = kWhite;
+                       highColor = ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR);
                } else
-                       highColor = kBlack;
+                       highColor = ui_color(B_LIST_ITEM_TEXT_COLOR);
 
                if (clipboardMode == kMoveSelectionTo && !selected) {
                        drawView->SetDrawingMode(B_OP_ALPHA);

Other related posts: