Skip to content

Commit

Permalink
core: fix parameters and other improvements
Browse files Browse the repository at this point in the history
Specifically:
- Get anti-alias info from `get_app_configuration`
- Remove `offset` parameter from `digital_series`
- Remove/comment out leftovers
- Fix typo
- Improve docs
  • Loading branch information
SamuMazzi authored and hoffstadt committed Sep 17, 2024
1 parent 9a68160 commit 13db983
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dearpygui/_dearpygui.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dearpygui/_dearpygui_RTD.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dearpygui/dearpygui.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/source/documentation/themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ mvThemeCol_TitleBgActive mvThemeCol_TableBorderLight mvThemeCol_Resi
mvThemeCol_TitleBgCollapsed mvThemeCol_TableRowBg mvThemeCol_ResizeGripActive
mvThemeCol_MenuBarBg mvThemeCol_TableRowBgAlt mvThemeCol_Tab
mvThemeCol_ScrollbarBg mvThemeCol_TextSelectedBg mvThemeCol_TabHovered
mvThemeCol_ScrollbarGrab mvThemeCol_DragDropTarget
mvThemeCol_ScrollbarGrabHovered mvThemeCol_NavHighlight
mvThemeCol_ScrollbarGrabActive mvThemeCol_NavWindowingHighlight
mvThemeCol_CheckMark mvThemeCol_NavWindowingDimBg
Expand Down
6 changes: 6 additions & 0 deletions src/dearpygui_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -2820,6 +2820,12 @@ get_app_configuration(PyObject* self, PyObject* args, PyObject* kwargs)
PyDict_SetItemString(pdict, "wait_for_input", mvPyObject(ToPyBool(GContext->IO.waitForInput)));
PyDict_SetItemString(pdict, "manual_callback_management", mvPyObject(ToPyBool(GContext->IO.manualCallbacks)));
PyDict_SetItemString(pdict, "keyboard_navigation", mvPyObject(ToPyBool(GContext->IO.kbdNavigation)));

ImGuiStyle& style = ImGui::GetStyle();
PyDict_SetItemString(pdict, "anti_aliased_lines", mvPyObject(ToPyBool(style.AntiAliasedLines)));
PyDict_SetItemString(pdict, "anti_aliased_lines_use_tex", mvPyObject(ToPyBool(style.AntiAliasedLinesUseTex)));
PyDict_SetItemString(pdict, "anti_aliased_fill", mvPyObject(ToPyBool(style.AntiAliasedFill)));

return pdict;
}

Expand Down
1 change: 0 additions & 1 deletion src/mvAppItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4226,7 +4226,6 @@ DearPyGui::GetEntityParser(mvAppItemType type)

args.push_back({ mvPyDataType::DoubleList, "x" });
args.push_back({ mvPyDataType::DoubleList, "y" });
args.push_back({ mvPyDataType::Integer, "offset", mvArgType::KEYWORD_ARG, "0" });

setup.about = "Adds a digital series to a plot. Digital plots do not respond to y drag or zoom, and are always referenced to the bottom of the plot.";
setup.category = { "Plotting", "Containers", "Widgets" };
Expand Down
8 changes: 4 additions & 4 deletions src/mvContainers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ DearPyGui::fill_configuration_dict(const mvTreeNodeConfig& inConfig, PyObject* o
checkbitset("leaf", ImGuiTreeNodeFlags_Leaf, inConfig.flags);
checkbitset("bullet", ImGuiTreeNodeFlags_Bullet, inConfig.flags);
checkbitset("span_text_width", ImGuiTreeNodeFlags_SpanTextWidth, inConfig.flags);
checkbitset("span_available_width", ImGuiTreeNodeFlags_SpanAvailWidth, inConfig.flags);
// checkbitset("span_available_width", ImGuiTreeNodeFlags_SpanAvailWidth, inConfig.flags);
checkbitset("span_full_width", ImGuiTreeNodeFlags_SpanFullWidth, inConfig.flags);
checkbitset("span_all_columns", ImGuiTreeNodeFlags_SpanAllColumns, inConfig.flags);
// checkbitset("span_all_columns", ImGuiTreeNodeFlags_SpanAllColumns, inConfig.flags);
}

