Skip to content

Commit

Permalink
Fix toggle button in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Sep 15, 2023
1 parent 7f9cd25 commit e2b0675
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/ribbon/artmetro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ Adaptation of ribbon art provider by user "iwbnwif" from:
#ifdef __WXMSW__
#include <wx/msw/private.h>
#endif
#include "../../base/colorbrewer.h"

using namespace Wisteria::UI;
using namespace Wisteria::GraphItems;
using namespace Wisteria::Icons;
using namespace Wisteria::Colors;

RibbonMetroArtProvider::RibbonMetroArtProvider(bool set_colour_scheme) :
wxRibbonMSWArtProvider (set_colour_scheme)
Expand Down Expand Up @@ -902,8 +904,13 @@ void RibbonMetroArtProvider::DrawButtonBarButtonForeground(
const wxBitmap& bitmap_large,
const wxBitmap& bitmap_small)
{
const wxColour paintingColour = (state & wxRIBBON_BUTTONBAR_BUTTON_HOVER_MASK) ?
wxColour paintingColour = (state & wxRIBBON_BUTTONBAR_BUTTON_HOVER_MASK) ?
m_tab_highlight_colour : m_button_bar_label_colour;

if (state & wxRIBBON_BUTTONBAR_BUTTON_TOGGLED)
{
paintingColour = Colors::ColorContrast::BlackOrWhiteContrast(m_page_toggle_face_colour);
}
wxDCTextColourChanger cc(dc, paintingColour);

switch (state & wxRIBBON_BUTTONBAR_BUTTON_SIZE_MASK)
Expand Down

0 comments on commit e2b0675

Please sign in to comment.