From 1ad882a7ecf5381fcb8df4010ab18af8445e7fc9 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 24 Jun 2025 14:48:30 -0400 Subject: [PATCH] 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. --- src/kits/shared/ToolBar.cpp | 18 +++++++++++------- src/kits/tracker/Navigator.cpp | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/kits/shared/ToolBar.cpp b/src/kits/shared/ToolBar.cpp index 7d01485dd3..eefe50f341 100644 --- a/src/kits/shared/ToolBar.cpp +++ b/src/kits/shared/ToolBar.cpp @@ -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); } diff --git a/src/kits/tracker/Navigator.cpp b/src/kits/tracker/Navigator.cpp index fe9f0ee466..94ee60805b 100644 --- a/src/kits/tracker/Navigator.cpp +++ b/src/kits/tracker/Navigator.cpp @@ -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));