hoffstadt / hoffstadt/DearPyGui

Ability to customize styles for Ctrl-Tab panel and other built-in ImGui windows

Open
#2,312 4 comments 0 reactions 0 assignees View on GitHub
state: pending type: improvement
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
DPG themes provide a nice mechanism to customize look & feel both on individual widgets and on the whole app. Unfortunately the themes are only applied when DPG itself renders widgets. There are things that Dear ImGui renders on its own, and at that moment even the theme passed in `bind_theme` is not applied.

This includes the window switching panel that appears when you press Ctrl-Tab (currently you need `keyboard_navigation=True` for this to work; #2275 will make this independent of `keyboard_navigation`). The window is not affected by `bind_theme` and may look significantly different from the rest of UI. It also includes the shadows and the frame this switching mechanism draws around the current window.

Other elements not affected by `bind_theme` are:
- tool windows like `show_style_editor` - though for these, it might make sense to leave them unaffected? (like, the item registry window uses a hardcoded purple color that looks good in the default dark theme, but might be unreadable if the theme is changed to the light one).
- `show_imgui_demo()` - for this one, it doesn't matter much whether we style it or not.
- something else I missed?

So my primary concern is that Ctrl-Tab panel. It would be great to have `bind_theme` affect this panel but **not** tool windows; if tool windows can't be left with their own style, so be it, we can sacrifice them.

Within the Ctrl-Tab panel, the thing that mostly stands out is selection color - when your entire app uses blue for selected items, it's hard to see the dark-grey-on-black selection in that panel.

**Describe the solution you'd like**
The easiest (in terms of API) would be to have `bind_theme` modify ImGui styles globally and never pop its changes back. This, however, might need some changes in how themes apply their styles (change push/pop to direct assignment for the global theme).

**Describe alternatives you've considered**
None. Well, one could handle Ctrl-Tab on their own and render the switcher using DPG... but that doesn't sound sane.

**Additional context**
![image](https://github.com/hoffstadt/DearPyGui/assets/104593001/ba410cdc-7cb3-47a4-b604-fbb359cc99c4)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.