mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
patterns: Added [[hex::spec_name]]
This commit is contained in:
@@ -191,5 +191,6 @@ namespace ImGui {
|
||||
|
||||
bool DimmedButton(const char* label);
|
||||
bool DimmedIconButton(const char *symbol, ImVec4 color, ImVec2 size_arg = ImVec2(0, 0));
|
||||
bool DimmedIconToggle(const char *icon, bool *v);
|
||||
|
||||
}
|
||||
@@ -788,4 +788,24 @@ namespace ImGui {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool DimmedIconToggle(const char *icon, bool *v) {
|
||||
bool pushed = false;
|
||||
bool toggled = false;
|
||||
|
||||
if (*v) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(icon, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
*v = !*v;
|
||||
toggled = true;
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
return toggled;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user