DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

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

Open wuyao1997 opened this issue 6 months ago • 1 comments

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 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

Standalone, minimal, complete and verifiable example

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()

wuyao1997 avatar Jul 01 '25 09:07 wuyao1997

A duplicate of #1751 but this one gives extra info, so keeping it open.

Also #2312 might be messing things here, too.

v-ein avatar Jul 01 '25 09:07 v-ein