hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.62k stars 669 forks source link

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

Open v-ein opened 3 months ago

v-ein commented 3 months ago

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:

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