mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-15 05:04:16 +01:00
Fix labels appearing where unwanted.
This commit is contained in:
parent
ff6905d45e
commit
53388739ca
1 changed files with 12 additions and 6 deletions
|
|
@ -47,14 +47,20 @@ public static class UiHelpers
|
||||||
|
|
||||||
public static bool DrawCheckbox(string label, string tooltip, bool value, out bool on, bool locked)
|
public static bool DrawCheckbox(string label, string tooltip, bool value, out bool on, bool locked)
|
||||||
{
|
{
|
||||||
|
var startsWithHash = label.StartsWith("##");
|
||||||
bool ret;
|
bool ret;
|
||||||
using (var disabled = ImRaii.Disabled(locked))
|
using (_ = ImRaii.Disabled(locked))
|
||||||
{
|
{
|
||||||
ret = ImGuiUtil.Checkbox("##" + label, string.Empty, value, v => value = v);
|
ret = ImGuiUtil.Checkbox(startsWithHash ? label : "##" + label, string.Empty, value, v => value = v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!startsWithHash)
|
||||||
|
{
|
||||||
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(label);
|
ImGui.TextUnformatted(label);
|
||||||
|
}
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(tooltip, ImGuiHoveredFlags.AllowWhenDisabled);
|
ImGuiUtil.HoverTooltip(tooltip, ImGuiHoveredFlags.AllowWhenDisabled);
|
||||||
on = value;
|
on = value;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue