Revert "Fix invisible captions in high contrast mode"
This reverts commit 71dfb3b414
which fixed
appearance of the captions in high contrast mode but broke them for wxGTK.
Ideal would be to make this code work in wxGTK too or, in the worst, case only
use this code for wxMSW, but for now at least avoid breaking wxGTK appearance
by default.
See #16186.
This commit is contained in:
parent
e953447ae9
commit
2543c336b0
@ -234,7 +234,6 @@ All (GUI):
|
||||
- Fix a crash when using animated GIFs in wxHtmlListBox.
|
||||
- Use platform-specific stock icons for wxEditableListBox buttons.
|
||||
- Add support for the events from multimedia keys (Jens Göpfert).
|
||||
- Improve wxAUI appearance in high contrast themes (Zane U. Ji).
|
||||
- Allow suppressing warnings from wxImage::LoadFile().
|
||||
- Allow customizing wxRibbon highlight colours (wxBen).
|
||||
|
||||
|
@ -289,8 +289,6 @@ protected:
|
||||
wxFont m_normalFont;
|
||||
wxFont m_selectedFont;
|
||||
wxFont m_measuringFont;
|
||||
wxColour m_normalTextColour;
|
||||
wxColour m_selectedTextColour;
|
||||
wxPen m_normalBkPen;
|
||||
wxPen m_selectedBkPen;
|
||||
wxBrush m_normalBkBrush;
|
||||
|
@ -172,21 +172,26 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
|
||||
}
|
||||
|
||||
m_baseColour = baseColour;
|
||||
wxColor darker1Colour = baseColour.ChangeLightness(85);
|
||||
wxColor darker2Colour = baseColour.ChangeLightness(75);
|
||||
wxColor darker3Colour = baseColour.ChangeLightness(60);
|
||||
//wxColor darker4Colour = baseColour.ChangeLightness(50);
|
||||
wxColor darker5Colour = baseColour.ChangeLightness(40);
|
||||
|
||||
m_activeCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION);
|
||||
m_activeCaptionGradientColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRADIENTACTIVECAPTION);
|
||||
m_activeCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT);
|
||||
m_inactiveCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTION);
|
||||
m_inactiveCaptionGradientColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRADIENTINACTIVECAPTION);
|
||||
m_inactiveCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTIONTEXT);
|
||||
m_activeCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
|
||||
m_activeCaptionGradientColour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
|
||||
m_activeCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
|
||||
m_inactiveCaptionColour = darker1Colour;
|
||||
m_inactiveCaptionGradientColour = baseColour.ChangeLightness(97);
|
||||
m_inactiveCaptionTextColour = *wxBLACK;
|
||||
|
||||
m_sashBrush = wxBrush(baseColour);
|
||||
m_backgroundBrush = wxBrush(baseColour);
|
||||
m_gripperBrush = wxBrush(baseColour);
|
||||
|
||||
m_borderPen = wxPen(baseColour.ChangeLightness(75));
|
||||
m_gripperPen1 = wxPen(baseColour.ChangeLightness(40));
|
||||
m_gripperPen2 = wxPen(baseColour.ChangeLightness(60));
|
||||
m_borderPen = wxPen(darker2Colour);
|
||||
m_gripperPen1 = wxPen(darker5Colour);
|
||||
m_gripperPen2 = wxPen(darker3Colour);
|
||||
m_gripperPen3 = *wxWHITE_PEN;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
@ -74,11 +74,6 @@ wxBitmap wxAuiBitmapFromBits(const unsigned char bits[], int w, int h,
|
||||
|
||||
wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size);
|
||||
|
||||
inline bool IsDarkColour(const wxColour& c)
|
||||
{
|
||||
return (c.Red() + c.Green() + c.Blue()) * c.Alpha() * 2 < 3 * 255 * 255;
|
||||
}
|
||||
|
||||
static void DrawButtons(wxDC& dc,
|
||||
const wxRect& _rect,
|
||||
const wxBitmap& bmp,
|
||||
@ -421,7 +416,6 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
int drawn_tab_height = border_points[0].y - border_points[1].y;
|
||||
|
||||
|
||||
wxColour text_colour;
|
||||
if (page.active)
|
||||
{
|
||||
// draw active tab
|
||||
@ -437,8 +431,6 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
dc.SetBrush(*wxWHITE_BRUSH);
|
||||
dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height-4);
|
||||
|
||||
text_colour = *wxBLACK;
|
||||
|
||||
// these two points help the rounded corners appear more antialiased
|
||||
dc.SetPen(wxPen(m_activeColour));
|
||||
dc.DrawPoint(r.x+2, r.y+1);
|
||||
@ -472,11 +464,9 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
r.height--;
|
||||
|
||||
// -- draw top gradient fill for glossy look
|
||||
wxColor top_color = m_baseColour.ChangeLightness(160);
|
||||
wxColor bottom_color = m_baseColour;
|
||||
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
|
||||
|
||||
text_colour = IsDarkColour(bottom_color) ? *wxWHITE : *wxBLACK;
|
||||
wxColor top_color = m_baseColour;
|
||||
wxColor bottom_color = top_color.ChangeLightness(160);
|
||||
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
||||
|
||||
r.y += r.height;
|
||||
r.y--;
|
||||
@ -542,7 +532,6 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
tab_width - (text_offset-tab_x) - close_button_width);
|
||||
|
||||
// draw tab text
|
||||
dc.SetTextForeground(text_colour);
|
||||
dc.DrawText(draw_text,
|
||||
text_offset,
|
||||
drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1);
|
||||
@ -874,9 +863,6 @@ wxAuiSimpleTabArt::wxAuiSimpleTabArt()
|
||||
wxColour normaltabColour = baseColour;
|
||||
wxColour selectedtabColour = *wxWHITE;
|
||||
|
||||
m_normalTextColour = IsDarkColour(baseColour) ? *wxWHITE : *wxBLACK;
|
||||
m_selectedTextColour = *wxBLACK;
|
||||
|
||||
m_bkBrush = wxBrush(backgroundColour);
|
||||
m_normalBkBrush = wxBrush(normaltabColour);
|
||||
m_normalBkPen = wxPen(normaltabColour);
|
||||
@ -1098,7 +1084,6 @@ void wxAuiSimpleTabArt::DrawTab(wxDC& dc,
|
||||
tab_width - (text_offset-tab_x) - close_button_width);
|
||||
|
||||
// draw tab text
|
||||
dc.SetTextForeground(page.active ? m_selectedTextColour : m_normalTextColour);
|
||||
dc.DrawText(draw_text,
|
||||
text_offset,
|
||||
(tab_y + tab_height)/2 - (texty/2) + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user