hoffstadt / hoffstadt/DearPyGui

When docking is enabled, setting mvThemeCol_TitleBg in the code fails to take effect.

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

Description

## 2.0.2 of Dear PyGui

Version: 2.0.0
Operating System: Windows11

## When docking is enabled, setting `mvThemeCol_TitleBg` in the code fails to take effect

When docking is enabled, merging windows causes the window title background to reset to the default blue color. Even if other colors are configured via `mvThemeCol_TitleBg` or `mvThemeCol_TitleBgActive` , the title background color can be normally set through the style editor.

The related issue has been resolved by [#2700](https://github.com/ocornut/imgui/issues/2700) in ImGui.

## To Reproduce

Steps to reproduce the behavior:
1. merging windows, the window title background is reset to the default blue color
2. Modify `mvThemeCol_TitleBg` or `mvThemeCol_TitleBgActive` to set the window title
background color

## Expected behavior

After merging windows, the window title can correctly use the colors of `mvThemeCol_TitleBg` and `mvThemeCol_TitleBgActive`.

## Screenshots/Video

![Image](https://github.com/user-attachments/assets/5459e3a6-21e2-4ba6-ae89-853fed22de38)

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.configure_app(docking=True, docking_space=True)
dpg.create_viewport(title="Custom Title", width=900, height=600)

with dpg.theme() as global_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_color(dpg.mvThemeCol_TitleBg, (255, 0, 0, 255))
dpg.add_theme_color(dpg.mvThemeCol_TitleBgActive, (0, 255, 0, 255))
dpg.bind_theme(global_theme)

with dpg.window(label="Window 1", width=300, height=200):
dpg.add_text("window 1")
with dpg.window(label="Window 2", width=300, height=200):
dpg.add_text("window 2")

dpg.show_style_editor()

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```

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.