MSW: Toolbar button widths aren't automatically shrink after deleting (Issue #26127)

18 views
Skip to first unread message

0tkl

unread,
Jan 28, 2026, 12:36:10 PMJan 28
to wx-...@googlegroups.com, Subscribed
0tkl created an issue (wxWidgets/wxWidgets#26127)

Bug description:

(Migrated from the comments of #26124) On MSW, the widest button determines the width of the other buttons on the toolbar. However, when the widest button in the toolbar is removed abd none of the remaining buttons can maintain the same width, the width of toolbar buttons does not automatically shrink.

Expected vs observed behaviour:

Expected Observed
image.png (view on web) image.png (view on web)

To Reproduce:

  1. Build and run the toolbar sample.
  2. Click "Tools > Insert print button".
  3. (Because the new button's text is long, all other buttons will be stretched wider.)
  4. Then, click "Tools > Delete print button".

Platform and version information

  • wxWidgets version you use: master
  • wxWidgets port you use: wxMSW
  • OS and its version: Windows 11 25H2


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26127@github.com>

VZ

unread,
Feb 18, 2026, 12:06:13 PMFeb 18
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26127)

We probably could fix this by just calling Realize() in wxToolBar::DoDeleteTool(). And it might be not even worth checking if it needs to be done, i.e. if the tool being deleted is really the widest one, as deleting tools is something done pretty rarely, so it's not worth optimizing this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26127/3922019866@github.com>

Reply all
Reply to author
Forward
0 new messages