Skip to content

Commit

Permalink
Add the option to change the UI Theme at runtime (#2693)
Browse files Browse the repository at this point in the history
* Setup for testing

* Working Example for Background

* Almost all MainBackgrounColor working

* Random Color PoC

* Fix DBorderColor

* prevent old logic from replacing colors in memory at startup

* Comment out resources in xaml

* Finish new Button

* Remove Pulse, Load Windows default Theme

* Fix Colors

* Fix Toggle Colors

* working version, with shared still being mostly applied be replace instead of resouces

* Load all entries in themes.json as Resource and reference them in inputXML.xaml

* Rename File to match Function Name

* Hotfix for Sync with main

* Remove Static Set-WinUtilUITheme function/file

* Rename File and Function

* Cleanup and Stuff

* Unify Button Theme with rest of UI

* Refactor/Optimazation

* Performance optimization

* Add Comments

* Rename Functions and Variables to be more concise and descriptive

* Add persistence to the user Theme Preference across winutil restarts

* Reimplement Theme Chagnes from #2722

* Add AUTO option to follow window theme and add dropdown instead toggle

* Formatting and deleting temp file

* Fix small display bug where Dropdown would remain open for settings and themes

* Remove terniary operators because only PS7+ is supported
  • Loading branch information
Marterich authored Sep 20, 2024
1 parent 9136ed9 commit 0251757
Show file tree
Hide file tree
Showing 8 changed files with 575 additions and 531 deletions.
265 changes: 98 additions & 167 deletions config/themes.json
Original file line number Diff line number Diff line change
@@ -1,169 +1,100 @@
{
"_default": {
"CustomDialogFontSize": "12",
"CustomDialogFontSizeHeader": "14",
"CustomDialogIconSize": "25",
"CustomDialogWidth": "400",
"CustomDialogHeight": "200",

"FontSize": "12",
"FontFamily": "Arial",
"FontSizeHeading": "16",
"HeaderFontFamily": "Consolas, Monaco",

"CheckBoxBulletDecoratorSize": "14",
"CheckBoxMargin": "15,0,0,2",

"TabContentMargin": "5",
"TabButtonFontSize": "14",
"TabButtonWidth": "100",
"TabButtonHeight": "25",
"TabRowHeightInPixels": "50",
"IconFontSize": "14",
"IconButtonSize": "35",
"SettingsIconFontSize": "18",
"CloseIconFontSize": "18",

"MicroWinLogoSize": "10",
"MicrowinCheckBoxMargin": "-10,5,0,0",

"ProgressBarForegroundColor": "#2e77ff",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#232629",

"ComboBoxBackgroundColor": "#F7F7F7",
"LabelboxForegroundColor": "#232629",
"MainForegroundColor": "#232629",
"MainBackgroundColor": "#F7F7F7",
"LabelBackgroundColor": "#F7F7F7",
"LinkForegroundColor": "#232629",
"LinkHoverForegroundColor": "#232629",
"GroupBorderBackgroundColor": "#232629",
"ComboBoxForegroundColor": "#232629",

"ButtonFontSize": "12",
"ButtonFontFamily": "Arial",
"ButtonWidth": "200",
"ButtonHeight": "25",
"ConfigTabButtonFontSize": "16",

"SearchBarWidth": "200",
"SearchBarHeight": "25",
"SearchBarTextBoxFontSize": "12",
"SearchBarClearButtonFontSize": "14",

"ButtonInstallBackgroundColor": "#F7F7F7",
"ButtonTweaksBackgroundColor": "#F7F7F7",
"ButtonConfigBackgroundColor": "#F7F7F7",
"ButtonUpdatesBackgroundColor": "#F7F7F7",
"ButtonInstallForegroundColor": "#232629",
"ButtonTweaksForegroundColor": "#232629",
"ButtonConfigForegroundColor": "#232629",
"ButtonUpdatesForegroundColor": "#232629",
"ButtonBackgroundColor": "#F5F5F5",
"ButtonBackgroundPressedColor": "#1A1A1A",
"CheckboxMouseOverColor": "#999999",
"ButtonBackgroundMouseoverColor": "#C2C2C2",
"ButtonBackgroundSelectedColor": "#F0F0F0",
"ButtonForegroundColor": "#232629",
"ToggleButtonOnColor": "#2e77ff",

"ButtonBorderThickness": "1",
"ButtonMargin": "1",
"ButtonCornerRadius": "2",
"BorderColor": "#232629",
"BorderOpacity": "0.2",
"ShadowPulse": "Forever"
},
"Classic": {
"ComboBoxBackgroundColor": "#F7F7F7",
"LabelboxForegroundColor": "#232629",
"MainForegroundColor": "#232629",
"MainBackgroundColor": "#F7F7F7",
"LabelBackgroundColor": "#F7F7F7",
"LinkForegroundColor": "#232629",
"LinkHoverForegroundColor": "#232629",
"GroupBorderBackgroundColor": "#232629",
"ComboBoxForegroundColor": "#232629",

"ButtonInstallBackgroundColor": "#F7F7F7",
"ButtonTweaksBackgroundColor": "#F7F7F7",
"ButtonConfigBackgroundColor": "#F7F7F7",
"ButtonUpdatesBackgroundColor": "#F7F7F7",
"ButtonInstallForegroundColor": "#232629",
"ButtonTweaksForegroundColor": "#232629",
"ButtonConfigForegroundColor": "#232629",
"ButtonUpdatesForegroundColor": "#232629",
"ButtonBackgroundColor": "#F5F5F5",
"ButtonBackgroundPressedColor": "#1A1A1A",
"CheckboxMouseOverColor": "#999999",
"ButtonBackgroundMouseoverColor": "#C2C2C2",
"ButtonBackgroundSelectedColor": "#F0F0F0",
"ButtonForegroundColor": "#232629",
"ToggleButtonOnColor": "#2e77ff"
},
"Matrix": {
"ComboBoxBackgroundColor": "#232629",
"LabelboxForegroundColor": "#f7f7f7",
"MainForegroundColor": "#F7F7F7",
"MainBackgroundColor": "#232629",
"LabelBackgroundColor": "#232629",
"LinkForegroundColor": "#add8e6",
"LinkHoverForegroundColor": "#F7F7F7",
"ComboBoxForegroundColor": "#81a1c1",

"ProgressBarForegroundColor": "#222222",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#cccccc",

"ButtonInstallBackgroundColor": "#222222",
"ButtonTweaksBackgroundColor": "#333333",
"ButtonConfigBackgroundColor": "#444444",
"ButtonUpdatesBackgroundColor": "#555555",
"ButtonInstallForegroundColor": "#F7F7F7",
"ButtonTweaksForegroundColor": "#F7F7F7",
"ButtonConfigForegroundColor": "#F7F7F7",
"ButtonUpdatesForegroundColor": "#F7F7F7",
"ButtonBackgroundColor": "#1E3747",
"ButtonBackgroundPressedColor": "#F7F7F7",
"ButtonBackgroundMouseoverColor": "#3B4252",
"ButtonBackgroundSelectedColor": "#5E81AC",
"ButtonForegroundColor": "#F7F7F7",
"ToggleButtonOnColor": "#2e77ff",

"BorderColor": "#0060CC",
"BorderOpacity": "0.2",
"ShadowPulse": "0:0:3"
},
"Dark": {
"ComboBoxBackgroundColor": "#1e3747",
"LabelboxForegroundColor": "#0567ff",
"MainForegroundColor": "#F7F7F7",
"MainBackgroundColor": "#121212",
"LabelBackgroundColor": "#121212",
"LinkForegroundColor": "#add8e6",
"LinkHoverForegroundColor": "#F7F7F7",
"ComboBoxForegroundColor": "#f7f7f7",

"ProgressBarForegroundColor": "#222222",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#cccccc",

"ButtonInstallBackgroundColor": "#222222",
"ButtonTweaksBackgroundColor": "#333333",
"ButtonConfigBackgroundColor": "#444444",
"ButtonUpdatesBackgroundColor": "#555555",
"ButtonInstallForegroundColor": "#F7F7F7",
"ButtonTweaksForegroundColor": "#F7F7F7",
"ButtonConfigForegroundColor": "#F7F7F7",
"ButtonUpdatesForegroundColor": "#F7F7F7",
"ButtonBackgroundColor": "#1E3747",
"ButtonBackgroundPressedColor": "#00CFFF",
"ButtonBackgroundMouseoverColor": "#5E81AC",
"ButtonBackgroundSelectedColor": "#5E81AC",
"ButtonForegroundColor": "#F7F7F7",
"ToggleButtonOnColor": "#2e77ff",

"BorderColor": "#2F373D"
}
"shared":{
"CustomDialogFontSize": "12",
"CustomDialogFontSizeHeader": "14",
"CustomDialogIconSize": "25",
"CustomDialogWidth": "400",
"CustomDialogHeight": "200",
"FontSize": "12",
"FontFamily": "Arial",
"FontSizeHeading": "16",
"HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorSize": "14",
"CheckBoxMargin": "15,0,0,2",
"TabContentMargin": "5",
"TabButtonFontSize": "14",
"TabButtonWidth": "100",
"TabButtonHeight": "25",
"TabRowHeightInPixels": "50",
"IconFontSize": "14",
"IconButtonSize": "35",
"SettingsIconFontSize": "18",
"CloseIconFontSize": "18",
"MicroWinLogoSize": "10",
"MicrowinCheckBoxMargin": "-10,5,0,0",
"GroupBorderBackgroundColor": "#232629",
"ButtonFontSize": "12",
"ButtonFontFamily": "Arial",
"ButtonWidth": "200",
"ButtonHeight": "25",
"ConfigTabButtonFontSize": "16",
"SearchBarWidth": "200",
"SearchBarHeight": "25",
"SearchBarTextBoxFontSize": "12",
"SearchBarClearButtonFontSize": "14",
"CheckboxMouseOverColor": "#999999",
"ButtonBorderThickness": "1",
"ButtonMargin": "1",
"ButtonCornerRadius": "2"
},
"Light": {
"ComboBoxForegroundColor": "#232629",
"ComboBoxBackgroundColor": "#F7F7F7",
"LabelboxForegroundColor": "#232629",
"MainForegroundColor": "#232629",
"MainBackgroundColor": "#F7F7F7",
"LabelBackgroundColor": "#F7F7F7",
"LinkForegroundColor": "#232629",
"LinkHoverForegroundColor": "#232629",

"ProgressBarForegroundColor": "#2e77ff",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#232629",
"ButtonInstallBackgroundColor": "#F7F7F7",
"ButtonTweaksBackgroundColor": "#F7F7F7",
"ButtonConfigBackgroundColor": "#F7F7F7",
"ButtonUpdatesBackgroundColor": "#F7F7F7",
"ButtonInstallForegroundColor": "#232629",
"ButtonTweaksForegroundColor": "#232629",
"ButtonConfigForegroundColor": "#232629",
"ButtonUpdatesForegroundColor": "#232629",
"ButtonBackgroundColor": "#F5F5F5",
"ButtonBackgroundPressedColor": "#1A1A1A",
"ButtonBackgroundMouseoverColor": "#C2C2C2",
"ButtonBackgroundSelectedColor": "#F0F0F0",
"ButtonForegroundColor": "#232629",
"ToggleButtonOnColor": "#2e77ff",
"BorderColor": "#232629",
"BorderOpacity": "0.2"

},
"Dark": {
"ComboBoxForegroundColor": "#1e3747",
"ComboBoxBackgroundColor": "#232629",
"LabelboxForegroundColor": "#0567ff",
"MainForegroundColor": "#F7F7F7",
"MainBackgroundColor": "#121212",
"LabelBackgroundColor": "#121212",
"LinkForegroundColor": "#add8e6",
"LinkHoverForegroundColor": "#F7F7F7",
"ProgressBarForegroundColor": "#222222",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#cccccc",
"ButtonInstallBackgroundColor": "#222222",
"ButtonTweaksBackgroundColor": "#333333",
"ButtonConfigBackgroundColor": "#444444",
"ButtonUpdatesBackgroundColor": "#555555",
"ButtonInstallForegroundColor": "#F7F7F7",
"ButtonTweaksForegroundColor": "#F7F7F7",
"ButtonConfigForegroundColor": "#F7F7F7",
"ButtonUpdatesForegroundColor": "#F7F7F7",
"ButtonBackgroundColor": "#1E3747",
"ButtonBackgroundPressedColor": "#F7F7F7",
"ButtonBackgroundMouseoverColor": "#3B4252",
"ButtonBackgroundSelectedColor": "#5E81AC",
"ButtonForegroundColor": "#F7F7F7",
"ToggleButtonOnColor": "#2e77ff",
"BorderColor": "#2F373D",
"BorderOpacity": "0.2"
}
}
Loading

0 comments on commit 0251757

Please sign in to comment.