[Git][wxwidgets/wxwidgets][master] 3 commits: Don't use light mode colours in wxMSW toolbar when they change

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Oct 19, 2025, 10:32:31 AM (2 days ago) Oct 19
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 32e9e358
    by Vadim Zeitlin at 2025-10-19T14:46:42+02:00
    Don't use light mode colours in wxMSW toolbar when they change
    
    Ignore system colours change when using dark mode instead of switching
    to the new light mode colours when they happen to change.
    
    Closes #25892.
    
  • dc48079e
    by Vadim Zeitlin at 2025-10-19T15:55:18+02:00
    Always fully repaint wxStyledTextCtrl after abandoning painting
    
    Not doing this when using Direct2D technology under MSW results in
    flicker, while always doing it, even when using GDI, doesn't seem to
    result in any ill effects, so simplify the code by removing the check
    for wxALWAYS_NATIVE_DOUBLE_BUFFER and just doing this always.
    
    Closes #25842.
    
  • 23083720
    by Blake-Madden at 2025-10-19T15:59:16+02:00
    Fix bitmap position in wxDC::DrawLabel() in high DPI
    
    Use bitmap size in logical, not physical, pixels to position it
    correctly.
    
    Closes #25888.
    

3 changed files:

Changes:

  • src/common/dcbase.cpp
    ... ... @@ -1131,8 +1131,8 @@ void wxDC::DrawLabel(const wxString& text,
    1131 1131
         wxCoord width, height;
    
    1132 1132
         if ( bitmap.IsOk() )
    
    1133 1133
         {
    
    1134
    -        width = widthText + bitmap.GetWidth();
    
    1135
    -        height = bitmap.GetHeight();
    
    1134
    +        width = widthText + wxRound(bitmap.GetLogicalWidth());
    
    1135
    +        height = wxRound(bitmap.GetLogicalHeight());
    
    1136 1136
         }
    
    1137 1137
         else // no bitmap
    
    1138 1138
         {
    
    ... ... @@ -1175,7 +1175,7 @@ void wxDC::DrawLabel(const wxString& text,
    1175 1175
         {
    
    1176 1176
             DrawBitmap(bitmap, x, y, true /* use mask */);
    
    1177 1177
     
    
    1178
    -        wxCoord offset = bitmap.GetWidth() + 4;
    
    1178
    +        wxCoord offset = wxRound(bitmap.GetLogicalWidth()) + 4;
    
    1179 1179
             x += offset;
    
    1180 1180
             width -= offset;
    
    1181 1181
     
    

  • src/msw/toolbar.cpp
    ... ... @@ -2051,6 +2051,17 @@ void wxToolBar::SetToolPacking(int packing)
    2051 2051
     // Responds to colour changes, and passes event on to children.
    
    2052 2052
     void wxToolBar::OnSysColourChanged(wxSysColourChangedEvent& event)
    
    2053 2053
     {
    
    2054
    +    // let the event propagate further in any case
    
    2055
    +    event.Skip();
    
    2056
    +
    
    2057
    +    if ( wxMSWDarkMode::IsActive() )
    
    2058
    +    {
    
    2059
    +        // We currently don't use system colours in dark mode, although we
    
    2060
    +        // should, of course. For now at least don't switch to using light mode
    
    2061
    +        // colours.
    
    2062
    +        return;
    
    2063
    +    }
    
    2064
    +
    
    2054 2065
         if ( !UseBgCol() )
    
    2055 2066
             wxRGBToColour(m_backgroundColour, ::GetSysColor(COLOR_BTNFACE));
    
    2056 2067
     
    
    ... ... @@ -2063,9 +2074,6 @@ void wxToolBar::OnSysColourChanged(wxSysColourChangedEvent& event)
    2063 2074
         SetRows(nrows);
    
    2064 2075
     
    
    2065 2076
         Refresh();
    
    2066
    -
    
    2067
    -    // let the event propagate further
    
    2068
    -    event.Skip();
    
    2069 2077
     }
    
    2070 2078
     
    
    2071 2079
     void wxToolBar::OnMouseEvent(wxMouseEvent& event)
    

  • src/stc/ScintillaWX.cpp
    ... ... @@ -852,12 +852,10 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
    852 852
             // repaint the whole window.
    
    853 853
             stc->Refresh(false);
    
    854 854
     
    
    855
    -#if wxALWAYS_NATIVE_DOUBLE_BUFFER
    
    856
    -        // On systems using double buffering, we also need to finish the
    
    857
    -        // current paint to make sure that everything is on the screen that
    
    858
    -        // needs to be there between now and when the next paint event arrives.
    
    855
    +        // We also need to finish the current paint to make sure that
    
    856
    +        // everything is on the screen that needs to be there between now and
    
    857
    +        // when the next paint event arrives.
    
    859 858
             FullPaintDC(dc);
    
    860
    -#endif
    
    861 859
         }
    
    862 860
         paintState = notPainting;
    
    863 861
     }
    

Reply all
Reply to author
Forward
0 new messages