[Git][wxwidgets/wxwidgets][master] OSX iOS support stretchable space in toolbar (#25908)

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Oct 21, 2025, 4:24:22 PMOct 21
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 2e2cdfac
    by Stefan Csomor at 2025-10-21T21:51:20+02:00
    OSX iOS support stretchable space in toolbar (#25908)
    
    support stretchable toolbar space on iOS by changing MakeStretchable to virtual

3 changed files:

Changes:

  • include/wx/tbarbase.h
    ... ... @@ -131,7 +131,7 @@ public:
    131 131
             return m_kind;
    
    132 132
         }
    
    133 133
     
    
    134
    -    void MakeStretchable()
    
    134
    +    virtual void MakeStretchable()
    
    135 135
         {
    
    136 136
             wxASSERT_MSG( IsSeparator(), "only separators can be stretchable" );
    
    137 137
     
    

  • src/osx/artmac.cpp
    ... ... @@ -148,7 +148,7 @@ static wxBitmapBundle wxMacArtProvider_CreateBitmapBundle(const wxArtID& id, con
    148 148
         ART_BITMAP(wxART_DELETE,         "minus.circle")
    
    149 149
     
    
    150 150
         ART_BITMAP(wxART_GO_BACK,        "arrow.backward.circle")
    
    151
    -    ART_BITMAP(wxART_GO_FORWARD,     "arrow.fordward.circle")
    
    151
    +    ART_BITMAP(wxART_GO_FORWARD,     "arrow.forward.circle")
    
    152 152
         ART_BITMAP(wxART_GO_HOME,        "house")
    
    153 153
     
    
    154 154
         ART_BITMAP(wxART_HELP_SETTINGS,  "gear.badge.questionmark")
    

  • src/osx/iphone/toolbar.mm
    ... ... @@ -85,6 +85,8 @@ public:
    85 85
             tbar->OnLeftClick( GetId(), IsToggled() );
    
    86 86
         }
    
    87 87
     
    
    88
    +    void MakeStretchable() override;
    
    89
    +
    
    88 90
         UIBarButtonItem* GetUIBarButtonItem() const {return m_toolbarItem;}
    
    89 91
     private:
    
    90 92
     
    
    ... ... @@ -94,6 +96,8 @@ private:
    94 96
             m_index = -1;
    
    95 97
         }
    
    96 98
     
    
    99
    +    void RemoveAssociation();
    
    100
    +
    
    97 101
         UIBarButtonItem* m_toolbarItem;
    
    98 102
         // position in its toolbar, -1 means not inserted
    
    99 103
         CFIndex m_index;
    
    ... ... @@ -160,6 +164,11 @@ wxToolBarTool::wxToolBarTool(wxToolBar *tbar, wxControl *control, const wxString
    160 164
     }
    
    161 165
     
    
    162 166
     wxToolBarTool::~wxToolBarTool()
    
    167
    +{
    
    168
    +    RemoveAssociation();
    
    169
    +}
    
    170
    +
    
    171
    +void wxToolBarTool::RemoveAssociation()
    
    163 172
     {
    
    164 173
         bool found = true ;
    
    165 174
         while ( found )
    
    ... ... @@ -179,6 +188,24 @@ wxToolBarTool::~wxToolBarTool()
    179 188
     }
    
    180 189
     
    
    181 190
     
    
    191
    +void wxToolBarTool::MakeStretchable()
    
    192
    +{
    
    193
    +    wxToolBarToolBase::MakeStretchable();
    
    194
    +
    
    195
    +    if ( IsSeparator() )
    
    196
    +    {
    
    197
    +        RemoveAssociation();
    
    198
    +        [m_toolbarItem release];
    
    199
    +
    
    200
    +        UIBarButtonItem* bui = [UIBarButtonItem alloc];
    
    201
    +        bui = [bui initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    
    202
    +
    
    203
    +        m_toolbarItem = bui;
    
    204
    +        wxToolBarToolList[bui] = this;
    
    205
    +    }
    
    206
    +}
    
    207
    +
    
    208
    +
    
    182 209
     wxToolBarToolBase *wxToolBar::CreateTool(
    
    183 210
                                              int id,
    
    184 211
                                              const wxString& label,
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help Notification message regarding https://gitlab.com/wxwidgets/wxwidgets/-/commit/2e2cdfacb61d1c9e3e3add98bd504c7c9aa17e9f at 1761078259

Reply all
Reply to author
Forward
0 new messages