[Git][wxwidgets/wxwidgets][master] 3 commits: Fix outline of selection in unfocused wxTreeCtrl in wxOSX

3 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Oct 16, 2025, 7:51:16 AM (5 days ago) Oct 16
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 2ef54913
    by Robert Roebling at 2025-10-16T13:32:07+02:00
    Fix outline of selection in unfocused wxTreeCtrl in wxOSX
    
    When not having focus, the selection rectangle is light grey and then we
    have to use the standard black pen to draw over it, not the white pen
    used over the blue selection rectangle, when the control has the focus.
    
    Closes #25885.
    
  • d0fa8b4b
    by Vadim Zeitlin at 2025-10-16T13:37:29+02:00
    Revert "Fix refreshing wxAuiToolBar after stopping double buffering it"
    
    This reverts commit 386e60c246f7bf8fcf44863ff138c5b1a869f13a as
    wxAuiToolBar will use double buffering again now.
    
    See #25874.
    
  • 3acfe438
    by Vadim Zeitlin at 2025-10-16T13:38:46+02:00
    Revert "Stop using wxAutoBufferedPaintDC in wxAuiToolBar"
    
    This reverts commit 76b3738d137773348815a82da65eeddbe07c2821 to restore
    double buffering of wxAuiToolBar which is still needed after stopping to
    use native double buffering in wxMSW, see #25808.
    
    Closes #25874.
    

2 changed files:

