Skip to content

Commit

Permalink
Obey system colors for dark theme support
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jan 7, 2020
1 parent ab383aa commit d917cc0
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 68 deletions.
2 changes: 2 additions & 0 deletions GUI/CKAN-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
<Compile Include="SingleAssemblyComponentResourceManager.cs" />
<Compile Include="SingleAssemblyResourceManager.cs" />
<Compile Include="TabController.cs" />
<Compile Include="ThemedTabControl.cs" />
<Compile Include="ThemedListView.cs" />
<Compile Include="URLHandlers.cs" />
<Compile Include="Util.cs" />
<Compile Include="X11.cs" />
Expand Down
46 changes: 21 additions & 25 deletions GUI/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public Main(string[] cmdlineArgs, KSPManager mgr, GUIUser user, bool showConsole
InitializeComponent();

// React when the user clicks a tag or filter link in mod info
ModInfoTabControl.OnChangeFilter += Filter;
ModInfo.OnChangeFilter += Filter;

// Replace mono's broken, ugly toolstrip renderer
if (Platform.IsMono)
Expand Down Expand Up @@ -334,7 +334,7 @@ protected override void OnShown(EventArgs e)
// SplitContainer is mis-designed to throw exceptions
// if the min/max limits are exceeded rather than simply obeying them.
}
ModInfoTabControl.ModMetaSplitPosition = configuration.ModInfoPosition;
ModInfo.ModMetaSplitPosition = configuration.ModInfoPosition;

base.OnShown(e);
}
Expand Down Expand Up @@ -539,7 +539,7 @@ protected override void OnFormClosing(FormClosingEventArgs e)
configuration.PanelPosition = splitContainer1.SplitterDistance;

// Copy metadata panel split height to app settings
configuration.ModInfoPosition = ModInfoTabControl.ModMetaSplitPosition;
configuration.ModInfoPosition = ModInfo.ModMetaSplitPosition;

// Save the active filter
configuration.ActiveFilter = (int)mainModList.ModFilter;
Expand Down Expand Up @@ -676,7 +676,7 @@ private void MarkAllUpdatesToolButton_Click(object sender, EventArgs e)

public void UpdateModContentsTree(CkanModule module, bool force = false)
{
ModInfoTabControl.UpdateModContentsTree(module, force);
ModInfo.UpdateModContentsTree(module, force);
}

private void ApplyToolButton_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -792,7 +792,7 @@ public async Task UpdateChangeSetAndConflicts(IRegistryQuerier registry)
catch (TooManyModsProvideKraken)
{
// Can be thrown by ComputeChangeSetFromModList if the user cancels out of it.
// We can just rerun it as the ModInfoTabControl has been removed.
// We can just rerun it as the ModInfo has been removed.
too_many_provides_thrown = true;
}
catch (DependencyNotSatisfiedKraken k)
Expand Down Expand Up @@ -1242,7 +1242,7 @@ private GUIMod ActiveModInfo
{
splitContainer1.Panel2Collapsed = false;
}
ModInfoTabControl.SelectedModule = value;
ModInfo.SelectedModule = value;
}
}
}
Expand Down Expand Up @@ -1329,7 +1329,7 @@ private void ModList_MouseDown(object sender, MouseEventArgs e)

private void reinstallToolStripMenuItem_Click(object sender, EventArgs e)
{
GUIMod module = ModInfoTabControl.SelectedModule;
GUIMod module = ModInfo.SelectedModule;
if (module == null || !module.IsCKAN)
return;

Expand Down Expand Up @@ -1371,23 +1371,23 @@ private void reinstallToolStripMenuItem_Click(object sender, EventArgs e)

private void downloadContentsToolStripMenuItem_Click(object sender, EventArgs e)
{
ModInfoTabControl.StartDownload(ModInfoTabControl.SelectedModule);
ModInfo.StartDownload(ModInfo.SelectedModule);
}

private void purgeContentsToolStripMenuItem_Click(object sender, EventArgs e)
{
// Purge other versions as well since the user is likely to want that
// and has no other way to achieve it
if (ModInfoTabControl.SelectedModule != null)
if (ModInfo.SelectedModule != null)
{
IRegistryQuerier registry = RegistryManager.Instance(CurrentInstance).registry;
var allAvail = registry.AllAvailable(ModInfoTabControl.SelectedModule.Identifier);
var allAvail = registry.AllAvailable(ModInfo.SelectedModule.Identifier);
foreach (CkanModule mod in allAvail)
{
Manager.Cache.Purge(mod);
}
ModInfoTabControl.SelectedModule.UpdateIsCached();
UpdateModContentsTree(ModInfoTabControl.SelectedModule.ToCkanModule(), true);
ModInfo.SelectedModule.UpdateIsCached();
UpdateModContentsTree(ModInfo.SelectedModule.ToCkanModule(), true);
}
}

Expand Down
Loading

0 comments on commit d917cc0

Please sign in to comment.