Use theme-appropriate default colour in wxFontPickerCtrl
Don't hardcode black as the default font colour, as this can be unreadable in dark mode. Also update the unit test to not always expect the initial colour to be black.
This commit is contained in:
parent
0658dd7d15
commit
78839714a5
2 changed files with 6 additions and 3 deletions
|
|
@ -22,6 +22,10 @@
|
|||
|
||||
#if wxUSE_FONTPICKERCTRL
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/settings.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/fontpicker.h"
|
||||
|
||||
#include "wx/fontdlg.h"
|
||||
|
|
@ -68,7 +72,7 @@ bool wxGenericFontButton::Create( wxWindow *parent, wxWindowID id,
|
|||
void wxGenericFontButton::InitFontData()
|
||||
{
|
||||
m_data.SetAllowSymbols(true);
|
||||
m_data.SetColour(*wxBLACK);
|
||||
m_data.SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
|
||||
m_data.EnableEffects(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,8 +208,7 @@ void FontPickerCtrlTestCase::ColourSelection()
|
|||
{
|
||||
wxColour selectedColour(0xFF4269UL);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("Default font picker color must be black",
|
||||
m_font->GetSelectedColour(), wxColour(*wxBLACK));
|
||||
CHECK( m_font->GetSelectedColour() != selectedColour );
|
||||
|
||||
m_font->SetSelectedColour(selectedColour);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue