Skip to content

Commit

Permalink
Add EnableBrioScale
Browse files Browse the repository at this point in the history
  • Loading branch information
Minmoose committed Feb 17, 2025
1 parent 6d4d2d7 commit bc38151
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Brio/UI/BrioStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ public static class BrioStyle
{
public static bool EnableStyle { get; set; }
public static bool EnableColor => Config.ConfigurationService.Instance.Configuration.Appearance.EnableBrioColor;
public static bool EnableScale => Config.ConfigurationService.Instance.Configuration.Appearance.EnableBrioScale;

static bool _hasPushed = false;
static bool _hasPushedColor = false;
static bool _hasPushedScale = false;
static float _lastGlobalScale;

public static void PushStyle()
Expand All @@ -21,8 +23,12 @@ public static void PushStyle()

var imIO = ImGui.GetIO();

//_lastGlobalScale = imIO.FontGlobalScale;
//imIO.FontGlobalScale = 1f;
if(EnableScale)
{
_lastGlobalScale = imIO.FontGlobalScale;
imIO.FontGlobalScale = 1f;
_hasPushedScale = true;
}

if(EnableColor)
{
Expand All @@ -32,7 +38,7 @@ public static void PushStyle()
PushStyleColor(ImGuiCol.TextDisabled, new Vector4(128, 128, 128, 255));

PushStyleColor(ImGuiCol.WindowBg, new Vector4(25, 25, 25, 248));
PushStyleColor(ImGuiCol.ChildBg, new Vector4(25, 25, 25, 228));
PushStyleColor(ImGuiCol.ChildBg, new Vector4(25, 25, 25, 66));
PushStyleColor(ImGuiCol.PopupBg, new Vector4(25, 25, 25, 248));

PushStyleColor(ImGuiCol.Border, new Vector4(44, 44, 44, 255));
Expand Down Expand Up @@ -146,7 +152,8 @@ public static void PopStyle()
ImGui.PopStyleColor(51);
}

//ImGui.GetIO().FontGlobalScale = _lastGlobalScale;
if(_hasPushedScale)
ImGui.GetIO().FontGlobalScale = _lastGlobalScale;
}
}
}
7 changes: 7 additions & 0 deletions Brio/UI/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ private void DrawDisplaySettings()
_configurationService.Configuration.Appearance.EnableBrioColor = enableBrioColor;
_configurationService.ApplyChange();
}

bool enableBrioScale = _configurationService.Configuration.Appearance.EnableBrioScale;
if(ImGui.Checkbox("Enable Brio Text Scale", ref enableBrioScale))
{
_configurationService.Configuration.Appearance.EnableBrioScale = enableBrioScale;
_configurationService.ApplyChange();
}
}

private void DrawSceneTab()
Expand Down

0 comments on commit bc38151

Please sign in to comment.