A table with no columns and a theme or font (however weird that sounds) puts the theme/font onto the stack but does not remove it, thus breaking styles everywhere else.
To Reproduce
Steps to reproduce the behavior:
Run the example code
Check "with columns" and show the table just to make sure everything is alright. Text in the table should be green, the word "Lorem" red, everything else white (the default color).
Uncheck "With columns" and see how colors change. Now, no matter how you show or hide the table, the default white color never comes back because the stack always contains the table theme at its head.
Expected behavior
The table must not affect styling on widgets outside of it.
Screenshots/Video
Standalone, minimal, complete and verifiable example
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title="Test", width=500, height=400)
dpg.setup_dearpygui()
with dpg.window(pos=(100, 100), width=350, height=200, no_title_bar=False):
# This theme makes text green
with dpg.theme() as table_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_color(dpg.mvThemeCol_Text, (0, 255, 0), category=dpg.mvThemeCat_Core)
# This theme makes text red
with dpg.theme() as another_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 0, 0), category=dpg.mvThemeCat_Core)
def manage_columns(_, checked):
if checked:
dpg.add_table_column(parent="test-table")
else:
dpg.delete_item("test-table", children_only=True, slot=0)
dpg.add_checkbox(label="With columns", default_value=False, callback=manage_columns)
dpg.add_checkbox(label="Show table", default_value=False, callback=lambda _, checked: dpg.configure_item("test-table", show=checked))
with dpg.table(tag="test-table", show=False):
dpg.bind_item_theme(dpg.last_item(), table_theme)
with dpg.table_row():
dpg.add_text("Cell")
dpg.add_text("Lorem")
dpg.bind_item_theme(dpg.last_item(), another_theme)
dpg.add_text("ipsum")
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Version of Dear PyGui
Version: 1.9.0 Operating System: Windows 10
My Issue/Question
A table with no columns and a theme or font (however weird that sounds) puts the theme/font onto the stack but does not remove it, thus breaking styles everywhere else.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The table must not affect styling on widgets outside of it.
Screenshots/Video
Standalone, minimal, complete and verifiable example