From 61a712823062ebd7625f3791c8fcf113934ba008 Mon Sep 17 00:00:00 2001
From: Humdinger <humdingerb@gmail.com>
Date: Sun, 17 Sep 2017 10:09:26 +0200
Subject: [PATCH] BCalendarView: use bold for 'today'
Only Using the keyboard navigation colour to indicate the current day isn't
that nice in all situations. When using custom system colours, like white on
blue for selected items, it can become barely readable.
Let's use bold type face for the current day, and keyboard navigation colour
only when 'today' isn't selected.
Fixes #13714
---
src/kits/shared/CalendarView.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/kits/shared/CalendarView.cpp b/src/kits/shared/CalendarView.cpp
index 7bb0c86..c206f26 100644
a
|
b
|
BCalendarView::_DrawItem(BView* owner, BRect frame, const char* text,
|
1115 | 1115 | if (textColor.red + textColor.green + textColor.blue > 125 * 3) |
1116 | 1116 | tintDisabled = B_DARKEN_2_TINT; |
1117 | 1117 | |
| 1118 | if (isHighlight) |
| 1119 | textColor = keyboard_navigation_color(); |
| 1120 | |
1118 | 1121 | if (isSelected) { |
1119 | 1122 | SetHighColor(ui_color(B_LIST_SELECTED_BACKGROUND_COLOR)); |
1120 | 1123 | textColor = ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR); |
1121 | 1124 | } else |
1122 | 1125 | SetHighColor(ui_color(B_LIST_BACKGROUND_COLOR)); |
1123 | 1126 | |
1124 | | if (isHighlight) { |
1125 | | textColor = keyboard_navigation_color(); |
1126 | | } |
1127 | | |
1128 | 1127 | SetLowColor(HighColor()); |
1129 | 1128 | |
1130 | 1129 | FillRect(frame.InsetByCopy(1.0, 1.0)); |
… |
… |
BCalendarView::_DrawItem(BView* owner, BRect frame, const char* text,
|
1141 | 1140 | float offsetH = frame.Width() / 2.0; |
1142 | 1141 | float offsetV = frame.Height() / 2.0 + FontHeight(owner) / 2.0 - 2.0; |
1143 | 1142 | |
| 1143 | BFont font(be_plain_font); |
| 1144 | if (isHighlight) |
| 1145 | font.SetFace(B_BOLD_FACE); |
| 1146 | else |
| 1147 | font.SetFace(B_REGULAR_FACE); |
| 1148 | SetFont(&font); |
| 1149 | |
1144 | 1150 | DrawString(text, BPoint(frame.right - offsetH - StringWidth(text) / 2.0, |
1145 | 1151 | frame.top + offsetV)); |
1146 | 1152 | |