ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
58.96k stars 10.07k forks source link

CheckBox how to use filled rect #7756

Closed blackchicken20 closed 1 month ago

blackchicken20 commented 1 month ago

Version/Branch of Dear ImGui:

Version 1.90.7, Branch: master

Back-ends:

imgui_impl_win32cpp + imgui_impl_dx11.cpp

Compiler, OS:

Windows 10 + MSVC 2019

Full config/build information:

Dear ImGui 1.90.7 WIP (19065)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1929
define: _MSVC_LANG=202002
--------------------------------
io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: imgui_impl_dx11
io.ConfigFlags: 0x00000003
 NavEnableKeyboard
 NavEnableGamepad
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000000E
 HasMouseCursors
 HasSetMousePos
 RendererHasVtxOffset
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1264.00,761.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

CheckBox how to use custom size filled rect?

like this gif.

sry,my english is poor.

Screenshots/Video:

31640133-cc00810c-b2dc-11e7-8604-560d0f63bc13

Minimal, Complete and Verifiable Example code:

No response

ocornut commented 1 month ago

This is how checkboxes used to look before 1.52, but It's currently not possible. You can easily recreate your own checkbox (e.g. #3351).

I think the ultimate aim is that we have a way to rewrite/customize some specific "symbols" (checkbox, tree node markers etc.) see https://github.com/ocornut/imgui/issues/6517#issuecomment-1596865541