impr: Prettier data inspector edit button

This commit is contained in:
WerWolv
2023-11-19 16:08:21 +01:00
parent bd59bcda2c
commit f9073ee8ee
3 changed files with 22 additions and 3 deletions

View File

@@ -832,6 +832,26 @@ namespace ImGuiExt {
return res;
}
bool DimmedButtonToggle(const char *icon, bool *v, ImVec2 size) {
bool pushed = false;
bool toggled = false;
if (*v) {
PushStyleColor(ImGuiCol_Border, GetStyleColorVec4(ImGuiCol_ButtonActive));
pushed = true;
}
if (DimmedIconButton(icon, GetStyleColorVec4(ImGuiCol_Text), size)) {
*v = !*v;
toggled = true;
}
if (pushed)
PopStyleColor();
return toggled;
}
bool DimmedIconToggle(const char *icon, bool *v) {
bool pushed = false;
bool toggled = false;