Skip to content

Good to have Button/Text/Selectable with each line centered #9416

@tpecholt

Description

@tpecholt

Version/Branch of Dear ImGui:

1.92.8 docking

Back-ends:

imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp

Compiler, OS:

Windows11 + MSVC 2022

Full config/build information:

No response

Details:

ImGui already allows Button/Text/TextAligned/Selectable with multiple lines of text delimited by '\n'. But horizontal centering is not correct. It needs to calculate width of each line and center it separately. This doesn't seem like a big change since it is already breaking the lines. It would allow rendering buttons with both label and icons on separate lines and that is useful to have:

Image

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions