From 44a0f93a7f91577a0142e56cf680c00bfd72749e Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Mon, 10 Feb 2025 12:49:30 -0600 Subject: [PATCH 1/9] Apply suppress_recommendations to supports relationships --- Core/ModuleInstaller.cs | 2 ++ Core/Relationships/RelationshipResolver.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/ModuleInstaller.cs b/Core/ModuleInstaller.cs index 84520700a..f9aec5d9c 100644 --- a/Core/ModuleInstaller.cs +++ b/Core/ModuleInstaller.cs @@ -1577,12 +1577,14 @@ public static bool FindRecommendations(GameInstance out Dictionary> suggestions, out Dictionary> supporters) { + log.DebugFormat("Finding recommendations for: {0}", string.Join(", ", sourceModules)); var crit = instance.VersionCriteria(); var resolver = new RelationshipResolver(sourceModules.Where(m => !m.IsDLC), null, RelationshipResolverOptions.KitchenSinkOpts(instance.StabilityToleranceConfig), registry, instance.game, crit); var recommenders = resolver.Dependencies().ToHashSet(); + log.DebugFormat("Recommenders: {0}", string.Join(", ", recommenders)); var checkedRecs = resolver.Recommendations(recommenders) .Where(m => resolver.ReasonsFor(m) diff --git a/Core/Relationships/RelationshipResolver.cs b/Core/Relationships/RelationshipResolver.cs index b865b97c2..ece6a8bc1 100644 --- a/Core/Relationships/RelationshipResolver.cs +++ b/Core/Relationships/RelationshipResolver.cs @@ -528,7 +528,7 @@ private IEnumerable allDependers(CkanModule module) .Except(found)); public IEnumerable Dependencies() - => BreadthFirstSearch(user_requested_mods, + => BreadthFirstSearch(user_requested_mods.Where(m => !suppressedRecommenders.Any(rel => rel.WithinBounds(m))), (searching, found) => modlist.Values .Except(found) From 7b005965c7bf5f17fc052c9a515261b5dec915f1 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 19 Feb 2025 14:49:13 -0600 Subject: [PATCH 2/9] Rename toolbar and main menu --- GUI/Controls/ManageMods.Designer.cs | 38 ++++++++++++++--------------- GUI/Controls/ManageMods.cs | 4 +-- GUI/Main/Main.Designer.cs | 31 ++++++++++++----------- GUI/Main/Main.cs | 10 ++++---- GUI/Main/MainRepo.cs | 2 +- 5 files changed, 42 insertions(+), 43 deletions(-) diff --git a/GUI/Controls/ManageMods.Designer.cs b/GUI/Controls/ManageMods.Designer.cs index f161750cc..598a97d1f 100644 --- a/GUI/Controls/ManageMods.Designer.cs +++ b/GUI/Controls/ManageMods.Designer.cs @@ -31,7 +31,7 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(ManageMods)); this.ToolTip = new System.Windows.Forms.ToolTip(); - this.menuStrip2 = new System.Windows.Forms.MenuStrip(); + this.Toolbar = new System.Windows.Forms.MenuStrip(); this.LaunchGameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CommandLinesToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.EditCommandLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -84,7 +84,7 @@ private void InitializeComponent() this.downloadContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.purgeContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.hiddenTagsLabelsLinkList = new CKAN.GUI.TagsLabelsLinkList(); - this.menuStrip2.SuspendLayout(); + this.Toolbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ModGrid)).BeginInit(); this.ModListContextMenuStrip.SuspendLayout(); this.ModListHeaderContextMenuStrip.SuspendLayout(); @@ -97,12 +97,12 @@ private void InitializeComponent() this.ToolTip.ReshowDelay = 250; this.ToolTip.ShowAlways = true; // - // menuStrip2 + // Toolbar // - this.menuStrip2.AutoSize = false; - this.menuStrip2.Dock = System.Windows.Forms.DockStyle.Top; - this.menuStrip2.ImageScalingSize = new System.Drawing.Size(24, 24); - this.menuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.Toolbar.AutoSize = false; + this.Toolbar.Dock = System.Windows.Forms.DockStyle.Top; + this.Toolbar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.Toolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.LaunchGameToolStripMenuItem, this.RefreshToolButton, this.UpdateAllToolButton, @@ -110,14 +110,14 @@ private void InitializeComponent() this.FilterToolButton, this.NavBackwardToolButton, this.NavForwardToolButton}); - this.menuStrip2.CanOverflow = true; - this.menuStrip2.Location = new System.Drawing.Point(0, 0); - this.menuStrip2.Name = "menuStrip2"; - this.menuStrip2.ShowItemToolTips = true; - this.menuStrip2.Size = new System.Drawing.Size(5876, 48); - this.menuStrip2.TabStop = true; - this.menuStrip2.TabIndex = 4; - this.menuStrip2.Text = "menuStrip2"; + this.Toolbar.CanOverflow = true; + this.Toolbar.Location = new System.Drawing.Point(0, 0); + this.Toolbar.Name = "Toolbar"; + this.Toolbar.ShowItemToolTips = true; + this.Toolbar.Size = new System.Drawing.Size(5876, 48); + this.Toolbar.TabStop = true; + this.Toolbar.TabIndex = 4; + this.Toolbar.Text = "Toolbar"; // // LaunchGameToolStripMenuItem // @@ -570,13 +570,13 @@ private void InitializeComponent() this.Controls.Add(this.ModGrid); this.Controls.Add(this.hiddenTagsLabelsLinkList); this.Controls.Add(this.EditModSearches); - this.Controls.Add(this.menuStrip2); + this.Controls.Add(this.Toolbar); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "ManageMods"; this.Size = new System.Drawing.Size(1544, 948); resources.ApplyResources(this, "$this"); - this.menuStrip2.ResumeLayout(false); - this.menuStrip2.PerformLayout(); + this.Toolbar.ResumeLayout(false); + this.Toolbar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.ModGrid)).EndInit(); this.ModListContextMenuStrip.ResumeLayout(false); this.ModListHeaderContextMenuStrip.ResumeLayout(false); @@ -588,7 +588,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.ToolTip ToolTip; - private System.Windows.Forms.MenuStrip menuStrip2; + private System.Windows.Forms.MenuStrip Toolbar; private System.Windows.Forms.CheckBox InstallAllCheckbox; private System.Windows.Forms.ToolStripMenuItem LaunchGameToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator CommandLinesToolStripSeparator; diff --git a/GUI/Controls/ManageMods.cs b/GUI/Controls/ManageMods.cs index d4c70639e..86e60a284 100644 --- a/GUI/Controls/ManageMods.cs +++ b/GUI/Controls/ManageMods.cs @@ -54,7 +54,7 @@ public ManageMods() if (Platform.IsMono) { - menuStrip2.Renderer = new FlatToolStripRenderer(); + Toolbar.Renderer = new FlatToolStripRenderer(); FilterToolButton.DropDown.Renderer = new FlatToolStripRenderer(); FilterTagsToolButton.DropDown.Renderer = new FlatToolStripRenderer(); FilterLabelsToolButton.DropDown.Renderer = new FlatToolStripRenderer(); @@ -1500,7 +1500,7 @@ private bool _UpdateModsList(Dictionary? old_modules = null) var has_unheld_updates = mainModList.Modules.Any(mod => mod.HasUpdate && (!Main.Instance?.LabelsHeld(mod.Identifier) ?? true)); - Util.Invoke(menuStrip2, () => + Util.Invoke(Toolbar, () => { FilterCompatibleButton.Text = string.Format(Properties.Resources.MainModListCompatible, mainModList.CountModsByFilter(currentInstance, GUIModFilter.Compatible)); diff --git a/GUI/Main/Main.Designer.cs b/GUI/Main/Main.Designer.cs index 057afb431..015e806ea 100644 --- a/GUI/Main/Main.Designer.cs +++ b/GUI/Main/Main.Designer.cs @@ -30,7 +30,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(Main)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.MainMenu = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.manageGameInstancesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openGameDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -108,7 +108,7 @@ private void InitializeComponent() this.DeleteDirectories = new CKAN.GUI.DeleteDirectories(); this.EditModpackTabPage = new System.Windows.Forms.TabPage(); this.EditModpack = new CKAN.GUI.EditModpack(); - this.menuStrip1.SuspendLayout(); + this.MainMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -131,19 +131,18 @@ private void InitializeComponent() this.EditModpackTabPage.SuspendLayout(); this.SuspendLayout(); // - // menuStrip1 + // MainMenu // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MainMenu.ImageScalingSize = new System.Drawing.Size(16, 16); + this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.settingsToolStripMenuItem, this.helpToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3); - this.menuStrip1.Size = new System.Drawing.Size(1544, 35); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; + this.MainMenu.Location = new System.Drawing.Point(0, 0); + this.MainMenu.Name = "MainMenu"; + this.MainMenu.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3); + this.MainMenu.Size = new System.Drawing.Size(1544, 24); + this.MainMenu.TabIndex = 0; // // fileToolStripMenuItem // @@ -838,17 +837,17 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(1544, 1038); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.MainMenu); this.KeyPreview = true; - this.MainMenuStrip = this.menuStrip1; + this.MainMenuStrip = this.MainMenu; this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.MinimumSize = new System.Drawing.Size(880, 400); this.Name = "Main"; this.Resize += new System.EventHandler(this.Main_Resize); this.Icon = EmbeddedImages.AppIcon; resources.ApplyResources(this, "$this"); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); + this.MainMenu.ResumeLayout(false); + this.MainMenu.PerformLayout(); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); @@ -891,7 +890,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.MenuStrip MainMenu; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem manageGameInstancesMenuItem; private System.Windows.Forms.ToolStripMenuItem openGameDirectoryToolStripMenuItem; diff --git a/GUI/Main/Main.cs b/GUI/Main/Main.cs index b05417215..69821d3da 100644 --- a/GUI/Main/Main.cs +++ b/GUI/Main/Main.cs @@ -116,7 +116,7 @@ public Main(string[] cmdlineArgs, // Replace mono's broken, ugly toolstrip renderer if (Platform.IsMono) { - menuStrip1.Renderer = new FlatToolStripRenderer(); + MainMenu.Renderer = new FlatToolStripRenderer(); fileToolStripMenuItem.DropDown.Renderer = new FlatToolStripRenderer(); settingsToolStripMenuItem.DropDown.Renderer = new FlatToolStripRenderer(); helpToolStripMenuItem.DropDown.Renderer = new FlatToolStripRenderer(); @@ -195,7 +195,7 @@ protected override void OnLoad(EventArgs e) try { - splitContainer1.SplitterDistance = configuration.PanelPosition; + // splitContainer1.SplitterDistance = configuration.PanelPosition; } catch { @@ -550,7 +550,7 @@ private void SetStartPosition() protected override void OnFormClosing(FormClosingEventArgs e) { // Only close the window, when the user has access to the "Exit" of the menu. - if (!menuStrip1.Enabled) + if (!MainMenu.Enabled) { e.Cancel = true; return; @@ -1199,7 +1199,7 @@ private void EnableMainWindow() Util.Invoke(this, () => { Enabled = true; - menuStrip1.Enabled = true; + MainMenu.Enabled = true; tabController.SetTabLock(false); /* Windows (7 & 8 only?) bug #1548 has extra facets. * parent.childcontrol.Enabled = false seems to disable the parent, @@ -1215,7 +1215,7 @@ private void DisableMainWindow() { Util.Invoke(this, () => { - menuStrip1.Enabled = false; + MainMenu.Enabled = false; tabController.SetTabLock(true); }); } diff --git a/GUI/Main/MainRepo.cs b/GUI/Main/MainRepo.cs index 47a64296f..e57180991 100644 --- a/GUI/Main/MainRepo.cs +++ b/GUI/Main/MainRepo.cs @@ -307,7 +307,7 @@ public void UpdateRefreshTimer() private void OnRefreshTimer(object? sender, ElapsedEventArgs e) { - if (menuStrip1.Enabled && configuration != null && !configuration.RefreshPaused) + if (MainMenu.Enabled && configuration != null && !configuration.RefreshPaused) { // Just a safety check UpdateRepo(); From 84a0d3e44916d39cf71d73065a86a02997e695b5 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Tue, 11 Feb 2025 09:55:39 -0600 Subject: [PATCH 3/9] Remove duplicate resource manager classes --- AutoUpdate/SingleAssemblyResourceManager.cs | 27 ++++++-- Cmdline/SingleAssemblyResourceManager.cs | 53 ---------------- ConsoleUI/SingleAssemblyResourceManager.cs | 69 --------------------- Core/SingleAssemblyResourceManager.cs | 22 ++++++- GUI/SingleAssemblyResourceManager.cs | 53 ---------------- Tests/CmdLine/ResourcesTests.cs | 2 +- Tests/ConsoleUI/ResourcesTests.cs | 3 +- Tests/GUI/ResourcesTests.cs | 4 +- 8 files changed, 49 insertions(+), 184 deletions(-) delete mode 100644 Cmdline/SingleAssemblyResourceManager.cs delete mode 100644 ConsoleUI/SingleAssemblyResourceManager.cs delete mode 100644 GUI/SingleAssemblyResourceManager.cs diff --git a/AutoUpdate/SingleAssemblyResourceManager.cs b/AutoUpdate/SingleAssemblyResourceManager.cs index b6cf72063..e9ee854c0 100644 --- a/AutoUpdate/SingleAssemblyResourceManager.cs +++ b/AutoUpdate/SingleAssemblyResourceManager.cs @@ -7,16 +7,35 @@ namespace CKAN.AutoUpdateHelper { // Thanks and credit to this guy: https://stackoverflow.com/q/1952638/2422988 + /// + /// Wrapper around ResourceManager that retrieves strings from the assembly + /// rather than external files + /// public class SingleAssemblyResourceManager : ResourceManager { - public SingleAssemblyResourceManager(string basename, Assembly assembly) : base(basename, assembly) + /// + /// Initialize the resource manager + /// + /// To be passed to ResourceManager + /// To be passed to ResourceManager + public SingleAssemblyResourceManager(string basename, Assembly assembly) + : base(basename, assembly) { } + /// + /// Provides resources from the assembly to ResourceManager + /// + /// The language to get + /// Set to false to avoid loading if not already cached + /// Just gets passed to base class implementation + /// protected override ResourceSet? InternalGetResourceSet(CultureInfo culture, - bool createIfNotExists, bool tryParents) + bool createIfNotExists, + bool tryParents) { - if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) && createIfNotExists && MainAssembly != null) + if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) + && createIfNotExists && MainAssembly != null) { // Lazy-load default language (without caring about duplicate assignment in race conditions, no harm done) neutralResourcesCulture ??= GetNeutralResourcesLanguage(MainAssembly); @@ -46,7 +65,7 @@ public SingleAssemblyResourceManager(string basename, Assembly assembly) : base( return rs; } - private CultureInfo? neutralResourcesCulture; + private CultureInfo? neutralResourcesCulture; private readonly Dictionary myResourceSets = new Dictionary(); } } diff --git a/Cmdline/SingleAssemblyResourceManager.cs b/Cmdline/SingleAssemblyResourceManager.cs deleted file mode 100644 index 4463fda4a..000000000 --- a/Cmdline/SingleAssemblyResourceManager.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Globalization; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; - -namespace CKAN.CmdLine -{ - // Thanks and credit to this guy: https://stackoverflow.com/q/1952638/2422988 - - public class SingleAssemblyResourceManager : ResourceManager - { - public SingleAssemblyResourceManager(string basename, Assembly assembly) : base(basename, assembly) - { - } - - protected override ResourceSet? InternalGetResourceSet(CultureInfo culture, - bool createIfNotExists, bool tryParents) - { - if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) - && createIfNotExists && MainAssembly != null) - { - // Lazy-load default language (without caring about duplicate assignment in race conditions, no harm done) - neutralResourcesCulture ??= GetNeutralResourcesLanguage(MainAssembly); - - // If we're asking for the default language, then ask for the - // invariant (non-specific) resources. - if (neutralResourcesCulture.Equals(culture)) - { - culture = CultureInfo.InvariantCulture; - } - string resourceFileName = GetResourceFileName(culture); - - var store = MainAssembly.GetManifestResourceStream(resourceFileName); - - // If we found the appropriate resources in the local assembly - if (store != null) - { - rs = new ResourceSet(store); - // Save for later - myResourceSets.Add(culture, rs); - } - else - { - rs = base.InternalGetResourceSet(culture, createIfNotExists, tryParents); - } - } - return rs; - } - - private CultureInfo? neutralResourcesCulture; - private readonly Dictionary myResourceSets = new Dictionary(); - } -} diff --git a/ConsoleUI/SingleAssemblyResourceManager.cs b/ConsoleUI/SingleAssemblyResourceManager.cs deleted file mode 100644 index 9fa645680..000000000 --- a/ConsoleUI/SingleAssemblyResourceManager.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Globalization; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; - -namespace CKAN.ConsoleUI -{ - // Thanks and credit to this guy: https://stackoverflow.com/q/1952638/2422988 - - /// - /// Wrapper around ResourceManager that retrieves strings from the assembly - /// rather than external files - /// - public class SingleAssemblyResourceManager : ResourceManager - { - /// - /// Initialize the resource manager - /// - /// To be passed to ResourceManager - /// To be passed to ResourceManager - public SingleAssemblyResourceManager(string basename, Assembly assembly) - : base(basename, assembly) - { - } - - /// - /// Provides resources from the assembly to ResourceManager - /// - /// The language to get - /// Set to false to avoid loading if not already cached - /// Just gets passed to base class implementation - /// - protected override ResourceSet? InternalGetResourceSet(CultureInfo culture, - bool createIfNotExists, bool tryParents) - { - if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) && createIfNotExists && MainAssembly != null) - { - // Lazy-load default language (without caring about duplicate assignment in race conditions, no harm done) - neutralResourcesCulture ??= GetNeutralResourcesLanguage(MainAssembly); - - // If we're asking for the default language, then ask for the - // invariant (non-specific) resources. - if (neutralResourcesCulture.Equals(culture)) - { - culture = CultureInfo.InvariantCulture; - } - string resourceFileName = GetResourceFileName(culture); - - var store = MainAssembly.GetManifestResourceStream(resourceFileName); - - // If we found the appropriate resources in the local assembly - if (store != null) - { - rs = new ResourceSet(store); - // Save for later - myResourceSets.Add(culture, rs); - } - else - { - rs = base.InternalGetResourceSet(culture, createIfNotExists, tryParents); - } - } - return rs; - } - - private CultureInfo? neutralResourcesCulture; - private readonly Dictionary myResourceSets = new Dictionary(); - } -} diff --git a/Core/SingleAssemblyResourceManager.cs b/Core/SingleAssemblyResourceManager.cs index 0b58c6bd6..205dab7dd 100644 --- a/Core/SingleAssemblyResourceManager.cs +++ b/Core/SingleAssemblyResourceManager.cs @@ -7,17 +7,35 @@ namespace CKAN { // Thanks and credit to this guy: https://stackoverflow.com/q/1952638/2422988 + /// + /// Wrapper around ResourceManager that retrieves strings from the assembly + /// rather than external files + /// public class SingleAssemblyResourceManager : ResourceManager { - public SingleAssemblyResourceManager(string basename, Assembly assembly) : base(basename, assembly) + /// + /// Initialize the resource manager + /// + /// To be passed to ResourceManager + /// To be passed to ResourceManager + public SingleAssemblyResourceManager(string basename, Assembly assembly) + : base(basename, assembly) { } + /// + /// Provides resources from the assembly to ResourceManager + /// + /// The language to get + /// Set to false to avoid loading if not already cached + /// Just gets passed to base class implementation + /// protected override ResourceSet? InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents) { - if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) && createIfNotExists && MainAssembly != null) + if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) + && createIfNotExists && MainAssembly != null) { // Lazy-load default language (without caring about duplicate assignment in race conditions, no harm done) neutralResourcesCulture ??= GetNeutralResourcesLanguage(MainAssembly); diff --git a/GUI/SingleAssemblyResourceManager.cs b/GUI/SingleAssemblyResourceManager.cs deleted file mode 100644 index 15279f5c9..000000000 --- a/GUI/SingleAssemblyResourceManager.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Globalization; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; - -namespace CKAN.GUI -{ - // Thanks and credit to this guy: https://stackoverflow.com/q/1952638/2422988 - - public class SingleAssemblyResourceManager : ResourceManager - { - public SingleAssemblyResourceManager(string basename, Assembly assembly) - : base(basename, assembly) - { - } - - protected override ResourceSet? InternalGetResourceSet(CultureInfo culture, - bool createIfNotExists, bool tryParents) - { - if (!myResourceSets.TryGetValue(culture, out ResourceSet? rs) && createIfNotExists && MainAssembly != null) - { - // Lazy-load default language (without caring about duplicate assignment in race conditions, no harm done) - neutralResourcesCulture ??= GetNeutralResourcesLanguage(MainAssembly); - - // If we're asking for the default language, then ask for the - // invariant (non-specific) resources. - if (neutralResourcesCulture.Equals(culture)) - { - culture = CultureInfo.InvariantCulture; - } - string resourceFileName = GetResourceFileName(culture); - - var store = MainAssembly.GetManifestResourceStream(resourceFileName); - - // If we found the appropriate resources in the local assembly - if (store != null) - { - rs = new ResourceSet(store); - // Save for later - myResourceSets.Add(culture, rs); - } - else - { - rs = base.InternalGetResourceSet(culture, createIfNotExists, tryParents); - } - } - return rs; - } - - private CultureInfo? neutralResourcesCulture; - private readonly Dictionary myResourceSets = new Dictionary(); - } -} diff --git a/Tests/CmdLine/ResourcesTests.cs b/Tests/CmdLine/ResourcesTests.cs index 81961df10..78bad5ec5 100644 --- a/Tests/CmdLine/ResourcesTests.cs +++ b/Tests/CmdLine/ResourcesTests.cs @@ -19,7 +19,7 @@ public class ResourcesTests public void PropertiesResources_LanguageResource_NotSet() { // Arrange - ResourceManager resources = new CKAN.CmdLine.SingleAssemblyResourceManager( + ResourceManager resources = new CKAN.SingleAssemblyResourceManager( "CKAN.CmdLine.Properties.Resources", typeof(CKAN.CmdLine.Properties.Resources).Assembly); // Act/Assert diff --git a/Tests/ConsoleUI/ResourcesTests.cs b/Tests/ConsoleUI/ResourcesTests.cs index 874d6f5b3..d17e79fe3 100644 --- a/Tests/ConsoleUI/ResourcesTests.cs +++ b/Tests/ConsoleUI/ResourcesTests.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Resources; using System.Globalization; + using NUnit.Framework; namespace Tests.ConsoleUI @@ -18,7 +19,7 @@ public class ResourcesTests public void PropertiesResources_LanguageResource_NotSet() { // Arrange - ResourceManager resources = new CKAN.ConsoleUI.SingleAssemblyResourceManager( + ResourceManager resources = new CKAN.SingleAssemblyResourceManager( "CKAN.ConsoleUI.Properties.Resources", typeof(CKAN.ConsoleUI.Properties.Resources).Assembly); // Act/Assert diff --git a/Tests/GUI/ResourcesTests.cs b/Tests/GUI/ResourcesTests.cs index 1322f58ad..745b06f03 100644 --- a/Tests/GUI/ResourcesTests.cs +++ b/Tests/GUI/ResourcesTests.cs @@ -22,7 +22,7 @@ public class ResourcesTests public void PropertiesResources_AllLocales_LanguageNotSetAndAllStrings() { // Arrange - ResourceManager resources = new CKAN.GUI.SingleAssemblyResourceManager( + ResourceManager resources = new CKAN.SingleAssemblyResourceManager( "CKAN.GUI.Properties.Resources", typeof(CKAN.GUI.Properties.Resources).Assembly); // Act/Assert @@ -62,6 +62,7 @@ public void PropertiesResources_AllLocales_LanguageNotSetAndAllStrings() TestCase(typeof(CKAN.GUI.ChooseRecommendedMods)), TestCase(typeof(CKAN.GUI.DeleteDirectories)), TestCase(typeof(CKAN.GUI.EditModpack)), + TestCase(typeof(CKAN.GUI.EditModSearchDetails)), TestCase(typeof(CKAN.GUI.EditModSearch)), TestCase(typeof(CKAN.GUI.InstallationHistory)), TestCase(typeof(CKAN.GUI.ManageMods)), @@ -88,6 +89,7 @@ public void PropertiesResources_AllLocales_LanguageNotSetAndAllStrings() TestCase(typeof(CKAN.GUI.PreferredHostsDialog)), TestCase(typeof(CKAN.GUI.RenameInstanceDialog)), TestCase(typeof(CKAN.GUI.SelectionDialog)), + TestCase(typeof(CKAN.GUI.SettingsDialog)), TestCase(typeof(CKAN.GUI.YesNoDialog)), ] public void ControlOrDialog_AllLocales_LanguageNotSetAndAllStrings(Type t) From 822492492cbe3c10f59e5e39257d2b8afa337177 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Mon, 10 Feb 2025 12:49:38 -0600 Subject: [PATCH 4/9] Fix crash with error dialog --- GUI/Dialogs/ErrorDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI/Dialogs/ErrorDialog.cs b/GUI/Dialogs/ErrorDialog.cs index 4d3aa8784..4917b6632 100644 --- a/GUI/Dialogs/ErrorDialog.cs +++ b/GUI/Dialogs/ErrorDialog.cs @@ -24,7 +24,7 @@ public ErrorDialog() [ForbidGUICalls] public void ShowErrorDialog(Main mainForm, string text, params object[] args) { - Util.Invoke(this, () => + Util.Invoke(mainForm, () => { log.ErrorFormat(text, args); // Append to previous text, if any From 16a827736685dfec7880867e489c70b8cb5a622c Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 19 Feb 2025 22:47:49 -0600 Subject: [PATCH 5/9] Disable add search button when all searches empty --- GUI/Controls/EditModSearches.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI/Controls/EditModSearches.cs b/GUI/Controls/EditModSearches.cs index f06645f57..0bcad0956 100644 --- a/GUI/Controls/EditModSearches.cs +++ b/GUI/Controls/EditModSearches.cs @@ -190,7 +190,7 @@ private void Apply() var searches = editors.Select(ems => ems.Search) .ToList(); ApplySearches?.Invoke(searches.Count == 0 ? null : searches); - AddSearchButton.Enabled = editors.Count == searches.Count; + AddSearchButton.Enabled = editors.Count == searches.OfType().Count(); } private void EditModSearch_SurrenderFocus() From 6da2b14b80946dc5d2eb1b118cb326675e046d90 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 19 Feb 2025 23:35:56 -0600 Subject: [PATCH 6/9] Show download size in download button --- GUI/Controls/ModInfoTabs/Contents.cs | 2 ++ GUI/Properties/Resources.resx | 1 + 2 files changed, 3 insertions(+) diff --git a/GUI/Controls/ModInfoTabs/Contents.cs b/GUI/Controls/ModInfoTabs/Contents.cs index 6ec00406d..02dcd8700 100644 --- a/GUI/Controls/ModInfoTabs/Contents.cs +++ b/GUI/Controls/ModInfoTabs/Contents.cs @@ -41,6 +41,8 @@ public GUIMod? SelectedModule selectedModule = value; if (selectedModule != null) { + ContentsDownloadButton.Text = string.Format(Properties.Resources.ModInfoDownload, + CkanModule.FmtSize(selectedModule.ToModule().download_size)); selectedModule.PropertyChanged += SelectedMod_PropertyChanged; } Util.Invoke(ContentsPreviewTree, diff --git a/GUI/Properties/Resources.resx b/GUI/Properties/Resources.resx index ac8381b6f..d25fb0b5c 100644 --- a/GUI/Properties/Resources.resx +++ b/GUI/Properties/Resources.resx @@ -285,6 +285,7 @@ If you suspect a bug in the client: https://github.com/KSP-CKAN/CKAN/issues/new/ {0} (not indexed) This mod is not in the cache, click 'Download' to preview contents Module is cached, preview available + Download ({0}) Module has no download Folder not found! File not found! From 0a1cd13a23c32a77a988e73373e5f6a9163c8b82 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Mon, 10 Feb 2025 23:25:46 -0600 Subject: [PATCH 7/9] Generate play dropdown on open --- GUI/Controls/ManageMods.Designer.cs | 5 ++++- GUI/Controls/ManageMods.cs | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/GUI/Controls/ManageMods.Designer.cs b/GUI/Controls/ManageMods.Designer.cs index 598a97d1f..30243d40b 100644 --- a/GUI/Controls/ManageMods.Designer.cs +++ b/GUI/Controls/ManageMods.Designer.cs @@ -121,13 +121,16 @@ private void InitializeComponent() // // LaunchGameToolStripMenuItem // - this.LaunchGameToolStripMenuItem.MouseHover += new System.EventHandler(LaunchGameToolStripMenuItem_MouseHover); + this.LaunchGameToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + EditCommandLinesToolStripMenuItem}); this.LaunchGameToolStripMenuItem.Image = global::CKAN.GUI.EmbeddedImages.ksp; this.LaunchGameToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.LaunchGameToolStripMenuItem.MouseHover += new System.EventHandler(LaunchGameToolStripMenuItem_MouseHover); this.LaunchGameToolStripMenuItem.Name = "LaunchGameToolStripMenuItem"; this.LaunchGameToolStripMenuItem.Size = new System.Drawing.Size(146, 56); this.LaunchGameToolStripMenuItem.Overflow = System.Windows.Forms.ToolStripItemOverflow.AsNeeded; this.LaunchGameToolStripMenuItem.Click += new System.EventHandler(this.LaunchGameToolStripMenuItem_Click); + this.LaunchGameToolStripMenuItem.DropDown.Opening += new System.ComponentModel.CancelEventHandler(LaunchGameToolStripMenuItem_DropDown_Opening); resources.ApplyResources(this.LaunchGameToolStripMenuItem, "LaunchGameToolStripMenuItem"); // // EditCommandLinesToolStripMenuItem diff --git a/GUI/Controls/ManageMods.cs b/GUI/Controls/ManageMods.cs index 86e60a284..3b2bc2d57 100644 --- a/GUI/Controls/ManageMods.cs +++ b/GUI/Controls/ManageMods.cs @@ -583,6 +583,14 @@ private void ApplyToolButton_Click(object? sender, EventArgs? e) } private void LaunchGameToolStripMenuItem_MouseHover(object? sender, EventArgs? e) + { + if (guiConfig != null) + { + LaunchGameToolStripMenuItem.ShowDropDown(); + } + } + + private void LaunchGameToolStripMenuItem_DropDown_Opening(object? sender, CancelEventArgs? e) { if (guiConfig != null) { @@ -599,7 +607,6 @@ private void LaunchGameToolStripMenuItem_MouseHover(object? sender, EventArgs? e .Append(CommandLinesToolStripSeparator) .Append(EditCommandLinesToolStripMenuItem) .ToArray()); - LaunchGameToolStripMenuItem.ShowDropDown(); } } From 70a4582d66418b510f1fcbeb1c711c52fb43086d Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Mon, 10 Feb 2025 12:49:50 -0600 Subject: [PATCH 8/9] Better alignment of bottom buttons on Mono --- GUI/Controls/LeftRightRowPanel.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GUI/Controls/LeftRightRowPanel.cs b/GUI/Controls/LeftRightRowPanel.cs index 11cc969ba..b7a60911b 100644 --- a/GUI/Controls/LeftRightRowPanel.cs +++ b/GUI/Controls/LeftRightRowPanel.cs @@ -20,6 +20,7 @@ public class LeftRightRowPanel : TableLayoutPanel /// Initialize the control. /// public LeftRightRowPanel() + : base() { LeftPanel = new FlowLayoutPanel() { @@ -53,8 +54,10 @@ public LeftRightRowPanel() GrowStyle = TableLayoutPanelGrowStyle.FixedSize; ColumnCount = 2; - ColumnStyles.Add(new ColumnStyle()); - ColumnStyles.Add(new ColumnStyle()); + ColumnStyles.Add(Platform.IsMono ? new ColumnStyle(SizeType.Percent, 50F) + : new ColumnStyle()); + ColumnStyles.Add(Platform.IsMono ? new ColumnStyle(SizeType.Percent, 50F) + : new ColumnStyle()); RowCount = 1; RowStyles.Add(new RowStyle()); From 8eec07247d3ef8e84489b4454ec5e26f3aebf1d8 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Thu, 5 Dec 2024 20:35:19 -0600 Subject: [PATCH 9/9] Fix GUI layout issues with scaling --- GUI/Controls/Changeset.Designer.cs | 3 +- GUI/Controls/ChooseProvidedMods.Designer.cs | 3 +- .../ChooseRecommendedMods.Designer.cs | 3 +- GUI/Controls/DeleteDirectories.Designer.cs | 3 +- GUI/Controls/EditModSearch.Designer.cs | 3 +- GUI/Controls/EditModSearchDetails.Designer.cs | 3 +- GUI/Controls/EditModSearches.Designer.cs | 4 +- GUI/Controls/EditModSearches.cs | 15 +- GUI/Controls/EditModpack.Designer.cs | 3 +- GUI/Controls/InstallationHistory.Designer.cs | 8 + GUI/Controls/InstallationHistory.cs | 14 +- GUI/Controls/InstallationHistory.resx | 1 + GUI/Controls/ManageMods.Designer.cs | 6 +- GUI/Controls/ManageMods.cs | 14 + GUI/Controls/ModInfo.Designer.cs | 26 +- GUI/Controls/ModInfoTabs/Contents.Designer.cs | 42 ++- GUI/Controls/ModInfoTabs/Metadata.Designer.cs | 268 +++++++++--------- .../ModInfoTabs/Relationships.Designer.cs | 104 ++++--- GUI/Controls/ModInfoTabs/Relationships.cs | 103 +++---- GUI/Controls/ModInfoTabs/Versions.Designer.cs | 2 +- GUI/Controls/PlayTime.Designer.cs | 3 +- GUI/Controls/Wait.Designer.cs | 3 +- GUI/Dialogs/AboutDialog.Designer.cs | 2 +- .../AskUserForAutoUpdatesDialog.Designer.cs | 2 +- .../CloneGameInstanceDialog.Designer.cs | 8 + .../CompatibleGameVersionsDialog.Designer.cs | 10 +- GUI/Dialogs/DownloadsFailedDialog.Designer.cs | 4 +- GUI/Dialogs/ErrorDialog.Designer.cs | 4 +- .../GameCommandLineOptionsDialog.Designer.cs | 2 +- GUI/Dialogs/InstallFiltersDialog.Designer.cs | 7 +- .../ManageGameInstancesDialog.Designer.cs | 8 + GUI/Dialogs/NewRepoDialog.Designer.cs | 3 +- GUI/Dialogs/NewUpdateDialog.Designer.cs | 6 +- GUI/Dialogs/PluginsDialog.Designer.cs | 13 +- GUI/Dialogs/PluginsDialog.cs | 1 - GUI/Dialogs/PreferredHostsDialog.Designer.cs | 4 +- GUI/Dialogs/RenameInstanceDialog.Designer.cs | 6 +- GUI/Dialogs/SelectionDialog.Designer.cs | 2 +- GUI/Dialogs/YesNoDialog.Designer.cs | 2 +- GUI/Main/Main.Designer.cs | 6 +- 40 files changed, 437 insertions(+), 287 deletions(-) diff --git a/GUI/Controls/Changeset.Designer.cs b/GUI/Controls/Changeset.Designer.cs index 4b0093a16..1ad135870 100644 --- a/GUI/Controls/Changeset.Designer.cs +++ b/GUI/Controls/Changeset.Designer.cs @@ -175,7 +175,8 @@ private void InitializeComponent() // // Changeset // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.ChangesGrid); this.Controls.Add(this.CloseTheGameLabel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Controls/ChooseProvidedMods.Designer.cs b/GUI/Controls/ChooseProvidedMods.Designer.cs index f0da91877..13b6e1bce 100644 --- a/GUI/Controls/ChooseProvidedMods.Designer.cs +++ b/GUI/Controls/ChooseProvidedMods.Designer.cs @@ -115,7 +115,8 @@ private void InitializeComponent() // // ChooseProvidedMods // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.ChooseProvidedModsListView); this.Controls.Add(this.ChooseProvidedModsLabel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Controls/ChooseRecommendedMods.Designer.cs b/GUI/Controls/ChooseRecommendedMods.Designer.cs index daff9b8d3..8a8277ab4 100644 --- a/GUI/Controls/ChooseRecommendedMods.Designer.cs +++ b/GUI/Controls/ChooseRecommendedMods.Designer.cs @@ -217,7 +217,8 @@ private void InitializeComponent() // // ChooseRecommendedMods // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.RecommendedModsListView); this.Controls.Add(this.RecommendedDialogLabel); this.Controls.Add(this.Toolbar); diff --git a/GUI/Controls/DeleteDirectories.Designer.cs b/GUI/Controls/DeleteDirectories.Designer.cs index 3aa397754..79b7869b6 100644 --- a/GUI/Controls/DeleteDirectories.Designer.cs +++ b/GUI/Controls/DeleteDirectories.Designer.cs @@ -170,7 +170,8 @@ private void InitializeComponent() // // DeleteDirectories // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.Splitter); this.Controls.Add(this.ExplanationLabel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Controls/EditModSearch.Designer.cs b/GUI/Controls/EditModSearch.Designer.cs index 0268d0bed..7ed1a24e1 100644 --- a/GUI/Controls/EditModSearch.Designer.cs +++ b/GUI/Controls/EditModSearch.Designer.cs @@ -107,7 +107,8 @@ private void InitializeComponent() // // EditModSearch // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.FilterCombinedLabel); this.Controls.Add(this.FilterOrLabel); this.Controls.Add(this.ExpandButton); diff --git a/GUI/Controls/EditModSearchDetails.Designer.cs b/GUI/Controls/EditModSearchDetails.Designer.cs index f91a604ad..0f075aaa7 100644 --- a/GUI/Controls/EditModSearchDetails.Designer.cs +++ b/GUI/Controls/EditModSearchDetails.Designer.cs @@ -455,7 +455,8 @@ private void InitializeComponent() // // EditModSearchDetails // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.BackColor = System.Drawing.SystemColors.Control; this.Controls.Add(this.FilterByAuthorTextBox); diff --git a/GUI/Controls/EditModSearches.Designer.cs b/GUI/Controls/EditModSearches.Designer.cs index 5668d50c3..8fec63dcf 100644 --- a/GUI/Controls/EditModSearches.Designer.cs +++ b/GUI/Controls/EditModSearches.Designer.cs @@ -53,7 +53,7 @@ private void InitializeComponent() this.AddSearchButton.Name = "AddSearchButton"; this.AddSearchButton.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0); this.AddSearchButton.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); - this.AddSearchButton.Size = new System.Drawing.Size(22, 22); + this.AddSearchButton.Size = new System.Drawing.Size(20, 26); this.AddSearchButton.TabIndex = 1; this.AddSearchButton.Text = "+"; this.AddSearchButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -64,7 +64,7 @@ private void InitializeComponent() // this.Controls.Add(this.AddSearchButton); this.Name = "EditModSearches"; - this.Size = new System.Drawing.Size(500, 29); + this.Size = new System.Drawing.Size(500, 35); this.ResumeLayout(false); this.PerformLayout(); } diff --git a/GUI/Controls/EditModSearches.cs b/GUI/Controls/EditModSearches.cs index 0bcad0956..46e14cff2 100644 --- a/GUI/Controls/EditModSearches.cs +++ b/GUI/Controls/EditModSearches.cs @@ -21,7 +21,6 @@ public EditModSearches() { InitializeComponent(); ToolTip.SetToolTip(AddSearchButton, Properties.Resources.EditModSearchesTooltipAddSearchButton); - ActiveControl = AddSearch(); } public event Action? SurrenderFocus; @@ -69,6 +68,10 @@ public void SetSearches(List searches) { RemoveSearch(editors[^1]); } + if (editors.Count < 1) + { + ActiveControl = AddSearch(); + } if (searches.Count < 1) { if (//editors is [var editor] @@ -116,8 +119,6 @@ private void AddSearchButton_Click(object? sender, EventArgs? e) private EditModSearch AddSearch() { - SuspendLayout(); - var ctl = new EditModSearch() { // Dock handles the layout for us @@ -136,9 +137,6 @@ private EditModSearch AddSearch() // Still need to be able to see the add button, without this it's covered up AddSearchButton.BringToFront(); - ResumeLayout(false); - PerformLayout(); - Height = editors.Sum(ems => ems.Height); return ctl; @@ -148,8 +146,6 @@ private void RemoveSearch(EditModSearch which) { if (editors.Count >= 2) { - SuspendLayout(); - if (which == ActiveControl) { // Move focus to next control, or previous if last in list @@ -169,9 +165,6 @@ private void RemoveSearch(EditModSearch which) editor.ShowLabel = true; } - ResumeLayout(false); - PerformLayout(); - Height = editors.Sum(ems => ems.Height); } } diff --git a/GUI/Controls/EditModpack.Designer.cs b/GUI/Controls/EditModpack.Designer.cs index dcb8381d6..0bab50a9f 100644 --- a/GUI/Controls/EditModpack.Designer.cs +++ b/GUI/Controls/EditModpack.Designer.cs @@ -421,7 +421,8 @@ private void InitializeComponent() // // EditModpack // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.RelationshipsListView); this.Controls.Add(this.TopEditPanel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Controls/InstallationHistory.Designer.cs b/GUI/Controls/InstallationHistory.Designer.cs index 48be3020a..515070726 100644 --- a/GUI/Controls/InstallationHistory.Designer.cs +++ b/GUI/Controls/InstallationHistory.Designer.cs @@ -44,6 +44,7 @@ private void InitializeComponent() this.AuthorColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.DescriptionColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.SelectInstallMessage = new System.Windows.Forms.ListViewItem(); + this.LoadingMessage = new System.Windows.Forms.ListViewItem(); this.NoModsMessage = new System.Windows.Forms.ListViewItem(); this.BottomButtonPanel = new CKAN.GUI.LeftRightRowPanel(); this.OKButton = new System.Windows.Forms.Button(); @@ -180,6 +181,10 @@ private void InitializeComponent() // resources.ApplyResources(this.SelectInstallMessage, "SelectInstallMessage"); // + // LoadingMessage + // + resources.ApplyResources(this.LoadingMessage, "LoadingMessage"); + // // NoModsMessage // resources.ApplyResources(this.NoModsMessage, "NoModsMessage"); @@ -203,6 +208,8 @@ private void InitializeComponent() // // InstallationHistory // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.Splitter); this.Controls.Add(this.Toolbar); this.Controls.Add(this.BottomButtonPanel); @@ -231,6 +238,7 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader AuthorColumn; private System.Windows.Forms.ColumnHeader DescriptionColumn; private System.Windows.Forms.ListViewItem SelectInstallMessage; + private System.Windows.Forms.ListViewItem LoadingMessage; private System.Windows.Forms.ListViewItem NoModsMessage; private CKAN.GUI.LeftRightRowPanel BottomButtonPanel; private System.Windows.Forms.Button OKButton; diff --git a/GUI/Controls/InstallationHistory.cs b/GUI/Controls/InstallationHistory.cs index 1f82a2e65..7aa9b7c4c 100644 --- a/GUI/Controls/InstallationHistory.cs +++ b/GUI/Controls/InstallationHistory.cs @@ -19,13 +19,18 @@ public InstallationHistory() InitializeComponent(); } - public void LoadHistory(GameInstance inst, GUIConfiguration config, RepositoryDataManager repoData) + public void LoadHistory(GameInstance inst, + GUIConfiguration config, + RepositoryDataManager repoData) { - this.inst = inst; - registry = RegistryManager.Instance(inst, repoData).registry; - this.config = config; + this.inst = inst; + registry = RegistryManager.Instance(inst, repoData).registry; + this.config = config; Util.Invoke(this, () => { + HistoryListView.Items.Clear(); + ModsListView.Items.Clear(); + ModsListView.Items.Add(LoadingMessage); UseWaitCursor = true; Task.Factory.StartNew(() => { @@ -38,7 +43,6 @@ public void LoadHistory(GameInstance inst, GUIConfiguration config, RepositoryDa Util.Invoke(this, () => { HistoryListView.BeginUpdate(); - HistoryListView.Items.Clear(); HistoryListView.Items.AddRange(items); HistoryListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); Splitter.Panel1MinSize = Splitter.SplitterDistance = diff --git a/GUI/Controls/InstallationHistory.resx b/GUI/Controls/InstallationHistory.resx index 66e56a174..06df0c5a2 100644 --- a/GUI/Controls/InstallationHistory.resx +++ b/GUI/Controls/InstallationHistory.resx @@ -125,6 +125,7 @@ Authors Description Click a timestamp at the left to see which mods were installed + Loading installation history... No mods were installed Install OK diff --git a/GUI/Controls/ManageMods.Designer.cs b/GUI/Controls/ManageMods.Designer.cs index 30243d40b..d2abea5f1 100644 --- a/GUI/Controls/ManageMods.Designer.cs +++ b/GUI/Controls/ManageMods.Designer.cs @@ -327,6 +327,7 @@ private void InitializeComponent() this.ModGrid.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.SystemColors.Control; this.ModGrid.ColumnHeadersDefaultCellStyle.SelectionBackColor = System.Drawing.SystemColors.Control; this.ModGrid.ColumnHeadersDefaultCellStyle.ForeColor = System.Drawing.SystemColors.ControlText; + this.ModGrid.ColumnHeadersDefaultCellStyle.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); this.ModGrid.DefaultCellStyle.ForeColor = System.Drawing.SystemColors.WindowText; this.ModGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.ModGrid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; @@ -561,14 +562,15 @@ private void InitializeComponent() this.hiddenTagsLabelsLinkList.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); this.hiddenTagsLabelsLinkList.Location = new System.Drawing.Point(0, 0); this.hiddenTagsLabelsLinkList.Name = "hiddenTagsLabelsLinkList"; - this.hiddenTagsLabelsLinkList.Size = new System.Drawing.Size(500, 20); + this.hiddenTagsLabelsLinkList.Size = new System.Drawing.Size(500, 22); this.hiddenTagsLabelsLinkList.TagClicked += this.hiddenTagsLabelsLinkList_TagClicked; this.hiddenTagsLabelsLinkList.LabelClicked += this.hiddenTagsLabelsLinkList_LabelClicked; resources.ApplyResources(this.hiddenTagsLabelsLinkList, "hiddenTagsLabelsLinkList"); // // ManageMods // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.InstallAllCheckbox); this.Controls.Add(this.ModGrid); this.Controls.Add(this.hiddenTagsLabelsLinkList); diff --git a/GUI/Controls/ManageMods.cs b/GUI/Controls/ManageMods.cs index 3b2bc2d57..51878bc22 100644 --- a/GUI/Controls/ManageMods.cs +++ b/GUI/Controls/ManageMods.cs @@ -62,9 +62,23 @@ public ManageMods() ModListContextMenuStrip.Renderer = new FlatToolStripRenderer(); ModListHeaderContextMenuStrip.Renderer = new FlatToolStripRenderer(); LabelsContextMenuStrip.Renderer = new FlatToolStripRenderer(); + + ModGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + ResizeColumnHeaders(); + ModGrid.ColumnWidthChanged += (sender, e) => ResizeColumnHeaders(); } } + private void ResizeColumnHeaders() + { + var g = CreateGraphics(); + ModGrid.ColumnHeadersHeight = ModGrid.Columns.OfType().Max(col => + ModGrid.ColumnHeadersDefaultCellStyle.Padding.Vertical + + Util.StringHeight(g, col.HeaderText, + col.HeaderCell?.Style?.Font ?? ModGrid.ColumnHeadersDefaultCellStyle.Font, + col.Width - (2 * ModGrid.ColumnHeadersDefaultCellStyle.Padding.Horizontal))); + } + private static readonly ILog log = LogManager.GetLogger(typeof(ManageMods)); private readonly RepositoryDataManager repoData; private DateTime lastSearchTime; diff --git a/GUI/Controls/ModInfo.Designer.cs b/GUI/Controls/ModInfo.Designer.cs index 06ee3c718..0c6e4845c 100644 --- a/GUI/Controls/ModInfo.Designer.cs +++ b/GUI/Controls/ModInfo.Designer.cs @@ -45,6 +45,14 @@ private void InitializeComponent() this.VersionsTabPage = new System.Windows.Forms.TabPage(); this.Versions = new CKAN.GUI.Versions(); this.ModInfoTable.SuspendLayout(); + this.MetadataTabPage.SuspendLayout(); + this.RelationshipTabPage.SuspendLayout(); + this.ContentTabPage.SuspendLayout(); + this.VersionsTabPage.SuspendLayout(); + this.Metadata.SuspendLayout(); + this.Relationships.SuspendLayout(); + this.Contents.SuspendLayout(); + this.Versions.SuspendLayout(); this.SuspendLayout(); // // ModInfoTable @@ -208,13 +216,29 @@ private void InitializeComponent() // // ModInfo // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.ModInfoTable); this.Name = "ModInfo"; this.Padding = new System.Windows.Forms.Padding(0); this.Size = new System.Drawing.Size(500, 500); resources.ApplyResources(this, "$this"); + this.Metadata.ResumeLayout(false); + this.Metadata.PerformLayout(); + this.Relationships.ResumeLayout(false); + this.Relationships.PerformLayout(); + this.Contents.ResumeLayout(false); + this.Contents.PerformLayout(); + this.Versions.ResumeLayout(false); + this.Versions.PerformLayout(); + this.MetadataTabPage.ResumeLayout(false); + this.MetadataTabPage.PerformLayout(); + this.RelationshipTabPage.ResumeLayout(false); + this.RelationshipTabPage.PerformLayout(); + this.ContentTabPage.ResumeLayout(false); + this.ContentTabPage.PerformLayout(); + this.VersionsTabPage.ResumeLayout(false); + this.VersionsTabPage.PerformLayout(); this.ModInfoTable.ResumeLayout(false); this.ModInfoTable.PerformLayout(); this.ResumeLayout(false); diff --git a/GUI/Controls/ModInfoTabs/Contents.Designer.cs b/GUI/Controls/ModInfoTabs/Contents.Designer.cs index 50f651b0e..ab20ae8b3 100644 --- a/GUI/Controls/ModInfoTabs/Contents.Designer.cs +++ b/GUI/Controls/ModInfoTabs/Contents.Designer.cs @@ -30,18 +30,38 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(Contents)); + this.ButtonsTable = new System.Windows.Forms.TableLayoutPanel(); this.NotCachedLabel = new System.Windows.Forms.Label(); this.ContentsPreviewTree = new System.Windows.Forms.TreeView(); this.ContentsDownloadButton = new System.Windows.Forms.Button(); this.ContentsOpenButton = new System.Windows.Forms.Button(); + this.ButtonsTable.SuspendLayout(); this.SuspendLayout(); // + // ButtonsTable + // + this.ButtonsTable.AutoSize = true; + this.ButtonsTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.ButtonsTable.ColumnCount = 2; + this.ButtonsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.ButtonsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.ButtonsTable.Controls.Add(this.ContentsDownloadButton, 0, 0); + this.ButtonsTable.Controls.Add(this.ContentsOpenButton, 1, 0); + this.ButtonsTable.Dock = System.Windows.Forms.DockStyle.Top; + this.ButtonsTable.Location = new System.Drawing.Point(0, 10); + this.ButtonsTable.Name = "ButtonsTable"; + this.ButtonsTable.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); + this.ButtonsTable.RowCount = 1; + this.ButtonsTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.ButtonsTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.ButtonsTable.Size = new System.Drawing.Size(346, 255); + this.ButtonsTable.TabIndex = 0; + // // NotCachedLabel // - this.NotCachedLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.NotCachedLabel.Dock = System.Windows.Forms.DockStyle.Top; this.NotCachedLabel.Location = new System.Drawing.Point(3, 3); + this.NotCachedLabel.Padding = new System.Windows.Forms.Padding(0, 6, 0, 6); this.NotCachedLabel.Name = "NotCachedLabel"; this.NotCachedLabel.Size = new System.Drawing.Size(494, 30); this.NotCachedLabel.TabIndex = 0; @@ -49,6 +69,8 @@ private void InitializeComponent() // // ContentsDownloadButton // + this.ContentsDownloadButton.AutoSize = true; + this.ContentsDownloadButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ContentsDownloadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ContentsDownloadButton.Location = new System.Drawing.Point(6, 36); this.ContentsDownloadButton.Name = "ContentsDownloadButton"; @@ -60,6 +82,8 @@ private void InitializeComponent() // // ContentsOpenButton // + this.ContentsOpenButton.AutoSize = true; + this.ContentsOpenButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ContentsOpenButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ContentsOpenButton.Location = new System.Drawing.Point(115, 36); this.ContentsOpenButton.Name = "ContentsOpenButton"; @@ -71,10 +95,8 @@ private void InitializeComponent() // // ContentsPreviewTree // - this.ContentsPreviewTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.ContentsPreviewTree.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ContentsPreviewTree.Dock = System.Windows.Forms.DockStyle.Fill; this.ContentsPreviewTree.ImageList = new System.Windows.Forms.ImageList(this.components) { // ImageList's default makes icons look like garbage @@ -97,13 +119,16 @@ private void InitializeComponent() // // Contents // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.ContentsPreviewTree); - this.Controls.Add(this.ContentsDownloadButton); - this.Controls.Add(this.ContentsOpenButton); + this.Controls.Add(this.ButtonsTable); this.Controls.Add(this.NotCachedLabel); this.Name = "Contents"; this.Size = new System.Drawing.Size(500, 500); resources.ApplyResources(this, "$this"); + this.ButtonsTable.ResumeLayout(false); + this.ButtonsTable.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } @@ -111,6 +136,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Label NotCachedLabel; + private System.Windows.Forms.TableLayoutPanel ButtonsTable; private System.Windows.Forms.Button ContentsDownloadButton; private System.Windows.Forms.Button ContentsOpenButton; private System.Windows.Forms.TreeView ContentsPreviewTree; diff --git a/GUI/Controls/ModInfoTabs/Metadata.Designer.cs b/GUI/Controls/ModInfoTabs/Metadata.Designer.cs index 8ee765740..ce4194498 100644 --- a/GUI/Controls/ModInfoTabs/Metadata.Designer.cs +++ b/GUI/Controls/ModInfoTabs/Metadata.Designer.cs @@ -32,20 +32,20 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(Metadata)); this.ToolTip = new System.Windows.Forms.ToolTip(); this.MetadataTable = new System.Windows.Forms.TableLayoutPanel(); - this.IdentifierLabel = new System.Windows.Forms.Label(); - this.MetadataIdentifierTextBox = new TransparentTextBox(); - this.ReplacementLabel = new System.Windows.Forms.Label(); - this.ReplacementTextBox = new TransparentTextBox(); - this.GameCompatibilityLabel = new System.Windows.Forms.Label(); - this.ReleaseLabel = new System.Windows.Forms.Label(); - this.AuthorLabel = new System.Windows.Forms.Label(); + this.VersionLabel = new System.Windows.Forms.Label(); + this.MetadataModuleVersionTextBox = new CKAN.GUI.TransparentTextBox(); this.LicenseLabel = new System.Windows.Forms.Label(); - this.MetadataModuleVersionTextBox = new TransparentTextBox(); - this.MetadataModuleLicenseTextBox = new TransparentTextBox(); + this.MetadataModuleLicenseTextBox = new CKAN.GUI.TransparentTextBox(); + this.AuthorLabel = new System.Windows.Forms.Label(); this.AuthorsPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.VersionLabel = new System.Windows.Forms.Label(); - this.MetadataModuleReleaseStatusTextBox = new TransparentTextBox(); - this.MetadataModuleGameCompatibilityTextBox = new TransparentTextBox(); + this.ReleaseLabel = new System.Windows.Forms.Label(); + this.MetadataModuleReleaseStatusTextBox = new CKAN.GUI.TransparentTextBox(); + this.GameCompatibilityLabel = new System.Windows.Forms.Label(); + this.MetadataModuleGameCompatibilityTextBox = new CKAN.GUI.TransparentTextBox(); + this.IdentifierLabel = new System.Windows.Forms.Label(); + this.MetadataIdentifierTextBox = new CKAN.GUI.TransparentTextBox(); + this.ReplacementLabel = new System.Windows.Forms.Label(); + this.ReplacementTextBox = new CKAN.GUI.TransparentTextBox(); this.SuspendLayout(); // // ToolTip @@ -59,8 +59,8 @@ private void InitializeComponent() // this.MetadataTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.MetadataTable.ColumnCount = 2; - this.MetadataTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 90F)); - this.MetadataTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.MetadataTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); this.MetadataTable.Controls.Add(this.VersionLabel, 0, 0); this.MetadataTable.Controls.Add(this.MetadataModuleVersionTextBox, 1, 0); this.MetadataTable.Controls.Add(this.LicenseLabel, 0, 1); @@ -80,110 +80,27 @@ private void InitializeComponent() this.MetadataTable.Name = "MetadataTable"; this.MetadataTable.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0); this.MetadataTable.RowCount = 7; - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.MetadataTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); this.MetadataTable.Size = new System.Drawing.Size(346, 255); this.MetadataTable.AutoSize = true; this.MetadataTable.TabIndex = 0; // - // IdentifierLabel - // - this.IdentifierLabel.AutoSize = true; - this.IdentifierLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.IdentifierLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.IdentifierLabel.Location = new System.Drawing.Point(3, 210); - this.IdentifierLabel.Name = "IdentifierLabel"; - this.IdentifierLabel.Size = new System.Drawing.Size(84, 20); - this.IdentifierLabel.TabIndex = 28; - resources.ApplyResources(this.IdentifierLabel, "IdentifierLabel"); - // - // MetadataIdentifierTextBox - // - this.MetadataIdentifierTextBox.AutoSize = true; - this.MetadataIdentifierTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.MetadataIdentifierTextBox.Location = new System.Drawing.Point(93, 210); - this.MetadataIdentifierTextBox.Name = "MetadataIdentifierTextBox"; - this.MetadataIdentifierTextBox.Size = new System.Drawing.Size(250, 20); - this.MetadataIdentifierTextBox.TabIndex = 27; - this.MetadataIdentifierTextBox.ReadOnly = true; - this.MetadataIdentifierTextBox.BackColor = System.Drawing.SystemColors.Control; - this.MetadataIdentifierTextBox.ForeColor = System.Drawing.SystemColors.ControlText; - this.MetadataIdentifierTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.MetadataIdentifierTextBox, "MetadataIdentifierTextBox"); - // - // ReplacementLabel - // - this.ReplacementLabel.AutoSize = true; - this.ReplacementLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.ReplacementLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.ReplacementLabel.Location = new System.Drawing.Point(3, 240); - this.ReplacementLabel.Name = "ReplacementLabel"; - this.ReplacementLabel.Size = new System.Drawing.Size(84, 20); - this.ReplacementLabel.TabIndex = 28; - resources.ApplyResources(this.ReplacementLabel, "ReplacementLabel"); - // - // ReplacementTextBox - // - this.ReplacementTextBox.AutoSize = true; - this.ReplacementTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.ReplacementTextBox.Location = new System.Drawing.Point(93, 240); - this.ReplacementTextBox.Name = "ReplacementTextBox"; - this.ReplacementTextBox.Size = new System.Drawing.Size(250, 20); - this.ReplacementTextBox.TabIndex = 27; - this.ReplacementTextBox.ReadOnly = true; - this.ReplacementTextBox.BackColor = System.Drawing.SystemColors.Control; - this.ReplacementTextBox.ForeColor = System.Drawing.SystemColors.ControlText; - this.ReplacementTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.ReplacementTextBox, "ReplacementTextBox"); - // - // GameCompatibilityLabel - // - this.GameCompatibilityLabel.AutoSize = true; - this.GameCompatibilityLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.GameCompatibilityLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.GameCompatibilityLabel.Location = new System.Drawing.Point(3, 180); - this.GameCompatibilityLabel.Name = "GameCompatibilityLabel"; - this.GameCompatibilityLabel.Size = new System.Drawing.Size(84, 30); - this.GameCompatibilityLabel.TabIndex = 13; - resources.ApplyResources(this.GameCompatibilityLabel, "GameCompatibilityLabel"); - // - // ReleaseLabel - // - this.ReleaseLabel.AutoSize = true; - this.ReleaseLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.ReleaseLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.ReleaseLabel.Location = new System.Drawing.Point(3, 150); - this.ReleaseLabel.Name = "ReleaseLabel"; - this.ReleaseLabel.Size = new System.Drawing.Size(84, 30); - this.ReleaseLabel.TabIndex = 12; - resources.ApplyResources(this.ReleaseLabel, "ReleaseLabel"); - // - // AuthorLabel - // - this.AuthorLabel.AutoSize = true; - this.AuthorLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.AuthorLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.AuthorLabel.Location = new System.Drawing.Point(3, 60); - this.AuthorLabel.Name = "AuthorLabel"; - this.AuthorLabel.Size = new System.Drawing.Size(84, 30); - this.AuthorLabel.TabIndex = 5; - resources.ApplyResources(this.AuthorLabel, "AuthorLabel"); - // - // LicenseLabel + // VersionLabel // - this.LicenseLabel.AutoSize = true; - this.LicenseLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.LicenseLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.LicenseLabel.Location = new System.Drawing.Point(3, 30); - this.LicenseLabel.Name = "LicenseLabel"; - this.LicenseLabel.Size = new System.Drawing.Size(84, 30); - this.LicenseLabel.TabIndex = 3; - resources.ApplyResources(this.LicenseLabel, "LicenseLabel"); + this.VersionLabel.AutoSize = true; + this.VersionLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.VersionLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.VersionLabel.Location = new System.Drawing.Point(3, 0); + this.VersionLabel.Name = "VersionLabel"; + this.VersionLabel.Size = new System.Drawing.Size(84, 30); + this.VersionLabel.TabIndex = 1; + resources.ApplyResources(this.VersionLabel, "VersionLabel"); // // MetadataModuleVersionTextBox // @@ -199,6 +116,17 @@ private void InitializeComponent() this.MetadataModuleVersionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; resources.ApplyResources(this.MetadataModuleVersionTextBox, "MetadataModuleVersionTextBox"); // + // LicenseLabel + // + this.LicenseLabel.AutoSize = true; + this.LicenseLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.LicenseLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.LicenseLabel.Location = new System.Drawing.Point(3, 30); + this.LicenseLabel.Name = "LicenseLabel"; + this.LicenseLabel.Size = new System.Drawing.Size(84, 30); + this.LicenseLabel.TabIndex = 3; + resources.ApplyResources(this.LicenseLabel, "LicenseLabel"); + // // MetadataModuleLicenseTextBox // this.MetadataModuleLicenseTextBox.AutoSize = true; @@ -213,6 +141,17 @@ private void InitializeComponent() this.MetadataModuleLicenseTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; resources.ApplyResources(this.MetadataModuleLicenseTextBox, "MetadataModuleLicenseTextBox"); // + // AuthorLabel + // + this.AuthorLabel.AutoSize = true; + this.AuthorLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.AuthorLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.AuthorLabel.Location = new System.Drawing.Point(3, 60); + this.AuthorLabel.Name = "AuthorLabel"; + this.AuthorLabel.Size = new System.Drawing.Size(84, 30); + this.AuthorLabel.TabIndex = 5; + resources.ApplyResources(this.AuthorLabel, "AuthorLabel"); + // // AuthorsPanel // this.AuthorsPanel.AutoSize = true; @@ -223,16 +162,16 @@ private void InitializeComponent() this.AuthorsPanel.Name = "AuthorsPanel"; this.AuthorsPanel.Size = new System.Drawing.Size(500, 20); // - // VersionLabel + // ReleaseLabel // - this.VersionLabel.AutoSize = true; - this.VersionLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.VersionLabel.ForeColor = System.Drawing.SystemColors.GrayText; - this.VersionLabel.Location = new System.Drawing.Point(3, 0); - this.VersionLabel.Name = "VersionLabel"; - this.VersionLabel.Size = new System.Drawing.Size(84, 30); - this.VersionLabel.TabIndex = 1; - resources.ApplyResources(this.VersionLabel, "VersionLabel"); + this.ReleaseLabel.AutoSize = true; + this.ReleaseLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.ReleaseLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.ReleaseLabel.Location = new System.Drawing.Point(3, 150); + this.ReleaseLabel.Name = "ReleaseLabel"; + this.ReleaseLabel.Size = new System.Drawing.Size(84, 30); + this.ReleaseLabel.TabIndex = 12; + resources.ApplyResources(this.ReleaseLabel, "ReleaseLabel"); // // MetadataModuleReleaseStatusTextBox // @@ -248,6 +187,17 @@ private void InitializeComponent() this.MetadataModuleReleaseStatusTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; resources.ApplyResources(this.MetadataModuleReleaseStatusTextBox, "MetadataModuleReleaseStatusTextBox"); // + // GameCompatibilityLabel + // + this.GameCompatibilityLabel.AutoSize = true; + this.GameCompatibilityLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.GameCompatibilityLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.GameCompatibilityLabel.Location = new System.Drawing.Point(3, 180); + this.GameCompatibilityLabel.Name = "GameCompatibilityLabel"; + this.GameCompatibilityLabel.Size = new System.Drawing.Size(84, 30); + this.GameCompatibilityLabel.TabIndex = 13; + resources.ApplyResources(this.GameCompatibilityLabel, "GameCompatibilityLabel"); + // // MetadataModuleGameCompatibilityTextBox // this.MetadataModuleGameCompatibilityTextBox.AutoSize = true; @@ -262,9 +212,59 @@ private void InitializeComponent() this.MetadataModuleGameCompatibilityTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; resources.ApplyResources(this.MetadataModuleGameCompatibilityTextBox, "MetadataModuleGameCompatibilityTextBox"); // + // IdentifierLabel + // + this.IdentifierLabel.AutoSize = true; + this.IdentifierLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.IdentifierLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.IdentifierLabel.Location = new System.Drawing.Point(3, 210); + this.IdentifierLabel.Name = "IdentifierLabel"; + this.IdentifierLabel.Size = new System.Drawing.Size(84, 20); + this.IdentifierLabel.TabIndex = 28; + resources.ApplyResources(this.IdentifierLabel, "IdentifierLabel"); + // + // MetadataIdentifierTextBox + // + this.MetadataIdentifierTextBox.AutoSize = true; + this.MetadataIdentifierTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.MetadataIdentifierTextBox.Location = new System.Drawing.Point(93, 210); + this.MetadataIdentifierTextBox.Name = "MetadataIdentifierTextBox"; + this.MetadataIdentifierTextBox.Size = new System.Drawing.Size(250, 20); + this.MetadataIdentifierTextBox.TabIndex = 27; + this.MetadataIdentifierTextBox.ReadOnly = true; + this.MetadataIdentifierTextBox.BackColor = System.Drawing.SystemColors.Control; + this.MetadataIdentifierTextBox.ForeColor = System.Drawing.SystemColors.ControlText; + this.MetadataIdentifierTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + resources.ApplyResources(this.MetadataIdentifierTextBox, "MetadataIdentifierTextBox"); + // + // ReplacementLabel + // + this.ReplacementLabel.AutoSize = true; + this.ReplacementLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.ReplacementLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.ReplacementLabel.Location = new System.Drawing.Point(3, 240); + this.ReplacementLabel.Name = "ReplacementLabel"; + this.ReplacementLabel.Size = new System.Drawing.Size(84, 20); + this.ReplacementLabel.TabIndex = 28; + resources.ApplyResources(this.ReplacementLabel, "ReplacementLabel"); + // + // ReplacementTextBox + // + this.ReplacementTextBox.AutoSize = true; + this.ReplacementTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.ReplacementTextBox.Location = new System.Drawing.Point(93, 240); + this.ReplacementTextBox.Name = "ReplacementTextBox"; + this.ReplacementTextBox.Size = new System.Drawing.Size(250, 20); + this.ReplacementTextBox.TabIndex = 27; + this.ReplacementTextBox.ReadOnly = true; + this.ReplacementTextBox.BackColor = System.Drawing.SystemColors.Control; + this.ReplacementTextBox.ForeColor = System.Drawing.SystemColors.ControlText; + this.ReplacementTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + resources.ApplyResources(this.ReplacementTextBox, "ReplacementTextBox"); + // // Metadata // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.MetadataTable); this.Name = "Metadata"; @@ -280,19 +280,19 @@ private void InitializeComponent() private System.Windows.Forms.ToolTip ToolTip; private System.Windows.Forms.TableLayoutPanel MetadataTable; - private System.Windows.Forms.Label IdentifierLabel; - private TransparentTextBox MetadataIdentifierTextBox; - private System.Windows.Forms.Label ReplacementLabel; - private TransparentTextBox ReplacementTextBox; - private System.Windows.Forms.Label GameCompatibilityLabel; - private System.Windows.Forms.Label ReleaseLabel; - private System.Windows.Forms.Label AuthorLabel; + private System.Windows.Forms.Label VersionLabel; + private CKAN.GUI.TransparentTextBox MetadataModuleVersionTextBox; private System.Windows.Forms.Label LicenseLabel; - private TransparentTextBox MetadataModuleVersionTextBox; - private TransparentTextBox MetadataModuleLicenseTextBox; + private CKAN.GUI.TransparentTextBox MetadataModuleLicenseTextBox; + private System.Windows.Forms.Label AuthorLabel; private System.Windows.Forms.FlowLayoutPanel AuthorsPanel; - private System.Windows.Forms.Label VersionLabel; - private TransparentTextBox MetadataModuleReleaseStatusTextBox; - private TransparentTextBox MetadataModuleGameCompatibilityTextBox; + private System.Windows.Forms.Label ReleaseLabel; + private CKAN.GUI.TransparentTextBox MetadataModuleReleaseStatusTextBox; + private System.Windows.Forms.Label GameCompatibilityLabel; + private CKAN.GUI.TransparentTextBox MetadataModuleGameCompatibilityTextBox; + private System.Windows.Forms.Label IdentifierLabel; + private CKAN.GUI.TransparentTextBox MetadataIdentifierTextBox; + private System.Windows.Forms.Label ReplacementLabel; + private CKAN.GUI.TransparentTextBox ReplacementTextBox; } } diff --git a/GUI/Controls/ModInfoTabs/Relationships.Designer.cs b/GUI/Controls/ModInfoTabs/Relationships.Designer.cs index 809debf07..c5ef607f4 100644 --- a/GUI/Controls/ModInfoTabs/Relationships.Designer.cs +++ b/GUI/Controls/ModInfoTabs/Relationships.Designer.cs @@ -32,6 +32,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new SingleAssemblyComponentResourceManager(typeof(Relationships)); this.ToolTip = new System.Windows.Forms.ToolTip(); this.DependsGraphTree = new System.Windows.Forms.TreeView(); + this.LegendTable = new System.Windows.Forms.TableLayoutPanel(); this.LegendInstalledLabel = new System.Windows.Forms.Label(); this.LegendProvidesImage = new System.Windows.Forms.PictureBox(); this.LegendProvidesLabel = new System.Windows.Forms.Label(); @@ -46,6 +47,7 @@ private void InitializeComponent() this.LegendConflictsImage = new System.Windows.Forms.PictureBox(); this.LegendConflictsLabel = new System.Windows.Forms.Label(); this.ReverseRelationshipsCheckbox = new System.Windows.Forms.CheckBox(); + this.LegendTable.SuspendLayout(); this.SuspendLayout(); // // ToolTip @@ -57,10 +59,8 @@ private void InitializeComponent() // // DependsGraphTree // - this.DependsGraphTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.DependsGraphTree.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.DependsGraphTree.Dock = System.Windows.Forms.DockStyle.Fill; this.DependsGraphTree.Location = new System.Drawing.Point(3, 132); this.DependsGraphTree.Name = "DependsGraphTree"; this.DependsGraphTree.Size = new System.Drawing.Size(494, 340); @@ -80,107 +80,142 @@ private void InitializeComponent() this.DependsGraphTree.ImageList.Images.Add("Supports", global::CKAN.GUI.EmbeddedImages.smile); this.DependsGraphTree.ImageList.Images.Add("Conflicts", global::CKAN.GUI.EmbeddedImages.alert); // + // LegendTable + // + this.LegendTable.AutoSize = true; + this.LegendTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.LegendTable.ColumnCount = 6; + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33f)); + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33f)); + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33f)); + this.LegendTable.Controls.Add(this.LegendInstalledLabel, 1, 0); + this.LegendTable.Controls.Add(this.LegendProvidesImage, 0, 1); + this.LegendTable.Controls.Add(this.LegendProvidesLabel, 1, 1); + this.LegendTable.Controls.Add(this.LegendDependsImage, 0, 2); + this.LegendTable.Controls.Add(this.LegendDependsLabel, 1, 2); + this.LegendTable.Controls.Add(this.LegendRecommendsImage, 2, 1); + this.LegendTable.Controls.Add(this.LegendRecommendsLabel, 3, 1); + this.LegendTable.Controls.Add(this.LegendSuggestsImage, 2, 2); + this.LegendTable.Controls.Add(this.LegendSuggestsLabel, 3, 2); + this.LegendTable.Controls.Add(this.LegendSupportsImage, 4, 1); + this.LegendTable.Controls.Add(this.LegendSupportsLabel, 5, 1); + this.LegendTable.Controls.Add(this.LegendConflictsImage, 4, 2); + this.LegendTable.Controls.Add(this.LegendConflictsLabel, 5, 2); + this.LegendTable.Dock = System.Windows.Forms.DockStyle.Bottom; + this.LegendTable.Location = new System.Drawing.Point(0, 0); + this.LegendTable.Name = "LegendTable"; + this.LegendTable.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); + this.LegendTable.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); + this.LegendTable.RowCount = 3; + this.LegendTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); + this.LegendTable.Size = new System.Drawing.Size(346, 255); + this.LegendTable.TabIndex = 0; + // // LegendInstalledLabel // this.LegendInstalledLabel.AutoSize = true; - this.LegendInstalledLabel.Location = new System.Drawing.Point(24, 3); this.LegendInstalledLabel.Font = new System.Drawing.Font(System.Drawing.SystemFonts.DefaultFont.Name, 8, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.LegendInstalledLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendInstalledLabel, "LegendInstalledLabel"); // // LegendProvidesImage // this.LegendProvidesImage.BackColor = System.Drawing.SystemColors.Window; this.LegendProvidesImage.Image = global::CKAN.GUI.EmbeddedImages.ballot; - this.LegendProvidesImage.Location = new System.Drawing.Point(6, 21); + this.LegendProvidesImage.Margin = new System.Windows.Forms.Padding(0); this.LegendProvidesImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendProvidesImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendProvidesImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendProvidesLabel // this.LegendProvidesLabel.AutoSize = true; - this.LegendProvidesLabel.Location = new System.Drawing.Point(24, 21); + this.LegendProvidesLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendProvidesLabel, "LegendProvidesLabel"); // // LegendDependsImage // this.LegendDependsImage.BackColor = System.Drawing.SystemColors.Window; this.LegendDependsImage.Image = global::CKAN.GUI.EmbeddedImages.star; - this.LegendDependsImage.Location = new System.Drawing.Point(6, 39); + this.LegendDependsImage.Margin = new System.Windows.Forms.Padding(0); this.LegendDependsImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendDependsImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendDependsImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendDependsLabel // this.LegendDependsLabel.AutoSize = true; this.LegendDependsLabel.Location = new System.Drawing.Point(24, 39); + this.LegendDependsLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendDependsLabel, "LegendDependsLabel"); // // LegendRecommendsImage // this.LegendRecommendsImage.BackColor = System.Drawing.SystemColors.Window; this.LegendRecommendsImage.Image = global::CKAN.GUI.EmbeddedImages.thumbup; - this.LegendRecommendsImage.Location = new System.Drawing.Point(6, 57); + this.LegendRecommendsImage.Margin = new System.Windows.Forms.Padding(0); this.LegendRecommendsImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendRecommendsImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendRecommendsImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendRecommendsLabel // this.LegendRecommendsLabel.AutoSize = true; - this.LegendRecommendsLabel.Location = new System.Drawing.Point(24, 57); + this.LegendRecommendsLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendRecommendsLabel, "LegendRecommendsLabel"); // // LegendSuggestsImage // this.LegendSuggestsImage.BackColor = System.Drawing.SystemColors.Window; this.LegendSuggestsImage.Image = global::CKAN.GUI.EmbeddedImages.info; - this.LegendSuggestsImage.Location = new System.Drawing.Point(6, 75); + this.LegendSuggestsImage.Margin = new System.Windows.Forms.Padding(0); this.LegendSuggestsImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendSuggestsImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendSuggestsImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendSuggestsLabel // this.LegendSuggestsLabel.AutoSize = true; - this.LegendSuggestsLabel.Location = new System.Drawing.Point(24, 75); + this.LegendSuggestsLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendSuggestsLabel, "LegendSuggestsLabel"); // // LegendSupportsImage // this.LegendSupportsImage.BackColor = System.Drawing.SystemColors.Window; this.LegendSupportsImage.Image = global::CKAN.GUI.EmbeddedImages.smile; - this.LegendSupportsImage.Location = new System.Drawing.Point(6, 93); + this.LegendSupportsImage.Margin = new System.Windows.Forms.Padding(0); this.LegendSupportsImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendSupportsImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendSupportsImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendSupportsLabel // this.LegendSupportsLabel.AutoSize = true; - this.LegendSupportsLabel.Location = new System.Drawing.Point(24, 93); + this.LegendSupportsLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendSupportsLabel, "LegendSupportsLabel"); // // LegendConflictsImage // this.LegendConflictsImage.BackColor = System.Drawing.SystemColors.Window; this.LegendConflictsImage.Image = global::CKAN.GUI.EmbeddedImages.alert; - this.LegendConflictsImage.Location = new System.Drawing.Point(6, 111); + this.LegendConflictsImage.Margin = new System.Windows.Forms.Padding(0); this.LegendConflictsImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.LegendConflictsImage.ClientSize = new System.Drawing.Size(14, 14); + this.LegendConflictsImage.ClientSize = new System.Drawing.Size(16, 16); // // LegendConflictsLabel // this.LegendConflictsLabel.AutoSize = true; - this.LegendConflictsLabel.Location = new System.Drawing.Point(24, 111); + this.LegendConflictsLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6); resources.ApplyResources(this.LegendConflictsLabel, "LegendConflictsLabel"); // // ReverseRelationshipsCheckbox // - this.ReverseRelationshipsCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.ReverseRelationshipsCheckbox.Dock = System.Windows.Forms.DockStyle.Bottom; this.ReverseRelationshipsCheckbox.AutoSize = true; this.ReverseRelationshipsCheckbox.AutoCheck = false; this.ReverseRelationshipsCheckbox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ReverseRelationshipsCheckbox.Name = "ReverseRelationshipsCheckbox"; - this.ReverseRelationshipsCheckbox.Location = new System.Drawing.Point(3, 474); + this.ReverseRelationshipsCheckbox.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); this.ReverseRelationshipsCheckbox.Size = new System.Drawing.Size(494, 24); this.ReverseRelationshipsCheckbox.Click += new System.EventHandler(this.ReverseRelationshipsCheckbox_Click); this.ReverseRelationshipsCheckbox.CheckedChanged += new System.EventHandler(this.ReverseRelationshipsCheckbox_CheckedChanged); @@ -188,24 +223,16 @@ private void InitializeComponent() // // Relationships // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.DependsGraphTree); - this.Controls.Add(this.LegendInstalledLabel); - this.Controls.Add(this.LegendProvidesImage); - this.Controls.Add(this.LegendProvidesLabel); - this.Controls.Add(this.LegendDependsImage); - this.Controls.Add(this.LegendDependsLabel); - this.Controls.Add(this.LegendRecommendsImage); - this.Controls.Add(this.LegendRecommendsLabel); - this.Controls.Add(this.LegendSuggestsImage); - this.Controls.Add(this.LegendSuggestsLabel); - this.Controls.Add(this.LegendSupportsImage); - this.Controls.Add(this.LegendSupportsLabel); - this.Controls.Add(this.LegendConflictsImage); - this.Controls.Add(this.LegendConflictsLabel); + this.Controls.Add(this.LegendTable); this.Controls.Add(this.ReverseRelationshipsCheckbox); this.Name = "Relationships"; this.Size = new System.Drawing.Size(500, 500); resources.ApplyResources(this, "$this"); + this.LegendTable.ResumeLayout(false); + this.LegendTable.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } @@ -214,6 +241,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolTip ToolTip; private System.Windows.Forms.TreeView DependsGraphTree; + private System.Windows.Forms.TableLayoutPanel LegendTable; private System.Windows.Forms.Label LegendInstalledLabel; private System.Windows.Forms.PictureBox LegendProvidesImage; private System.Windows.Forms.Label LegendProvidesLabel; diff --git a/GUI/Controls/ModInfoTabs/Relationships.cs b/GUI/Controls/ModInfoTabs/Relationships.cs index 75d074f27..3be1c4c86 100644 --- a/GUI/Controls/ModInfoTabs/Relationships.cs +++ b/GUI/Controls/ModInfoTabs/Relationships.cs @@ -100,19 +100,10 @@ private void DependsGraphTree_NodeMouseDoubleClick(object sender, TreeNodeMouseC } private static bool ImMyOwnGrandpa(TreeNode node) - { - if (node.Tag is CkanModule module) - { - for (TreeNode other = node.Parent; other != null; other = other.Parent) - { - if (module == other.Tag) - { - return true; - } - } - } - return false; - } + => node.Tag is CkanModule module + && (node.Parent?.TraverseNodes(nd => nd.Parent) + .Any(other => other.Tag == module) + ?? false); private void ReverseRelationshipsCheckbox_Click(object? sender, EventArgs? e) { @@ -234,7 +225,7 @@ private void ExpandOnePage(IRegistryQuerier registry, RelationshipType.Recommends, RelationshipType.Suggests, RelationshipType.Supports, - RelationshipType.Conflicts + RelationshipType.Conflicts, }; private void AddChildren(IRegistryQuerier registry, @@ -259,28 +250,21 @@ private IEnumerable GetChildren(IRegistryQuerier registry, : ReverseRelationships(registry, module, stabilityTolerance, crit) : Enumerable.Empty(); - private static IEnumerable GetModRelationships(CkanModule module, RelationshipType which) - { - switch (which) - { - case RelationshipType.Depends: - return module.depends - ?? Enumerable.Empty(); - case RelationshipType.Recommends: - return module.recommends - ?? Enumerable.Empty(); - case RelationshipType.Suggests: - return module.suggests - ?? Enumerable.Empty(); - case RelationshipType.Supports: - return module.supports - ?? Enumerable.Empty(); - case RelationshipType.Conflicts: - return module.conflicts - ?? Enumerable.Empty(); - } - return Enumerable.Empty(); - } + private static IEnumerable GetModRelationships(CkanModule module, + RelationshipType which) + => which switch { + RelationshipType.Depends => module.depends + ?? Enumerable.Empty(), + RelationshipType.Recommends => module.recommends + ?? Enumerable.Empty(), + RelationshipType.Suggests => module.suggests + ?? Enumerable.Empty(), + RelationshipType.Supports => module.supports + ?? Enumerable.Empty(), + RelationshipType.Conflicts => module.conflicts + ?? Enumerable.Empty(), + RelationshipType.Provides or _ => Enumerable.Empty(), + }; private IEnumerable ForwardRelationships(IRegistryQuerier registry, CkanModule module, @@ -362,35 +346,40 @@ private IEnumerable ReverseRelationships(IRegistryQuerier regi CkanModule module, StabilityToleranceConfig stabilityTolerance, GameVersionCriteria crit) - { - var compat = registry.CompatibleModules(stabilityTolerance, crit).ToArray(); - var incompat = registry.IncompatibleModules(stabilityTolerance, crit).ToArray(); - var toFind = new CkanModule[] { module }; - return kindsOfRelationships.SelectMany(relationship => - compat.SelectMany(otherMod => - GetModRelationships(otherMod, relationship) - .Where(r => r.MatchesAny(toFind, null, null)) - .Select(r => IndexedNode(registry, otherMod, relationship, r, stabilityTolerance, crit))) - .Concat(incompat.SelectMany(otherMod => - GetModRelationships(otherMod, relationship) - .Where(r => r.MatchesAny(toFind, null, null)) - .Select(r => IndexedNode(registry, otherMod, relationship, r, stabilityTolerance, crit))))); - } + => ReverseRelationships(registry, new CkanModule[] { module }, + stabilityTolerance, crit); + + private IEnumerable ReverseRelationships(IRegistryQuerier registry, + CkanModule[] modules, + StabilityToleranceConfig stabilityTolerance, + GameVersionCriteria crit) + => kindsOfRelationships.SelectMany(relationship => + registry.CompatibleModules(stabilityTolerance, crit) + .SelectMany(otherMod => + GetModRelationships(otherMod, relationship) + .Where(r => r.MatchesAny(modules, null, null)) + .Select(r => IndexedNode(registry, otherMod, relationship, + r, stabilityTolerance, crit))) + .Concat(registry.IncompatibleModules(stabilityTolerance, crit) + .SelectMany(otherMod => + GetModRelationships(otherMod, relationship) + .Where(r => r.MatchesAny(modules, null, null)) + .Select(r => IndexedNode(registry, otherMod, relationship, + r, stabilityTolerance, crit))))); private static TreeNode providesNode(string identifier, RelationshipType relationship, TreeNode[] children) { int icon = (int)relationship + 1; - var node = new TreeNode(string.Format(Properties.Resources.ModInfoVirtual, - identifier), - icon, icon, children) + return new TreeNode(string.Format(Properties.Resources.ModInfoVirtual, + identifier), + icon, icon, children) { Name = identifier, - ToolTipText = relationship.LocalizeDescription(), + ToolTipText = $"{relationship.LocalizeDescription()} {identifier}", ForeColor = SystemColors.GrayText, }; - return node; } private TreeNode IndexedNode(IRegistryQuerier registry, @@ -436,7 +425,7 @@ private TreeNode NonModuleNode(RelationshipDescriptor relDescr, } private static TreeNode NonindexedNode(RelationshipDescriptor relDescr, - RelationshipType relationship) + RelationshipType relationship) { // Completely nonexistent dependency, e.g. "AJE" int icon = (int)relationship + 1; @@ -446,7 +435,7 @@ private static TreeNode NonindexedNode(RelationshipDescriptor relDescr, { Name = relDescr.ToString(), ToolTipText = relationship.LocalizeDescription(), - ForeColor = Color.Red + ForeColor = Color.Red, }; } diff --git a/GUI/Controls/ModInfoTabs/Versions.Designer.cs b/GUI/Controls/ModInfoTabs/Versions.Designer.cs index c5666ee98..966f4f98e 100644 --- a/GUI/Controls/ModInfoTabs/Versions.Designer.cs +++ b/GUI/Controls/ModInfoTabs/Versions.Designer.cs @@ -200,7 +200,7 @@ private void InitializeComponent() // // Versions // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.VersionsListView); this.Controls.Add(this.OverallSummaryLabel); diff --git a/GUI/Controls/PlayTime.Designer.cs b/GUI/Controls/PlayTime.Designer.cs index 95d998462..6fed90b92 100755 --- a/GUI/Controls/PlayTime.Designer.cs +++ b/GUI/Controls/PlayTime.Designer.cs @@ -131,7 +131,8 @@ private void InitializeComponent() // // PlayTime // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.PlayTimeGrid); this.Controls.Add(this.EditHelpLabel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Controls/Wait.Designer.cs b/GUI/Controls/Wait.Designer.cs index 77e9b85aa..b66beace4 100644 --- a/GUI/Controls/Wait.Designer.cs +++ b/GUI/Controls/Wait.Designer.cs @@ -160,7 +160,8 @@ private void InitializeComponent() // // Wait // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.VerticalSplitter); this.Controls.Add(this.BottomButtonPanel); this.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); diff --git a/GUI/Dialogs/AboutDialog.Designer.cs b/GUI/Dialogs/AboutDialog.Designer.cs index d2f212a8d..d6428e7af 100644 --- a/GUI/Dialogs/AboutDialog.Designer.cs +++ b/GUI/Dialogs/AboutDialog.Designer.cs @@ -194,7 +194,7 @@ private void InitializeComponent() // // AboutDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(500, 155); this.Controls.Add(this.projectNameLabel); diff --git a/GUI/Dialogs/AskUserForAutoUpdatesDialog.Designer.cs b/GUI/Dialogs/AskUserForAutoUpdatesDialog.Designer.cs index c1202eb5d..fdc707e14 100644 --- a/GUI/Dialogs/AskUserForAutoUpdatesDialog.Designer.cs +++ b/GUI/Dialogs/AskUserForAutoUpdatesDialog.Designer.cs @@ -66,7 +66,7 @@ private void InitializeComponent() // // AskUserForAutoUpdatesDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(562, 79); this.Controls.Add(this.NoButton); diff --git a/GUI/Dialogs/CloneGameInstanceDialog.Designer.cs b/GUI/Dialogs/CloneGameInstanceDialog.Designer.cs index 7aa57c7f3..12df6ea55 100644 --- a/GUI/Dialogs/CloneGameInstanceDialog.Designer.cs +++ b/GUI/Dialogs/CloneGameInstanceDialog.Designer.cs @@ -104,6 +104,8 @@ private void InitializeComponent() // // buttonInstancePathSelection // + this.buttonInstancePathSelection.AutoSize = true; + this.buttonInstancePathSelection.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.buttonInstancePathSelection.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonInstancePathSelection.Location = new System.Drawing.Point(339, 48); this.buttonInstancePathSelection.Name = "buttonInstancePathSelection"; @@ -153,6 +155,8 @@ private void InitializeComponent() // // buttonPathBrowser // + this.buttonPathBrowser.AutoSize = true; + this.buttonPathBrowser.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.buttonPathBrowser.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonPathBrowser.Location = new System.Drawing.Point(339, 108); this.buttonPathBrowser.Name = "buttonPathBrowser"; @@ -230,6 +234,8 @@ private void InitializeComponent() // // buttonOK // + this.buttonOK.AutoSize = true; + this.buttonOK.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonOK.Location = new System.Drawing.Point(256, 360); this.buttonOK.Name = "buttonOK"; @@ -241,6 +247,8 @@ private void InitializeComponent() // // buttonCancel // + this.buttonCancel.AutoSize = true; + this.buttonCancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonCancel.Location = new System.Drawing.Point(337, 360); this.buttonCancel.Name = "buttonCancel"; diff --git a/GUI/Dialogs/CompatibleGameVersionsDialog.Designer.cs b/GUI/Dialogs/CompatibleGameVersionsDialog.Designer.cs index 8ca619236..3400092f6 100644 --- a/GUI/Dialogs/CompatibleGameVersionsDialog.Designer.cs +++ b/GUI/Dialogs/CompatibleGameVersionsDialog.Designer.cs @@ -147,6 +147,8 @@ private void InitializeComponent() // // clearSelectionButton // + this.ClearSelectionButton.AutoSize = true; + this.ClearSelectionButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ClearSelectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.ClearSelectionButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ClearSelectionButton.Location = new System.Drawing.Point(12, 211); @@ -180,6 +182,8 @@ private void InitializeComponent() // // AddVersionToListButton // + this.AddVersionToListButton.AutoSize = true; + this.AddVersionToListButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.AddVersionToListButton.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)); this.AddVersionToListButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -225,6 +229,8 @@ private void InitializeComponent() // // CancelChooseCompatibleVersionsButton // + this.CancelChooseCompatibleVersionsButton.AutoSize = true; + this.CancelChooseCompatibleVersionsButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.CancelChooseCompatibleVersionsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.CancelChooseCompatibleVersionsButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.CancelChooseCompatibleVersionsButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; @@ -236,8 +242,10 @@ private void InitializeComponent() this.CancelChooseCompatibleVersionsButton.Click += new System.EventHandler(this.CancelButton_Click); resources.ApplyResources(this.CancelChooseCompatibleVersionsButton, "CancelChooseCompatibleVersionsButton"); // - // saveButton + // SaveButton // + this.SaveButton.AutoSize = true; + this.SaveButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.SaveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.SaveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SaveButton.Location = new System.Drawing.Point(356, 350); diff --git a/GUI/Dialogs/DownloadsFailedDialog.Designer.cs b/GUI/Dialogs/DownloadsFailedDialog.Designer.cs index 551549d76..1bca5af8f 100644 --- a/GUI/Dialogs/DownloadsFailedDialog.Designer.cs +++ b/GUI/Dialogs/DownloadsFailedDialog.Designer.cs @@ -157,8 +157,8 @@ private void InitializeComponent() // // DownloadsFailedDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.DownloadsGrid); this.Controls.Add(this.ExplanationLabel); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Dialogs/ErrorDialog.Designer.cs b/GUI/Dialogs/ErrorDialog.Designer.cs index 16eb438e7..f314dda70 100644 --- a/GUI/Dialogs/ErrorDialog.Designer.cs +++ b/GUI/Dialogs/ErrorDialog.Designer.cs @@ -60,6 +60,8 @@ private void InitializeComponent() // // DismissButton // + this.DismissButton.AutoSize = true; + this.DismissButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.DismissButton.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom)); this.DismissButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.DismissButton.Location = new System.Drawing.Point(387, 124); @@ -72,7 +74,7 @@ private void InitializeComponent() // // ErrorDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 160); this.ControlBox = true; diff --git a/GUI/Dialogs/GameCommandLineOptionsDialog.Designer.cs b/GUI/Dialogs/GameCommandLineOptionsDialog.Designer.cs index 5a569bbf7..ef704b003 100644 --- a/GUI/Dialogs/GameCommandLineOptionsDialog.Designer.cs +++ b/GUI/Dialogs/GameCommandLineOptionsDialog.Designer.cs @@ -151,7 +151,7 @@ private void InitializeComponent() // // GameCommandLineOptionsDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(320, 180); this.ControlBox = false; diff --git a/GUI/Dialogs/InstallFiltersDialog.Designer.cs b/GUI/Dialogs/InstallFiltersDialog.Designer.cs index 3da57f291..9fc69ef1d 100644 --- a/GUI/Dialogs/InstallFiltersDialog.Designer.cs +++ b/GUI/Dialogs/InstallFiltersDialog.Designer.cs @@ -46,6 +46,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.GlobalFiltersGroupBox.Controls.Add(this.AddMiniAVCButton); this.GlobalFiltersGroupBox.Controls.Add(this.GlobalFiltersTextBox); + this.GlobalFiltersGroupBox.ForeColor = System.Drawing.SystemColors.ControlText; this.GlobalFiltersGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GlobalFiltersGroupBox.Location = new System.Drawing.Point(12, 12); this.GlobalFiltersGroupBox.Name = "GlobalFiltersGroupBox"; @@ -60,6 +61,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.InstanceFiltersGroupBox.Controls.Add(this.InstanceFiltersTextBox); + this.InstanceFiltersGroupBox.ForeColor = System.Drawing.SystemColors.ControlText; this.InstanceFiltersGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.InstanceFiltersGroupBox.Location = new System.Drawing.Point(12, 187); this.InstanceFiltersGroupBox.Name = "InstanceFiltersGroupBox"; @@ -82,7 +84,10 @@ private void InitializeComponent() // // AddMiniAVCButton // + this.AddMiniAVCButton.AutoSize = true; + this.AddMiniAVCButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.AddMiniAVCButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.AddMiniAVCButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.AddMiniAVCButton.Location = new System.Drawing.Point(231, 17); this.AddMiniAVCButton.Name = "AddMiniAVCButton"; this.AddMiniAVCButton.Size = new System.Drawing.Size(124, 23); @@ -116,7 +121,7 @@ private void InitializeComponent() // // InstallFiltersDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(379, 390); this.Controls.Add(this.GlobalFiltersGroupBox); diff --git a/GUI/Dialogs/ManageGameInstancesDialog.Designer.cs b/GUI/Dialogs/ManageGameInstancesDialog.Designer.cs index c544559e7..3f082ee61 100644 --- a/GUI/Dialogs/ManageGameInstancesDialog.Designer.cs +++ b/GUI/Dialogs/ManageGameInstancesDialog.Designer.cs @@ -123,6 +123,8 @@ private void InitializeComponent() // // SelectButton // + this.SelectButton.AutoSize = true; + this.SelectButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.SelectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.SelectButton.Enabled = false; this.SelectButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -136,6 +138,8 @@ private void InitializeComponent() // // AddNewButton // + this.AddNewButton.AutoSize = true; + this.AddNewButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.AddNewButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.AddNewButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.AddNewButton.Location = new System.Drawing.Point(327, 320); @@ -178,6 +182,8 @@ private void InitializeComponent() // // RenameButton // + this.RenameButton.AutoSize = true; + this.RenameButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.RenameButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.RenameButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.RenameButton.Location = new System.Drawing.Point(216, 320); @@ -204,6 +210,8 @@ private void InitializeComponent() // // ForgetButton // + this.ForgetButton.AutoSize = true; + this.ForgetButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ForgetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ForgetButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ForgetButton.Location = new System.Drawing.Point(140, 320); diff --git a/GUI/Dialogs/NewRepoDialog.Designer.cs b/GUI/Dialogs/NewRepoDialog.Designer.cs index b4e6f0536..2577e2eda 100644 --- a/GUI/Dialogs/NewRepoDialog.Designer.cs +++ b/GUI/Dialogs/NewRepoDialog.Designer.cs @@ -164,7 +164,8 @@ private void InitializeComponent() // // NewRepoDialog // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(500, 220); this.MinimumSize = new System.Drawing.Size(520, 260); this.Controls.Add(this.RepositoryGroupBox); diff --git a/GUI/Dialogs/NewUpdateDialog.Designer.cs b/GUI/Dialogs/NewUpdateDialog.Designer.cs index fe9f3bb9f..c6888dc18 100644 --- a/GUI/Dialogs/NewUpdateDialog.Designer.cs +++ b/GUI/Dialogs/NewUpdateDialog.Designer.cs @@ -73,6 +73,8 @@ private void InitializeComponent() // // InstallUpdateButton // + this.InstallUpdateButton.AutoSize = true; + this.InstallUpdateButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.InstallUpdateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.InstallUpdateButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.InstallUpdateButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -85,6 +87,8 @@ private void InitializeComponent() // // CancelUpdateButton // + this.CancelUpdateButton.AutoSize = true; + this.CancelUpdateButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.CancelUpdateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.CancelUpdateButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.CancelUpdateButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -97,7 +101,7 @@ private void InitializeComponent() // // NewUpdateDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.ClientSize = new System.Drawing.Size(426, 310); diff --git a/GUI/Dialogs/PluginsDialog.Designer.cs b/GUI/Dialogs/PluginsDialog.Designer.cs index 1b63e3895..e6626e165 100644 --- a/GUI/Dialogs/PluginsDialog.Designer.cs +++ b/GUI/Dialogs/PluginsDialog.Designer.cs @@ -90,6 +90,8 @@ private void InitializeComponent() // // DeactivateButton // + this.DeactivateButton.AutoSize = true; + this.DeactivateButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.DeactivateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.DeactivateButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.DeactivateButton.Enabled = false; @@ -103,6 +105,8 @@ private void InitializeComponent() // // ReloadPluginButton // + this.ReloadPluginButton.AutoSize = true; + this.ReloadPluginButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ReloadPluginButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.ReloadPluginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ReloadPluginButton.Enabled = false; @@ -128,6 +132,8 @@ private void InitializeComponent() // // ActivatePluginButton // + this.ActivatePluginButton.AutoSize = true; + this.ActivatePluginButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.ActivatePluginButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.ActivatePluginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ActivatePluginButton.Enabled = false; @@ -141,6 +147,8 @@ private void InitializeComponent() // // AddNewPluginButton // + this.AddNewPluginButton.AutoSize = true; + this.AddNewPluginButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.AddNewPluginButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.AddNewPluginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.AddNewPluginButton.Location = new System.Drawing.Point(231, 75); @@ -153,6 +161,8 @@ private void InitializeComponent() // // UnloadPluginButton // + this.UnloadPluginButton.AutoSize = true; + this.UnloadPluginButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.UnloadPluginButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.UnloadPluginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.UnloadPluginButton.Enabled = false; @@ -166,7 +176,7 @@ private void InitializeComponent() // // PluginsDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(379, 358); this.Controls.Add(this.groupBox2); @@ -174,6 +184,7 @@ private void InitializeComponent() this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = EmbeddedImages.AppIcon; this.Name = "PluginsDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Load += new System.EventHandler(this.PluginsDialog_Load); resources.ApplyResources(this, "$this"); this.groupBox1.ResumeLayout(false); diff --git a/GUI/Dialogs/PluginsDialog.cs b/GUI/Dialogs/PluginsDialog.cs index a03eec377..1be7891a3 100644 --- a/GUI/Dialogs/PluginsDialog.cs +++ b/GUI/Dialogs/PluginsDialog.cs @@ -14,7 +14,6 @@ public partial class PluginsDialog : Form public PluginsDialog() { InitializeComponent(); - StartPosition = FormStartPosition.CenterScreen; } private static PluginController? pluginController => Main.Instance?.pluginController; diff --git a/GUI/Dialogs/PreferredHostsDialog.Designer.cs b/GUI/Dialogs/PreferredHostsDialog.Designer.cs index 584e85360..cf28321ef 100644 --- a/GUI/Dialogs/PreferredHostsDialog.Designer.cs +++ b/GUI/Dialogs/PreferredHostsDialog.Designer.cs @@ -193,7 +193,8 @@ private void InitializeComponent() // // PreferredHostsDialog // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(534, 360); this.Controls.Add(this.Splitter); this.Controls.Add(this.ExplanationLabel); @@ -212,6 +213,7 @@ private void InitializeComponent() this.Splitter.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Splitter)).EndInit(); this.Splitter.ResumeLayout(false); + this.Splitter.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/GUI/Dialogs/RenameInstanceDialog.Designer.cs b/GUI/Dialogs/RenameInstanceDialog.Designer.cs index 791765c7e..367a4af1d 100644 --- a/GUI/Dialogs/RenameInstanceDialog.Designer.cs +++ b/GUI/Dialogs/RenameInstanceDialog.Designer.cs @@ -47,6 +47,8 @@ private void InitializeComponent() // // OKButton // + this.OKButton.AutoSize = true; + this.OKButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.OKButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.OKButton.Location = new System.Drawing.Point(232, 39); @@ -58,6 +60,8 @@ private void InitializeComponent() // // CancelRenameInstanceButton // + this.CancelRenameInstanceButton.AutoSize = true; + this.CancelRenameInstanceButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; this.CancelRenameInstanceButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.CancelRenameInstanceButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.CancelRenameInstanceButton.Location = new System.Drawing.Point(151, 39); @@ -69,7 +73,7 @@ private void InitializeComponent() // // RenameInstanceDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(319, 100); this.ControlBox = false; diff --git a/GUI/Dialogs/SelectionDialog.Designer.cs b/GUI/Dialogs/SelectionDialog.Designer.cs index 2fbea479e..70a111ebe 100644 --- a/GUI/Dialogs/SelectionDialog.Designer.cs +++ b/GUI/Dialogs/SelectionDialog.Designer.cs @@ -122,7 +122,7 @@ private void InitializeComponent() // // SelectionDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(420, 420); this.MinimumSize = new System.Drawing.Size(300, 200); diff --git a/GUI/Dialogs/YesNoDialog.Designer.cs b/GUI/Dialogs/YesNoDialog.Designer.cs index c3be4ec4e..580d86706 100644 --- a/GUI/Dialogs/YesNoDialog.Designer.cs +++ b/GUI/Dialogs/YesNoDialog.Designer.cs @@ -118,7 +118,7 @@ private void InitializeComponent() // // YesNoDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(418, 127); this.Controls.Add(this.BottomButtonPanel); diff --git a/GUI/Main/Main.Designer.cs b/GUI/Main/Main.Designer.cs index 015e806ea..84f85080f 100644 --- a/GUI/Main/Main.Designer.cs +++ b/GUI/Main/Main.Designer.cs @@ -133,7 +133,7 @@ private void InitializeComponent() // // MainMenu // - this.MainMenu.ImageScalingSize = new System.Drawing.Size(16, 16); + this.MainMenu.ImageScalingSize = new System.Drawing.Size(24, 24); this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.settingsToolStripMenuItem, @@ -141,7 +141,7 @@ private void InitializeComponent() this.MainMenu.Location = new System.Drawing.Point(0, 0); this.MainMenu.Name = "MainMenu"; this.MainMenu.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3); - this.MainMenu.Size = new System.Drawing.Size(1544, 24); + this.MainMenu.Size = new System.Drawing.Size(1544, 35); this.MainMenu.TabIndex = 0; // // fileToolStripMenuItem @@ -832,7 +832,7 @@ private void InitializeComponent() // // Main // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1544, 1038); this.Controls.Add(this.splitContainer1);