Skip to content

wxAuiToolBar should update packing/padding/margins on DPI change on MSW #26076

Closed

Description

@dsa-t

Description

wxAuiToolBar::Create contains initialization of some packing/padding/margins values which are not updated on DPI change. Would be great to have them updated on DPI change.

m_toolPacking = FromDIP(2);
m_toolBorderPadding = FromDIP(3);
m_gripperVisible = (style & wxAUI_TB_GRIPPER) ? true : false;
m_overflowVisible = (style & wxAUI_TB_OVERFLOW) ? true : false;
m_orientation = GetOrientation(style);
if (m_orientation == wxBOTH)
{
m_orientation = wxHORIZONTAL;
}
wxSize margin_lt = FromDIP(wxSize(5, 5));
wxSize margin_rb = FromDIP(wxSize(2, 2));

Probably needs some flags to detect if user calls SetToolPacking/SetToolBorderPadding/SetMargins to disable these automatic updates.

This only matters on MSW.

Platform and version information

  • wxWidgets version you use: master (3.3)
  • wxWidgets port you use: wxMSW
  • OS and its version: Windows 11

Activity

  1. vadz commented on Jan 7, 2026

    @vadz
    Contributor

    I think we should do the same thing as we did in 0e7420f (Fix per-monitor DPI handling of wxAuiToolBarArt element sizes, 2025-02-24) and 43b55cf (Avoid scaling small metrics by DPI in wxAuiDockArt, 2025-02-22), i.e. just store these values in DIPs and apply FromDIP() when using them.

    The only problem is that SetToolPacking() and SetMargins() would need to use ToDIP() to remain compatible which is a bit weird, but I guess not that much of a problem in practice.

  2. added this to the 3.3.2 milestone on Jan 25, 2026
  3. self-assigned this
    on Feb 23, 2026
  4. added a commit that references this issue on Feb 23, 2026
    ac1f286
  5. vadz commented on Feb 23, 2026

    @vadz
    Contributor

    AFAICS this is as simple as #26235, please let me know if you (still) see any problems with it.

  6. added a commit that references this issue on Feb 24, 2026
    5d0281e
  7. added a commit that references this issue on Apr 7, 2026
    c62c7e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions