Skip to content

Commit dbc206d

Browse files
v-einhoffstadt
authored andcommitted
fix (mvThemeComponent): There's no use for assiging _specificComponentPtr on type==All components.
This change both fixes an inefficiency (sometimes leading to errors) and simplifies the code. With this change, all_item_theme_component becomes useless, too.
1 parent ca34920 commit dbc206d

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/mvThemes.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void mvTheme::push_theme_components()
6767
}
6868

6969
}
70-
if (comp->_specificType != _specificType)
70+
else
7171
{
7272
if (_specificEnabled == comp->_specificEnabled)
7373
{
@@ -96,7 +96,7 @@ void mvTheme::pop_theme_components()
9696
comp->pop_theme_items();
9797
}
9898
}
99-
if (comp->_specificType != _specificType)
99+
else
100100
{
101101
if (_specificEnabled == comp->_specificEnabled)
102102
{
@@ -305,8 +305,6 @@ void mvThemeComponent::pop_theme_items()
305305

306306
void mvThemeComponent::handleSpecificPositionalArgs(PyObject* dict)
307307
{
308-
static std::shared_ptr<mvThemeComponent> all_item_theme_component = nullptr;
309-
310308
if (!VerifyPositionalArguments(GetParsers()[GetEntityCommand(type)], dict))
311309
return;
312310

@@ -320,13 +318,6 @@ void mvThemeComponent::handleSpecificPositionalArgs(PyObject* dict)
320318
_specificType = ToInt(item);
321319
_specificComponentPtr = &DearPyGui::GetClassThemeComponent((mvAppItemType)_specificType);
322320
_specificDisabledComponentPtr = &DearPyGui::GetDisabledClassThemeComponent((mvAppItemType)_specificType);
323-
324-
if (_specificType == (int)mvAppItemType::All)
325-
{
326-
_specificComponentPtr = &all_item_theme_component;
327-
_specificDisabledComponentPtr = &all_item_theme_component;
328-
}
329-
330321
break;
331322
}
332323
default:

0 commit comments

Comments
 (0)