Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: theme style target categories not working #1220 #1434

Merged
merged 1 commit into from
Nov 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions DearPyGui/src/core/AppItems/themes/mvThemeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Marvel {
{
std::vector<mvPythonDataElement> args;

AddCommonArgs(args,(CommonParserArgs)(
AddCommonArgs(args, (CommonParserArgs)(
MV_PARSER_ARG_ID |
MV_PARSER_ARG_PARENT)
);
Expand Down Expand Up @@ -221,36 +221,6 @@ namespace Marvel {
case 0:
{
_targetStyle = ToInt(item);
if (_libType == mvLibType::MV_IMGUI)
{
if (_targetStyle >= ImGuiStyleVar_COUNT || _targetStyle < 0)
{
_state.ok = false;
mvThrowPythonError(mvErrorCode::mvNone, "Style target out of range.");
MV_ITEM_REGISTRY_ERROR("Item's parent must be plot.");
}
}

else if (_libType == mvLibType::MV_IMPLOT)
{

if (_targetStyle >= ImPlotStyleVar_COUNT || _targetStyle < 0)
{
_state.ok = false;
mvThrowPythonError(mvErrorCode::mvNone, "Style target out of range.");
MV_ITEM_REGISTRY_ERROR("Item's parent must be plot.");
}
}

else if (_libType == mvLibType::MV_IMNODES)
{
if (_targetStyle >= 14 || _targetStyle < 0)
{
_state.ok = false;
mvThrowPythonError(mvErrorCode::mvNone, "Style target out of range.");
MV_ITEM_REGISTRY_ERROR("Item's parent must be plot.");
}
}
break;
}

Expand Down Expand Up @@ -309,7 +279,7 @@ namespace Marvel {
void mvThemeStyle::applySpecificTemplate(mvAppItem* item)
{
auto titem = static_cast<mvThemeStyle*>(item);
if(_source != 0) _value = titem->_value;
if (_source != 0) _value = titem->_value;
_targetStyle = titem->_targetStyle;
_libType = titem->_libType;
}
Expand Down