BToolBar: Use MENU_BACKGROUND color, and leave buttons with default.

Toolbars go with menu bars, and so to blend in better with them,
should use the same colors. (Under the default color schemes,
the menu bar and panel colors are the same, so this makes no
visible difference there.)

Added a TODO for button colors as we may want to do something different
for that, it also makes no difference with the default scheme, but
for non-default schemes may matter.

Improves #19629.
This commit is contained in:
Augustin Cavalier
2025-06-24 14:48:30 -04:00
parent 92261f367f
commit 1ad882a7ec
2 changed files with 13 additions and 8 deletions
+11 -7
View File
@@ -15,7 +15,7 @@ namespace BPrivate {
// Button to adopt backgrond color of toolbar
//! Button to adopt background color of BToolBar
class ToolBarButton : public BButton {
public:
ToolBarButton(const char* name, const char* label,
@@ -29,23 +29,23 @@ ToolBarButton::ToolBarButton(const char* name, const char* label,
BMessage* message)
:
BButton(name, label, message)
{}
{
}
void
ToolBarButton::AttachedToWindow()
{
BButton::AttachedToWindow();
SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
// have to remove the darkening caused by BButton's drawing
// TODO: Should we force Control, Menu, or parent colors here?
}
//# pragma mark -
// # pragma mark -
class LockableButton: public ToolBarButton {
class LockableButton : public ToolBarButton {
public:
LockableButton(const char* name, const char* label,
BMessage* message);
@@ -220,6 +220,7 @@ BToolBar::FindButton(uint32 command) const
// #pragma mark - Private methods
void
BToolBar::Pulse()
{
@@ -247,6 +248,9 @@ BToolBar::_Init()
GroupLayout()->SetSpacing(1);
SetFlags(Flags() | B_FRAME_EVENTS | B_PULSE_NEEDED);
SetLowUIColor(B_MENU_BACKGROUND_COLOR);
SetViewUIColor(B_MENU_BACKGROUND_COLOR);
}
+2 -1
View File
@@ -73,7 +73,6 @@ BNavigator::BNavigator(const Model* model)
// Needed to draw the bottom border
SetFlags(Flags() | B_WILL_DRAW);
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
@@ -85,6 +84,8 @@ BNavigator::~BNavigator()
void
BNavigator::AttachedToWindow()
{
BToolBar::AttachedToWindow();
const BRect iconRect(BPoint(0, 0),
be_control_look->ComposeIconSize(20));