appsList = new();
57 |
58 | foreach(var item in selectedApps)
59 | {
60 | appsList.Add(item.ToString());
61 | }
62 |
63 | Spicetify.Instance.Settings.CustomApps = appsList;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Pages/ThemesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace SpicetifyManager.Pages
4 | {
5 | ///
6 | /// Interaction logic for ThemesPage.xaml
7 | ///
8 | public partial class ThemesPage
9 | {
10 | public ThemesPage()
11 | {
12 | InitializeComponent();
13 |
14 | if(Spicetify.Instance.Detected)
15 | InitControls();
16 | }
17 |
18 | public void InitControls()
19 | {
20 | ThemesListBox.ItemsSource = Spicetify.Instance.ThemesList;
21 |
22 | if(Spicetify.Instance.Settings.CurrentTheme == string.Empty)
23 | ThemesListBox.SelectedIndex = ThemesListBox.Items.IndexOf("(none)");
24 | else
25 | ThemesListBox.SelectedIndex = ThemesListBox.Items.IndexOf(Spicetify.Instance.Settings.CurrentTheme);
26 |
27 | ColorSchemesListBox.ItemsSource = Spicetify.Instance.GetThemeColors(Spicetify.Instance.Settings.CurrentTheme);
28 |
29 | if(Spicetify.Instance.Settings.ColorScheme == string.Empty)
30 | ColorSchemesListBox.SelectedItem = null;
31 | else
32 | ColorSchemesListBox.SelectedIndex = ColorSchemesListBox.Items.IndexOf(Spicetify.Instance.Settings.ColorScheme);
33 | }
34 |
35 | private void ThemesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
36 | {
37 | ColorSchemesListBox.ItemsSource = Spicetify.Instance.GetThemeColors(ThemesListBox.SelectedItem.ToString());
38 | }
39 |
40 | public void ReadInput()
41 | {
42 | if(ThemesListBox.SelectedItem.ToString() == "(none)")
43 | Spicetify.Instance.Settings.CurrentTheme = "";
44 | else
45 | Spicetify.Instance.Settings.CurrentTheme = ThemesListBox.SelectedItem.ToString();
46 |
47 | if(ColorSchemesListBox.SelectedItem == null)
48 | Spicetify.Instance.Settings.ColorScheme = "";
49 | else
50 | Spicetify.Instance.Settings.ColorScheme = ColorSchemesListBox.SelectedItem.ToString();
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SpicetifyManager
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## Features
17 | - Autodetection of themes, colors, plugins and custom apps.
18 | - Full support to Spicetify config file settings, preprocesses and additional options.
19 | - Portable.
20 | - Spicetify logs directly in app.
21 | - Version checker.
22 |
23 | ## Requirements
24 | - Latest version of spicetify-cli.
25 | - NET 6.0.x Desktop Runtime. Can be downloaded here.
26 | - Windows 11 or Windows 10 (18362) or newer.
27 |
28 | ## Installation
29 | - Simply extract the archive (SpicetifyManager-X.X.X-AnyCPU.zip) to the desired directory.
30 | #### For a custom Spicetify installation(other than the recommended one)
31 | - Edit directories in config.ini to match your spicetify installation directories.
32 |
33 | ## References
34 | - ini-parser: https://github.com/rickyah/ini-parser
35 | - Material Design Icons: https://github.com/google/material-design-icons
36 | - ModernWpf: https://github.com/Kinnara/ModernWpf
37 | - Octokit: https://github.com/octokit/octokit.net
38 | - Spicetify: https://spicetify.app/
39 |
--------------------------------------------------------------------------------
/Pages/ThemesPage.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Pages/PluginsPage.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/SpicetifyManager.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows10.0.18362.0
6 | enable
7 | True
8 | portable
9 | False
10 | SpicetifyManager.App
11 | False
12 | Resources\icon.ico
13 | AnyCPU
14 | app.manifest
15 | Spicetify Manager
16 | $(AssemblyVersion)
17 | 2.3.0
18 | README.md
19 | git
20 | https://github.com/AdotBdot/SpicetifyManager
21 | C:\Users\adamb\source\CSharp\SpicetifyManager\LICENSE
22 | $(AssemblyVersion)
23 |
24 |
25 |
26 | embedded
27 |
28 |
29 |
30 | embedded
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | Always
59 |
60 |
61 | True
62 | \
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Pages/ManagePage.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Source/IniFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using IniParser;
6 | using IniParser.Model;
7 |
8 | namespace SpicetifyManager
9 | {
10 | class IniFile
11 | {
12 | public IniFile()
13 | {
14 | _Parser = new FileIniDataParser();
15 | }
16 |
17 | public void LoadFile(string configFile)
18 | {
19 | try
20 | {
21 | _Data = _Parser.ReadFile(configFile);
22 | }
23 | catch(FileNotFoundException)
24 | {
25 | Logger.Log($"File \"{configFile}\" does not exist.");
26 | }
27 | }
28 |
29 | public bool ReadBool(string section, string key)
30 | {
31 | if(!_Data[section].ContainsKey(key))
32 | return false;
33 |
34 | return ReadString(section, key) == "1";
35 | }
36 |
37 | public void WriteBool(string section, string key, bool value)
38 | {
39 | _Data[section][key] = (value == true ? "1" : "0");
40 | }
41 |
42 | public List ReadList(string section, string key)
43 | {
44 | if(!_Data[section].ContainsKey(key))
45 | return new List();
46 |
47 | string l = RemoveWhitespace(ReadString(section, key));
48 | List returnValue = new List();
49 |
50 | while(l.Contains("|"))
51 | {
52 | string value = l.Substring(0, l.IndexOf("|", StringComparison.Ordinal));
53 | returnValue.Add(value);
54 | l = l.Replace(value + "|", string.Empty);
55 | }
56 |
57 | returnValue.Add(l);
58 |
59 | return returnValue;
60 | }
61 |
62 | public void WriteList(string section, string key, List value)
63 | {
64 | string s;
65 |
66 | if(value.Count != 0)
67 | {
68 | s = value[0];
69 | for(int i = 1; i < value.Count; i++)
70 | {
71 | s += "|";
72 | s += value[i];
73 | }
74 | }
75 | else
76 | s = string.Empty;
77 |
78 | _Data[section][key] = s;
79 | }
80 |
81 | public string ReadString(string section, string key)
82 | {
83 | if(!_Data[section].ContainsKey(key))
84 | return string.Empty;
85 | return _Data[section][key];
86 | }
87 |
88 | public void WriteString(string section, string key, string value)
89 | {
90 | _Data[section][key] = value;
91 | }
92 |
93 | private string RemoveWhitespace(string input)
94 | {
95 | return new string(input.ToCharArray().Where(c => !char.IsWhiteSpace(c)).ToArray());
96 | }
97 |
98 | public void WriteFile(string configFile)
99 | {
100 | _Parser.WriteFile(configFile, _Data);
101 | }
102 |
103 | private FileIniDataParser _Parser;
104 | private IniData _Data;
105 | }
106 | }
--------------------------------------------------------------------------------
/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
54 |
62 |
63 |
64 |
65 |
66 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Styles/DropDownButton.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
65 |
--------------------------------------------------------------------------------
/Pages/AboutPage.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
67 |
69 |
71 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/Pages/SettingsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using ModernWpf.Controls;
2 |
3 | namespace SpicetifyManager.Pages
4 | {
5 | ///
6 | /// Interaction logic for SettingsPage.xaml
7 | ///
8 | public partial class SettingsPage : Page
9 | {
10 | public SettingsPage()
11 | {
12 | InitializeComponent();
13 | InitControls();
14 | }
15 |
16 | public void InitControls()
17 | {
18 | SpotifyPath.Text = Spicetify.Instance.Settings.SpotifyPath;
19 | Prefs.Text = Spicetify.Instance.Settings.PrefsPath;
20 | LaunchFlags.Text = Spicetify.Instance.Settings.SpotifyLaunchFlags;
21 |
22 | OverwriteAssets.IsChecked = Spicetify.Instance.Settings.OverwriteAssets;
23 | InjectCss.IsChecked = Spicetify.Instance.Settings.InjectCss;
24 | ReplaceColors.IsChecked = Spicetify.Instance.Settings.ReplaceColors;
25 | CheckSpicetifyUpgrade.IsChecked = Spicetify.Instance.Settings.CheckSpicetifyUpgrade;
26 | HomeConfig.IsChecked = Spicetify.Instance.Settings.HomeConfig;
27 | SidebarConfig.IsChecked = Spicetify.Instance.Settings.SidebarConfig;
28 | ExperimentalFeatures.IsChecked = Spicetify.Instance.Settings.ExperimentalFeatures;
29 |
30 | ExposeAPIs.IsChecked = Spicetify.Instance.Settings.ExposeApis;
31 | DisableSentry.IsChecked = Spicetify.Instance.Settings.DisableSentry;
32 | DisableUILogging.IsChecked = Spicetify.Instance.Settings.DisableUiLogging;
33 | DisableUpgradeCheck.IsChecked = Spicetify.Instance.Settings.DisableUpgradeCheck;
34 | RemoveRTLRules.IsChecked = Spicetify.Instance.Settings.RemoveRtlRule;
35 | }
36 |
37 | public string SpotifyPathProperty
38 | {
39 | get {return Spicetify.Instance.Settings.SpotifyPath;}
40 | set {Spicetify.Instance.Settings.SpotifyPath = value;}
41 | }
42 |
43 | public string PrefsPathProperty
44 | {
45 | get {return Spicetify.Instance.Settings.PrefsPath;}
46 | set {Spicetify.Instance.Settings.PrefsPath = value;}
47 | }
48 |
49 | public string SpotifyLaunchFlagsProperty
50 | {
51 | get {return Spicetify.Instance.Settings.SpotifyLaunchFlags;}
52 | set {Spicetify.Instance.Settings.SpotifyLaunchFlags = value;}
53 | }
54 |
55 | public bool OverwriteAssetsProperty
56 | {
57 | get {return Spicetify.Instance.Settings.OverwriteAssets;}
58 | set {Spicetify.Instance.Settings.OverwriteAssets = value;}
59 | }
60 |
61 | public bool InjectCssProperty
62 | {
63 | get {return Spicetify.Instance.Settings.InjectCss;}
64 | set {Spicetify.Instance.Settings.InjectCss = value;}
65 | }
66 | public bool InjectThemeJsProperty
67 | {
68 | get {return Spicetify.Instance.Settings.InjectThemeJs;}
69 | set {Spicetify.Instance.Settings.InjectThemeJs = value;}
70 | }
71 |
72 | public bool ReplaceColorsProperty
73 | {
74 | get {return Spicetify.Instance.Settings.ReplaceColors;}
75 | set {Spicetify.Instance.Settings.ReplaceColors = value;}
76 | }
77 |
78 | public bool CheckSpicetifyUpgradeProperty
79 | {
80 | get {return Spicetify.Instance.Settings.CheckSpicetifyUpgrade;}
81 | set {Spicetify.Instance.Settings.CheckSpicetifyUpgrade = value;}
82 | }
83 |
84 | public bool HomeConfigProperty
85 | {
86 | get {return Spicetify.Instance.Settings.HomeConfig;}
87 | set {Spicetify.Instance.Settings.HomeConfig = value;}
88 | }
89 |
90 | public bool SidebarConfigProperty
91 | {
92 | get {return Spicetify.Instance.Settings.SidebarConfig;}
93 | set {Spicetify.Instance.Settings.SidebarConfig = value;}
94 | }
95 |
96 | public bool ExperimentalFeaturesProperty
97 | {
98 | get {return Spicetify.Instance.Settings.ExperimentalFeatures;}
99 | set {Spicetify.Instance.Settings.ExperimentalFeatures = value;}
100 | }
101 |
102 | public bool ExposeApisProperty
103 | {
104 | get {return Spicetify.Instance.Settings.ExposeApis;}
105 | set {Spicetify.Instance.Settings.ExposeApis = value;}
106 | }
107 |
108 | public bool DisableSentryProperty
109 | {
110 | get {return Spicetify.Instance.Settings.DisableSentry;}
111 | set {Spicetify.Instance.Settings.DisableSentry = value;}
112 | }
113 |
114 | public bool DisableUiLoggingProperty
115 | {
116 | get {return Spicetify.Instance.Settings.DisableUiLogging;}
117 | set {Spicetify.Instance.Settings.DisableUiLogging = value;}
118 | }
119 |
120 | public bool DisableUpgradeCheckProperty
121 | {
122 | get {return Spicetify.Instance.Settings.DisableUpgradeCheck;}
123 | set {Spicetify.Instance.Settings.DisableUpgradeCheck = value;}
124 | }
125 |
126 | public bool RemoveRtlRuleProperty
127 | {
128 | get {return Spicetify.Instance.Settings.RemoveRtlRule;}
129 | set {Spicetify.Instance.Settings.RemoveRtlRule = value;}
130 | }
131 | }
132 | }
--------------------------------------------------------------------------------
/Source/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Drawing.Text;
4 | using System.Runtime.InteropServices;
5 | using System.Threading.Tasks;
6 | using Octokit;
7 | using Application = System.Windows.Forms.Application;
8 |
9 | namespace SpicetifyManager
10 | {
11 | namespace My
12 | {
13 | public static class Colors
14 | {
15 | public static Color GetBg(int elevationStep)
16 | {
17 | switch(elevationStep)
18 | {
19 | case 0:
20 | return Color.FromArgb(18, 18, 18);
21 | case 1:
22 | return Color.FromArgb(29, 29, 29);
23 | case 2:
24 | return Color.FromArgb(33, 33, 33);
25 | case 3:
26 | return Color.FromArgb(36, 36, 36);
27 | case 4:
28 | return Color.FromArgb(38, 38, 38);
29 | case 5:
30 | return Color.FromArgb(44, 44, 44);
31 | case 6:
32 | return Color.FromArgb(45, 45, 45);
33 | case 7:
34 | return Color.FromArgb(50, 50, 50);
35 | case 8:
36 | return Color.FromArgb(53, 53, 53);
37 | case 9:
38 | return Color.FromArgb(55, 55, 55);
39 | default:
40 | return Color.FromArgb(18, 18, 18);
41 | }
42 | }
43 |
44 | public static Color Primary = Color.FromArgb(234, 82, 58);
45 | public static Color TxtLight = SystemColors.ControlLightLight;
46 | public static Color TxtDark = SystemColors.ControlText;
47 | }
48 |
49 | public static class Fonts
50 | {
51 | public static PrivateFontCollection Pfc = new PrivateFontCollection();
52 |
53 | public static void LoadFonts()
54 | {
55 | LoadFontFromResx(SpicetifyManager.Properties.Resources.OpenSans_Regular);
56 | LoadFontFromResx(SpicetifyManager.Properties.Resources.OpenSans_SemiBold);
57 | }
58 |
59 | [System.Runtime.InteropServices.DllImport("gdi32.dll")]
60 | private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont,
61 | IntPtr pdv, [System.Runtime.InteropServices.In] ref uint pcFonts);
62 |
63 | private static void LoadFontFromResx(byte[] font)
64 | {
65 | byte[] fontData = font;
66 | IntPtr fontPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length);
67 | System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length);
68 | uint dummy = 0;
69 | Pfc.AddMemoryFont(fontPtr, font.Length);
70 | AddFontMemResourceEx(fontPtr, (uint)font.Length, IntPtr.Zero, ref dummy);
71 | System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr);
72 | }
73 | }
74 |
75 | public static class Version
76 | {
77 | public static async Task GetLastTag(string owner, string repoName)
78 | {
79 | GitHubClient git = new GitHubClient(new ProductHeaderValue("Tag"));
80 | var repo = await git.Repository.Get(owner, repoName);
81 | var tags = await git.Repository.GetAllTags(repo.Id);
82 |
83 | return tags[0].Name;
84 | }
85 |
86 | public static readonly string CurrentVersion = "v1.3.2";
87 | }
88 | }
89 |
90 | internal static class Program
91 | {
92 | [DllImport("kernel32.dll")]
93 | static extern IntPtr GetConsoleWindow();
94 |
95 | [DllImport("user32.dll")]
96 | static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
97 |
98 | [DllImport("user32.dll")]
99 | [return: MarshalAs(UnmanagedType.Bool)]
100 | static extern bool IsWindowVisible(IntPtr hWnd);
101 |
102 | const int SW_HIDE = 0;
103 | const int SW_SHOW = 5;
104 |
105 | public static void ToogleConsole()
106 | {
107 | if(IsWindowVisible(GetConsoleWindow()))
108 | ShowWindow(GetConsoleWindow(), SW_HIDE);
109 | else
110 | ShowWindow(GetConsoleWindow(), SW_SHOW);
111 | }
112 |
113 | ///
114 | /// The main entry point for the application.
115 | ///
116 | [STAThread]
117 | private static void Main()
118 | {
119 | ShowWindow(GetConsoleWindow(), SW_HIDE);
120 |
121 | My.Fonts.LoadFonts();
122 |
123 | string userDirectory = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\.spicetify\");
124 | string cliDirectory = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\spicetify-cli\");
125 |
126 | Spicetify spicetify = new Spicetify(userDirectory, cliDirectory);
127 | Settings settings = new Settings(spicetify);
128 |
129 | spicetify.ListAll();
130 | settings.LoadConfig();
131 |
132 | Application.EnableVisualStyles();
133 | Application.SetCompatibleTextRenderingDefault(false);
134 | Application.Run(new MainForm(settings, spicetify));
135 | }
136 | }
137 | }
--------------------------------------------------------------------------------
/Pages/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Pages/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Navigation;
7 | using Page = ModernWpf.Controls.Page;
8 |
9 | namespace SpicetifyManager.Pages
10 | {
11 | ///
12 | /// Interaction logic for MainWindow.xaml
13 | ///
14 | public partial class MainWindow : Window
15 | {
16 | public MainWindow()
17 | {
18 | Pages = new()
19 | {
20 | {"Start", new StartPage()},
21 | {"Logs", new LogsPage()},
22 | {"Install", new InstallPage()}
23 | };
24 |
25 | InitializeComponent();
26 |
27 | Pages.Add("Themes", new ThemesPage());
28 | Pages.Add("Plugins", new PluginsPage());
29 | Pages.Add("Settings", new SettingsPage());
30 | Pages.Add("Manage", new ManagePage());
31 | Pages.Add("About", new AboutPage());
32 |
33 | if(Spicetify.Instance.Detected)
34 | {
35 | Navigate("Start");
36 | InstallBtn.Visibility = Visibility.Hidden;
37 | }
38 | else
39 | {
40 | ApplyBtn.IsEnabled = false;
41 | SaveBtn.IsEnabled = false;
42 | UpdateBtn.IsEnabled = false;
43 | OpenBtn.IsEnabled = false;
44 | ReloadBtn.IsEnabled = false;
45 | ThemesBtn.IsEnabled = false;
46 | PluginsBtn.IsEnabled = false;
47 | ManageBtn.IsEnabled = false;
48 | SettingsBtn.IsEnabled = false;
49 | AboutBtn.IsEnabled = false;
50 | Navigate("Install");
51 | }
52 |
53 | }
54 |
55 | //Navigation
56 | public readonly Dictionary Pages;
57 |
58 | private void Navigate(string navItemTag)
59 | {
60 | ContentFrame.Navigate(Pages[navItemTag]);
61 | }
62 |
63 | private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
64 | {
65 | if(ContentFrame.Content == null)
66 | return;
67 |
68 | KeyValuePair item = Pages.FirstOrDefault(page => page.Value == e.Content);
69 |
70 | foreach(Button button in NavBar.Children.OfType