OSX iOS support stretchable space in toolbar (#25908) support stretchable toolbar space on iOS by changing MakeStretchable to virtual
| ... | ... | @@ -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 |
| ... | ... | @@ -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")
|
| ... | ... | @@ -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