color reset button always shown, but disabled if no custom value
This commit is contained in:
@@ -1022,10 +1022,12 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
|
||||
// actions column
|
||||
ImGui.TableSetColumnIndex(2);
|
||||
if (UIColors.IsCustom(colorKey))
|
||||
{
|
||||
using var resetId = ImRaii.PushId($"Reset_{colorKey}");
|
||||
var availableWidth = ImGui.GetContentRegionAvail().X;
|
||||
var isCustom = UIColors.IsCustom(colorKey);
|
||||
|
||||
using (ImRaii.Disabled(!isCustom))
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
if (ImGui.Button(FontAwesomeIcon.Undo.ToIconString(), new Vector2(availableWidth, 0)))
|
||||
@@ -1033,8 +1035,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
UIColors.Reset(colorKey);
|
||||
}
|
||||
}
|
||||
UiSharedService.AttachToolTip("Reset this color to default");
|
||||
}
|
||||
UiSharedService.AttachToolTip(isCustom ? "Reset this color to default" : "Color is already at default value");
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
|
||||
Reference in New Issue
Block a user