void
Expand Down Expand Up @@ -361,9 +361,9 @@ DearPyGui::set_configuration(PyObject* inDict, mvTreeNodeConfig& outConfig)
flagop("leaf", ImGuiTreeNodeFlags_Leaf, outConfig.flags);
flagop("bullet", ImGuiTreeNodeFlags_Bullet, outConfig.flags);
flagop("span_text_width", ImGuiTreeNodeFlags_SpanTextWidth, outConfig.flags);
flagop("span_available_width", ImGuiTreeNodeFlags_SpanAvailWidth, outConfig.flags);
// flagop("span_available_width", ImGuiTreeNodeFlags_SpanAvailWidth, outConfig.flags);
flagop("span_full_width", ImGuiTreeNodeFlags_SpanFullWidth, outConfig.flags);
flagop("span_all_columns", ImGuiTreeNodeFlags_SpanAllColumns, outConfig.flags);
// flagop("span_all_columns", ImGuiTreeNodeFlags_SpanAllColumns, outConfig.flags);
}

void
Expand Down
7 changes: 2 additions & 5 deletions src/mvPlotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ DearPyGui::draw_digital_series(ImDrawList* drawlist, mvAppItem& item, const mvDi
xptr = &(*config.value.get())[0];
yptr = &(*config.value.get())[1];

ImPlot::PlotDigital(item.info.internalLabel.c_str(), xptr->data(), yptr->data(), (int)xptr->size(), config.flags, config.offset);
ImPlot::PlotDigital(item.info.internalLabel.c_str(), xptr->data(), yptr->data(), (int)xptr->size(), config.flags, 0);

// Begin a popup for a legend entry.
if (ImPlot::BeginLegendPopup(item.info.internalLabel.c_str(), 1))
Expand Down Expand Up @@ -3121,7 +3121,6 @@ DearPyGui::set_configuration(PyObject* inDict, mvDigitalSeriesConfig& outConfig)

if (PyObject* item = PyDict_GetItemString(inDict, "x")) { (*outConfig.value)[0] = ToDoubleVect(item); }
if (PyObject* item = PyDict_GetItemString(inDict, "y")) { (*outConfig.value)[1] = ToDoubleVect(item); }
if (PyObject* item = PyDict_GetItemString(inDict, "offset")) outConfig.offset = ToInt(item);
}

void
Expand Down Expand Up @@ -3709,7 +3708,7 @@ DearPyGui::fill_configuration_dict(const mv2dHistogramSeriesConfig& inConfig, Py
// flags
checkbitset("density", ImPlotHistogramFlags_Density, inConfig.flags);
reverse_checkbitset("outliers", ImPlotHistogramFlags_NoOutliers, inConfig.flags);
checkbitset("col_amjor", ImPlotHistogramFlags_ColMajor, inConfig.flags);
checkbitset("col_major", ImPlotHistogramFlags_ColMajor, inConfig.flags);
}

void
Expand Down Expand Up @@ -3759,8 +3758,6 @@ DearPyGui::fill_configuration_dict(const mvDigitalSeriesConfig& inConfig, PyObje
{
if (outDict == nullptr)
return;

PyDict_SetItemString(outDict, "offset", mvPyObject(ToPyInt(inConfig.offset)));
}

void
Expand Down
1 change: 0 additions & 1 deletion src/mvPlotting.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ struct mvHistogramSeriesConfig : _mvBasicSeriesConfig
struct mvDigitalSeriesConfig : _mvBasicSeriesConfig
{
ImPlotDigitalFlags flags = ImPlotDigitalFlags_None;
int offset = 0;
};

struct mvPieSeriesConfig : _mvBasicSeriesConfig
Expand Down
1 change: 0 additions & 1 deletion src/mvTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ void mvTableColumn::getSpecificConfiguration(PyObject* dict)
checkbitset("indent_enable", ImGuiTableColumnFlags_IndentEnable, _flags);
checkbitset("indent_disable", ImGuiTableColumnFlags_IndentDisable, _flags);
checkbitset("angled_header", ImGuiTableColumnFlags_AngledHeader, _flags);
checkbitset("disabled", ImGuiTableColumnFlags_Disabled, _flags);
checkbitset("no_header_label", ImGuiTableColumnFlags_NoHeaderLabel, _flags);
}

Expand Down

0 comments on commit 13db983

Please sign in to comment.