Changes:

  • src/aui/auibar.cpp
    ... ... @@ -915,6 +915,7 @@ bool wxAuiToolBar::Create(wxWindow* parent,
    915 915
         SetExtraStyle(wxWS_EX_PROCESS_IDLE);
    
    916 916
         if (style & wxAUI_TB_HORZ_LAYOUT)
    
    917 917
             SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
    
    918
    +    SetBackgroundStyle(wxBG_STYLE_PAINT);
    
    918 919
     
    
    919 920
         return true;
    
    920 921
     }
    
    ... ... @@ -1392,7 +1393,7 @@ void wxAuiToolBar::SetToolSticky(int tool_id, bool sticky)
    1392 1393
     
    
    1393 1394
         item->m_sticky = sticky;
    
    1394 1395
     
    
    1395
    -    Refresh();
    
    1396
    +    Refresh(false);
    
    1396 1397
         Update();
    
    1397 1398
     }
    
    1398 1399
     
    
    ... ... @@ -1483,7 +1484,7 @@ void wxAuiToolBar::SetGripperVisible(bool visible)
    1483 1484
         else
    
    1484 1485
             m_windowStyle &= ~wxAUI_TB_GRIPPER;
    
    1485 1486
         Realize();
    
    1486
    -    Refresh();
    
    1487
    +    Refresh(false);
    
    1487 1488
     }
    
    1488 1489
     
    
    1489 1490
     
    
    ... ... @@ -1499,7 +1500,7 @@ void wxAuiToolBar::SetOverflowVisible(bool visible)
    1499 1500
             m_windowStyle |= wxAUI_TB_OVERFLOW;
    
    1500 1501
         else
    
    1501 1502
             m_windowStyle &= ~wxAUI_TB_OVERFLOW;
    
    1502
    -    Refresh();
    
    1503
    +    Refresh(false);
    
    1503 1504
     }
    
    1504 1505
     
    
    1505 1506
     bool wxAuiToolBar::SetFont(const wxFont& font)
    
    ... ... @@ -1548,7 +1549,7 @@ void wxAuiToolBar::SetHoverItem(wxAuiToolBarItem* pitem)
    1548 1549
     
    
    1549 1550
         if (former_hover != pitem)
    
    1550 1551
         {
    
    1551
    -        Refresh();
    
    1552
    +        Refresh(false);
    
    1552 1553
             Update();
    
    1553 1554
         }
    
    1554 1555
     }
    
    ... ... @@ -1574,7 +1575,7 @@ void wxAuiToolBar::SetPressedItem(wxAuiToolBarItem* pitem)
    1574 1575
     
    
    1575 1576
         if (former_item != pitem)
    
    1576 1577
         {
    
    1577
    -        Refresh();
    
    1578
    +        Refresh(false);
    
    1578 1579
             Update();
    
    1579 1580
         }
    
    1580 1581
     }
    
    ... ... @@ -1608,7 +1609,7 @@ void wxAuiToolBar::RefreshOverflowState()
    1608 1609
         if (overflow_state != m_overflowState)
    
    1609 1610
         {
    
    1610 1611
             m_overflowState = overflow_state;
    
    1611
    -        Refresh();
    
    1612
    +        Refresh(false);
    
    1612 1613
             Update();
    
    1613 1614
         }
    
    1614 1615
     
    
    ... ... @@ -1966,7 +1967,7 @@ bool wxAuiToolBar::Realize()
    1966 1967
             m_sizer->SetDimension(0, 0, curSize.x, curSize.y);
    
    1967 1968
         }
    
    1968 1969
     
    
    1969
    -    Refresh();
    
    1970
    +    Refresh(false);
    
    1970 1971
         return true;
    
    1971 1972
     }
    
    1972 1973
     
    
    ... ... @@ -2309,7 +2310,7 @@ void wxAuiToolBar::DoIdleUpdate()
    2309 2310
     
    
    2310 2311
         if (need_refresh)
    
    2311 2312
         {
    
    2312
    -        Refresh();
    
    2313
    +        Refresh(false);
    
    2313 2314
         }
    
    2314 2315
     }
    
    2315 2316
     
    
    ... ... @@ -2354,7 +2355,7 @@ void wxAuiToolBar::OnSize(wxSizeEvent& WXUNUSED(evt))
    2354 2355
         // We need to update the bitmap if the size has changed.
    
    2355 2356
         UpdateBackgroundBitmap(wxSize(x, y));
    
    2356 2357
     
    
    2357
    -    Refresh();
    
    2358
    +    Refresh(false);
    
    2358 2359
     
    
    2359 2360
         // idle events aren't sent while user is resizing frame (why?),
    
    2360 2361
         // but resizing toolbar here causes havoc,
    
    ... ... @@ -2488,12 +2489,14 @@ void wxAuiToolBar::UpdateBackgroundBitmap(const wxSize& size)
    2488 2489
     
    
    2489 2490
     void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt))
    
    2490 2491
     {
    
    2491
    -    wxPaintDC dc(this);
    
    2492
    +    wxAutoBufferedPaintDC dc(this);
    
    2492 2493
         wxRect cli_rect(wxPoint(0,0), GetClientSize());
    
    2493 2494
     
    
    2494 2495
     
    
    2495 2496
         bool horizontal = m_orientation == wxHORIZONTAL;
    
    2496 2497
     
    
    2498
    +    dc.DrawBitmap(m_backgroundBitmap, 0, 0);
    
    2499
    +
    
    2497 2500
         int gripperSize = m_art->GetElementSizeForWindow(wxAUI_TBART_GRIPPER_SIZE, this);
    
    2498 2501
         int overflowSize = m_art->GetElementSizeForWindow(wxAUI_TBART_OVERFLOW_SIZE, this);
    
    2499 2502
     
    
    ... ... @@ -2642,7 +2645,7 @@ void wxAuiToolBar::OnLeftDown(wxMouseEvent& evt)
    2642 2645
     
    
    2643 2646
                     int res = m_art->ShowDropDown(this, overflow_items);
    
    2644 2647
                     m_overflowState = 0;
    
    2645
    -                Refresh();
    
    2648
    +                Refresh(false);
    
    2646 2649
                     if (res != -1)
    
    2647 2650
                     {
    
    2648 2651
                         wxCommandEvent event(wxEVT_MENU, res);
    
    ... ... @@ -2745,7 +2748,7 @@ void wxAuiToolBar::OnLeftUp(wxMouseEvent& evt)
    2745 2748
                     ToggleTool(m_actionItem->m_toolId, toggle);
    
    2746 2749
     
    
    2747 2750
                     // repaint immediately
    
    2748
    -                Refresh();
    
    2751
    +                Refresh(false);
    
    2749 2752
                     Update();
    
    2750 2753
     
    
    2751 2754
                     e.SetInt(toggle);
    

  • src/generic/treectlg.cpp
    ... ... @@ -2804,7 +2804,8 @@ wxGenericTreeCtrl::PaintLevel(wxGenericTreeItem *item,
    2804 2804
             if ( item->IsSelected() )
    
    2805 2805
             {
    
    2806 2806
     #ifdef __WXMAC__
    
    2807
    -            colText = *wxWHITE;
    
    2807
    +            if (m_hasFocus)
    
    2808
    +               colText = *wxWHITE;
    
    2808 2809
     #else
    
    2809 2810
                 if (m_hasFocus)
    
    2810 2811
                     colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
    

Reply all
Reply to author
Forward
0 new messages