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.88k stars 671 forks source link

TitleBgActive and DockingEmptyBg not binding. #1751

Open cash44 opened 2 years ago

cash44 commented 2 years ago

Version of Dear PyGui

Version: 1.5.1 & 1.6.1 Operating System: Windows 10, Ubuntu 22.04

My Issue/Question

TitleBgActive does not bind color to docked windows. When window is not docked, the color does apply as set in the theme settings, but when window is docked to a viewport or other window the color changes back to the default color.

DockingEmptyBg does not change color. It keeps the default dark grey color.

Changing TitleBgActive or DockingEmptyBg with style editor does work, but not when I bind the colors to the theme.

To Reproduce

Steps to reproduce the behavior:

  1. Run the example code below.
  2. For TitleBgActive dock a window to a viewport or other window.
  3. For DockingEmptyBg color does not change.

Expected behavior

TitleBgActive apply color to docked windows. DockingEmptyBg change background color.

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.theme() as theme:
    with dpg.theme_component(dpg.mvAll):

        # Works if a window is not docked, when window is docked goes back to the default color.
        dpg.add_theme_color(dpg.mvThemeCol_TitleBgActive, (255, 199, 46), category=dpg.mvThemeCat_Core)

        # Not changing color.
        dpg.add_theme_color(dpg.mvThemeCol_DockingEmptyBg, (255, 199, 46), category=dpg.mvThemeCat_Core)

        # Works fine:
        dpg.add_theme_color(dpg.mvThemeCol_DockingPreview, (255, 199, 46), category=dpg.mvThemeCat_Core)
        dpg.add_theme_color(dpg.mvThemeCol_TabActive, (0, 232, 35), category=dpg.mvThemeCat_Core)
        dpg.add_theme_color(dpg.mvThemeCol_TabUnfocusedActive, (0, 97, 15), category=dpg.mvThemeCat_Core)

dpg.create_viewport(title='Test', width=800, height=800)

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

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

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

# Changing TitleBgActive or DockingEmptyBg with style editor works, but not when I bind the theme.
dpg.show_style_editor()

dpg.configure_app(docking=True, docking_space=True)
dpg.bind_theme(theme)

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
hoffstadt commented 2 years ago

Confirmed. Looking into it.

yhyu13 commented 2 years ago

Just re-affirm that v1.6.2 has this bug, too

yhyu13 commented 2 years ago

@hoffstadt Is this problem caused by some docking theme propagation? It seems other title theme colors work fine.

an4ouce commented 1 year ago

Version 1.7.0 has this bug too

L-Nafaryus commented 9 months ago

Version 1.10.0 still has the same bug

bmrv911 commented 1 month ago

Version 1.11.1 still has the same bug.