make colours used by list and tree controls more consistent with the system theme settings; also use the correct colour for the status bar (closes #10089)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@57542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-25 13:03:24 +00:00
parent 37cfa1218a
commit cc05060c18
10 changed files with 42 additions and 5 deletions

View File

@@ -145,6 +145,8 @@ wxMSW/CE:
wxGTK:
- Fixed printing to use fonts sizes adjustment consistent with wxMSW.
- Make colours used by list, tree and status bar controls more consistent with
the system theme settings (Tim Kosse).
2.8.9
-----

View File

@@ -79,6 +79,7 @@ enum wxSystemColour
wxSYS_COLOUR_GRADIENTINACTIVECAPTION,
wxSYS_COLOUR_MENUHILIGHT,
wxSYS_COLOUR_MENUBAR,
wxSYS_COLOUR_LISTBOXTEXT,
wxSYS_COLOUR_MAX
};

View File

@@ -5765,7 +5765,7 @@ wxGenericListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
#else
wxUnusedVar(variant);
wxVisualAttributes attr;
attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
return attr;

View File

@@ -194,6 +194,7 @@ void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
wxPaintDC dc(this);
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
#ifdef __WXGTK20__
// Draw grip first
if (HasFlag( wxST_SIZEGRIP ))

View File

@@ -3619,7 +3619,7 @@ wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
return wxListBox::GetClassDefaultAttributes(variant);
#else
wxVisualAttributes attr;
attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
return attr;

View File

@@ -47,7 +47,8 @@ struct wxSystemObjects
m_colMenuItemHighlight,
m_colTooltip,
m_colTooltipText,
m_colMenubarBg;
m_colMenubarBg,
m_colListBoxText;
wxFont m_fontSystem;
};
@@ -68,6 +69,7 @@ void wxClearGtkSystemObjects()
gs_objects.m_colTooltipText = wxColour();
gs_objects.m_colMenubarBg = wxColour();
gs_objects.m_fontSystem = wxNullFont;
gs_objects.m_colListBoxText = wxColour();
}
// ----------------------------------------------------------------------------
@@ -89,7 +91,8 @@ enum wxGtkColourType
{
wxGTK_FG,
wxGTK_BG,
wxGTK_BASE
wxGTK_BASE,
wxGTK_TEXT
};
// wxSystemSettings::GetColour() helper: get the colours from a GTK+
@@ -152,6 +155,10 @@ static bool GetColourFromGTKWidget(GdkColor& gdkColor,
case wxGTK_BASE:
gdkColor = def->base[state];
break;
case wxGTK_TEXT:
gdkColor = def->text[state];
break;
}
}
@@ -282,6 +289,24 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
color = gs_objects.m_colListBox;
break;
case wxSYS_COLOUR_LISTBOXTEXT:
if (!gs_objects.m_colListBoxText.Ok())
{
if ( GetColourFromGTKWidget(gdkColor,
wxGTK_LIST,
GTK_STATE_NORMAL,
wxGTK_TEXT) )
{
gs_objects.m_colListBoxText = wxColour(gdkColor);
}
else
{
gs_objects.m_colListBoxText = GetColour(wxSYS_COLOUR_WINDOWTEXT);
}
}
color = gs_objects.m_colListBoxText;
break;
case wxSYS_COLOUR_MENUTEXT:
case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_CAPTIONTEXT:

View File

@@ -250,6 +250,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
case wxSYS_COLOUR_CAPTIONTEXT:
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_BTNTEXT:
case wxSYS_COLOUR_LISTBOXTEXT:
if (!gs_objects.m_colBtnText.Ok())
{
int red, green, blue;

View File

@@ -75,6 +75,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
case wxSYS_COLOUR_CAPTIONTEXT:
case wxSYS_COLOUR_INFOTEXT:
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_LISTBOXTEXT:
resultColor = *wxBLACK;
break ;

View File

@@ -70,6 +70,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
case wxSYS_COLOUR_CAPTIONTEXT:
case wxSYS_COLOUR_INFOTEXT:
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_LISTBOXTEXT:
return *wxBLACK;
break ;
case wxSYS_COLOUR_HIGHLIGHT:

View File

@@ -127,7 +127,12 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
0, // MENUBAR (unused)
};
if ( index == wxSYS_COLOUR_LISTBOX )
if ( index == wxSYS_COLOUR_LISTBOXTEXT)
{
// there is no standard colour with this index, map to another one
index = wxSYS_COLOUR_WINDOWTEXT;
}
else if ( index == wxSYS_COLOUR_LISTBOX )
{
// there is no standard colour with this index, map to another one
index = wxSYS_COLOUR_WINDOW;