Scale dalamud windows by the global font scale

This commit is contained in:
Cara 2020-11-15 00:11:47 +10:30
parent 0197733fdb
commit e7bbbc0164
4 changed files with 19 additions and 19 deletions

View file

@ -32,16 +32,16 @@ namespace Dalamud.Interface {
ImGui.Text($"The in-game addon has been updated to version D{this.assemblyVersion}.");
ImGui.Dummy(new Vector2(10, 10));
ImGui.Dummy(new Vector2(10, 10) * ImGui.GetIO().FontGlobalScale);
ImGui.Text("The following changes were introduced:");
ImGui.Text(ChangeLog);
ImGui.Dummy(new Vector2(10, 10));
ImGui.Dummy(new Vector2(10, 10) * ImGui.GetIO().FontGlobalScale);
ImGui.Text("Thank you for using our tools!");
ImGui.Dummy(new Vector2(10, 10));
ImGui.Dummy(new Vector2(10, 10) * ImGui.GetIO().FontGlobalScale);
ImGui.PushFont(InterfaceManager.IconFont);
@ -80,7 +80,7 @@ namespace Dalamud.Interface {
ImGui.PopFont();
ImGui.SameLine();
ImGui.Dummy(new Vector2(20, 0));
ImGui.Dummy(new Vector2(20, 0) * ImGui.GetIO().FontGlobalScale);
ImGui.SameLine();
if (ImGui.Button("Close")) {

View file

@ -117,7 +117,7 @@ Thank you for using XIVLauncher and Dalamud!
}
public bool Draw() {
var windowSize = new Vector2(500, 400);
var windowSize = new Vector2(500, 400) * ImGui.GetIO().FontGlobalScale;
ImGui.SetNextWindowSize(windowSize, ImGuiCond.Always);
var screenSize = ImGui.GetIO().DisplaySize;
@ -137,13 +137,13 @@ Thank you for using XIVLauncher and Dalamud!
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));
ImGui.Dummy(new Vector2(0, 340f));
ImGui.Dummy(new Vector2(0, 340f) * ImGui.GetIO().FontGlobalScale);
ImGui.Text("");
ImGui.SameLine(150f);
ImGui.Image(this.logoTexture.ImGuiHandle, new Vector2(190f, 190f));
ImGui.Image(this.logoTexture.ImGuiHandle, new Vector2(190f, 190f) * ImGui.GetIO().FontGlobalScale);
ImGui.Dummy(new Vector2(0, 20f));
ImGui.Dummy(new Vector2(0, 20f) * ImGui.GetIO().FontGlobalScale);
var windowX = ImGui.GetWindowSize().X;

View file

@ -58,7 +58,7 @@ namespace Dalamud.Interface
#endregion
public bool Draw() {
ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.Always);
ImGui.SetNextWindowSize(new Vector2(500, 500) * ImGui.GetIO().FontGlobalScale, ImGuiCond.Always);
var isOpen = true;
@ -67,7 +67,7 @@ namespace Dalamud.Interface
return false;
}
ImGui.BeginChild("scrolling", new Vector2(499, 430), false, ImGuiWindowFlags.HorizontalScrollbar);
ImGui.BeginChild("scrolling", new Vector2(499, 430) * ImGui.GetIO().FontGlobalScale, false, ImGuiWindowFlags.HorizontalScrollbar);
if (ImGui.BeginTabBar("SetTabBar")) {
if (ImGui.BeginTabItem(Loc.Localize("DalamudSettingsGeneral", "General"))) {
@ -76,14 +76,14 @@ namespace Dalamud.Interface
this.languages.Length);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsLanguageHint", "Select the language Dalamud will be displayed in."));
ImGui.Dummy(new Vector2(5f, 5f));
ImGui.Dummy(new Vector2(5f, 5f) * ImGui.GetIO().FontGlobalScale);
ImGui.Text(Loc.Localize("DalamudSettingsChannel", "General Chat Channel"));
ImGui.Combo("##XlChatTypeCombo", ref this.dalamudMessagesChatType, this.chatTypes,
this.chatTypes.Length);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsChannelHint", "Select the chat channel that is to be used for general Dalamud messages."));
ImGui.Dummy(new Vector2(5f, 5f));
ImGui.Dummy(new Vector2(5f, 5f) * ImGui.GetIO().FontGlobalScale);
ImGui.Checkbox(Loc.Localize("DalamudSettingsFlash", "Flash FFXIV window on duty pop"), ref this.doCfTaskBarFlash);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsFlashHint", "Select, if the FFXIV window should be flashed in your task bar when a duty is ready."));
@ -101,7 +101,7 @@ namespace Dalamud.Interface
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsGlobalUiScaleHint", "Scale all XIVLauncher UI elements - useful for 4K displays."));
ImGui.Dummy(new Vector2(10f, 16f));
ImGui.Dummy(new Vector2(10f, 16f) * ImGui.GetIO().FontGlobalScale);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingToggleUiHideOptOutNote", "Plugins may independently opt out of the settings below."));
@ -121,7 +121,7 @@ namespace Dalamud.Interface
{
ImGui.Text(Loc.Localize("DalamudSettingsRestartHint", "You need to restart your game after changing these settings."));
ImGui.Dummy(new Vector2(10f, 10f));
ImGui.Dummy(new Vector2(10f, 10f) * ImGui.GetIO().FontGlobalScale);
ImGui.Checkbox(Loc.Localize("DalamudSettingsPluginTest", "Get plugin testing builds"), ref this.doPluginTest);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsPluginTestHint", "Check this box to receive testing prereleases for plugins."));

View file

@ -51,20 +51,20 @@ namespace Dalamud.Plugin
public bool Draw() {
var windowOpen = true;
ImGui.SetNextWindowSize(new Vector2(750, 520));
ImGui.SetNextWindowSize(new Vector2(750, 520) * ImGui.GetIO().FontGlobalScale);
ImGui.Begin(Loc.Localize("InstallerHeader", "Plugin Installer") + (this.dalamud.Configuration.DoPluginTest ? " (TESTING)" : string.Empty) + "###XlPluginInstaller", ref windowOpen,
ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar);
ImGui.Text(Loc.Localize("InstallerHint", "This window allows you install and remove in-game plugins.\nThey are made by third-party developers."));
ImGui.SameLine(ImGui.GetWindowWidth() - 250);
ImGui.SetNextItemWidth(240);
ImGui.SameLine(ImGui.GetWindowWidth() - 250 * ImGui.GetIO().FontGlobalScale);
ImGui.SetNextItemWidth(240 * ImGui.GetIO().FontGlobalScale);
ImGui.InputTextWithHint("###XPlPluginInstaller_Search", Loc.Localize("InstallerSearch", "Search"), ref this.searchText, 100);
ImGui.Separator();
ImGui.BeginChild("scrolling", new Vector2(0, 400), true, ImGuiWindowFlags.HorizontalScrollbar);
ImGui.BeginChild("scrolling", new Vector2(0, 400 * ImGui.GetIO().FontGlobalScale), true, ImGuiWindowFlags.HorizontalScrollbar);
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(1, 3));
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(1, 3) * ImGui.GetIO().FontGlobalScale);
if (this.dalamud.PluginRepository.State == PluginRepository.InitializationState.InProgress) {
ImGui.Text(Loc.Localize("InstallerLoading", "Loading plugins..."));