diff --git a/config/feature.json b/config/feature.json
index d2f5a161..bd66859a 100644
--- a/config/feature.json
+++ b/config/feature.json
@@ -184,90 +184,104 @@
"category": "Features",
"panel": "1",
"Order": "a060_",
- "Type": "150"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelAutologin": {
"Content": "Set Up Autologin",
"category": "Fixes",
"Order": "a040_",
"panel": "1",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFFixesUpdate": {
"Content": "Reset Windows Update",
"category": "Fixes",
"panel": "1",
"Order": "a041_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFFixesNetwork": {
"Content": "Reset Network",
"category": "Fixes",
"Order": "a042_",
"panel": "1",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelDISM": {
"Content": "System Corruption Scan",
"category": "Fixes",
"panel": "1",
"Order": "a043_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFFixesWinget": {
"Content": "WinGet Reinstall",
"category": "Fixes",
"panel": "1",
"Order": "a044_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFRunAdobeCCCleanerTool": {
"Content": "Remove Adobe Creative Cloud",
"category": "Fixes",
"panel": "1",
"Order": "a045_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelnetwork": {
"Content": "Network Connections",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelcontrol": {
"Content": "Control Panel",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelpower": {
"Content": "Power Panel",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelregion": {
"Content": "Region",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelsound": {
"Content": "Sound Settings",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPanelsystem": {
"Content": "System Properties",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFPaneluser": {
"Content": "User Accounts",
"category": "Legacy Windows Panels",
"panel": "2",
- "Type": "200"
+ "Type": "Button",
+ "ButtonWidth": "300"
}
}
diff --git a/config/themes.json b/config/themes.json
index 7500bb87..4bc3766b 100644
--- a/config/themes.json
+++ b/config/themes.json
@@ -1,5 +1,30 @@
{
"Classic": {
+ "CustomDialogFontSize": "12",
+ "CustomDialogFontSizeHeader": "14",
+ "CustomDialogIconSize": "25",
+ "CustomDialogWidth": "400",
+ "CustomDialogHeight": "200",
+
+ "FontSize": "12",
+ "FontFamily": "Arial",
+ "FontSizeHeading": "14",
+ "HeaderFontFamily": "Consolas, Monaco",
+
+ "CheckBoxBulletDecoratorFontSize": "14",
+ "CheckBoxMargin": "15,0,0,2",
+
+ "TabButtonFontSize": "14",
+ "TabButtonWidth": "100",
+ "TabButtonHeight": "25",
+ "TabRowHeightInPixels": "50",
+ "IconFontSize": "14",
+ "IconButtonSize": "35",
+ "WinUtilIconSize": "Auto",
+ "SettingsIconFontSize": "18",
+
+ "MicroWinLogoSize": "10",
+
"ComboBoxBackgroundColor": "#FFFFFF",
"LabelboxForegroundColor": "#000000",
"MainForegroundColor": "#000000",
@@ -9,6 +34,18 @@
"LinkHoverForegroundColor": "#000000",
"GroupBorderBackgroundColor": "#000000",
"ComboBoxForegroundColor": "#000000",
+
+ "ButtonFontSize": "12",
+ "ButtonFontFamily": "Arial",
+ "ButtonWidth": "200",
+ "ButtonHeight": "25",
+ "ConfigTabButtonFontSize": "16",
+
+ "SearchBarWidth": "200",
+ "SearchBarHeight": "25",
+ "SearchBarTextBoxFontSize": "16",
+ "SearchBarClearButtonFontSize": "14",
+
"ButtonInstallBackgroundColor": "#FFFFFF",
"ButtonTweaksBackgroundColor": "#FFFFFF",
"ButtonConfigBackgroundColor": "#FFFFFF",
@@ -24,74 +61,148 @@
"ButtonBackgroundSelectedColor": "#F0F0F0",
"ButtonForegroundColor": "#000000",
"ToggleButtonOnColor": "#2e77ff",
+
"ButtonBorderThickness": "1",
"ButtonMargin": "1",
"ButtonCornerRadius": "2",
- "ToggleButtonHeight": "25",
"BorderColor": "#000000",
"BorderOpacity": "0.2",
"ShadowPulse": "Forever"
},
"Matrix": {
- "ComboBoxBackgroundColor": "#000000",
- "LabelboxForegroundColor": "#FFEE58",
- "MainForegroundColor": "#9CCC65",
- "MainBackgroundColor": "#000000",
- "LabelBackgroundColor": "#000000",
- "LinkForegroundColor": "#add8e6",
- "LinkHoverForegroundColor": "#FFFFFF",
- "ComboBoxForegroundColor": "#FFEE58",
- "ButtonInstallBackgroundColor": "#222222",
- "ButtonTweaksBackgroundColor": "#333333",
- "ButtonConfigBackgroundColor": "#444444",
- "ButtonUpdatesBackgroundColor": "#555555",
- "ButtonInstallForegroundColor": "#FFFFFF",
- "ButtonTweaksForegroundColor": "#FFFFFF",
- "ButtonConfigForegroundColor": "#FFFFFF",
- "ButtonUpdatesForegroundColor": "#FFFFFF",
- "ButtonBackgroundColor": "#000019",
- "ButtonBackgroundPressedColor": "#FFFFFF",
- "ButtonBackgroundMouseoverColor": "#A55A64",
- "ButtonBackgroundSelectedColor": "#FF5733",
- "ButtonForegroundColor": "#9CCC65",
- "ToggleButtonOnColor": "#2e77ff",
- "ButtonBorderThickness": "1",
- "ButtonMargin": "1",
- "ButtonCornerRadius": "2",
- "ToggleButtonHeight": "25",
- "BorderColor": "#FFAC1C",
- "BorderOpacity": "0.8",
- "ShadowPulse": "0:0:3"
+ "CustomDialogFontSize": "12",
+ "CustomDialogFontSizeHeader": "14",
+ "CustomDialogIconSize": "25",
+ "CustomDialogWidth": "400",
+ "CustomDialogHeight": "200",
+
+ "FontSize": "12",
+ "FontFamily": "Arial",
+ "FontSizeHeading": "14",
+ "HeaderFontFamily": "Consolas, Monaco",
+
+ "CheckBoxBulletDecoratorFontSize": "14",
+ "CheckBoxMargin": "15,0,0,2",
+
+ "TabButtonFontSize": "14",
+ "TabButtonWidth": "100",
+ "TabButtonHeight": "25",
+ "TabRowHeightInPixels": "50",
+ "IconFontSize": "14",
+ "IconButtonSize": "35",
+ "WinUtilIconSize": "Auto",
+ "SettingsIconFontSize": "18",
+
+ "MicroWinLogoSize": "10",
+
+ "ComboBoxBackgroundColor": "#000000",
+ "LabelboxForegroundColor": "#FFEE58",
+ "MainForegroundColor": "#9CCC65",
+ "MainBackgroundColor": "#000000",
+ "LabelBackgroundColor": "#000000",
+ "LinkForegroundColor": "#add8e6",
+ "LinkHoverForegroundColor": "#FFFFFF",
+ "ComboBoxForegroundColor": "#FFEE58",
+
+ "ButtonFontSize": "12",
+ "ButtonFontFamily": "Arial",
+ "ButtonWidth": "200",
+ "ButtonHeight": "25",
+ "ConfigTabButtonFontSize": "16",
+
+ "SearchBarWidth": "200",
+ "SearchBarHeight": "25",
+ "SearchBarTextBoxFontSize": "16",
+ "SearchBarClearButtonFontSize": "14",
+
+ "ButtonInstallBackgroundColor": "#222222",
+ "ButtonTweaksBackgroundColor": "#333333",
+ "ButtonConfigBackgroundColor": "#444444",
+ "ButtonUpdatesBackgroundColor": "#555555",
+ "ButtonInstallForegroundColor": "#FFFFFF",
+ "ButtonTweaksForegroundColor": "#FFFFFF",
+ "ButtonConfigForegroundColor": "#FFFFFF",
+ "ButtonUpdatesForegroundColor": "#FFFFFF",
+ "ButtonBackgroundColor": "#000019",
+ "ButtonBackgroundPressedColor": "#FFFFFF",
+ "ButtonBackgroundMouseoverColor": "#A55A64",
+ "ButtonBackgroundSelectedColor": "#FF5733",
+ "ButtonForegroundColor": "#9CCC65",
+ "ToggleButtonOnColor": "#2e77ff",
+
+ "ButtonBorderThickness": "1",
+ "ButtonMargin": "1",
+ "ButtonCornerRadius": "2",
+ "BorderColor": "#FFAC1C",
+ "BorderOpacity": "0.8",
+ "ShadowPulse": "0:0:3"
},
"Dark": {
- "ComboBoxBackgroundColor": "#000000",
- "LabelboxForegroundColor": "#FFEE58",
- "MainForegroundColor": "#9CCC65",
- "MainBackgroundColor": "#000000",
- "LabelBackgroundColor": "#000000",
- "LinkForegroundColor": "#add8e6",
- "LinkHoverForegroundColor": "#FFFFFF",
- "ComboBoxForegroundColor": "#FFEE58",
- "ButtonInstallBackgroundColor": "#222222",
- "ButtonTweaksBackgroundColor": "#333333",
- "ButtonConfigBackgroundColor": "#444444",
- "ButtonUpdatesBackgroundColor": "#555555",
- "ButtonInstallForegroundColor": "#FFFFFF",
- "ButtonTweaksForegroundColor": "#FFFFFF",
- "ButtonConfigForegroundColor": "#FFFFFF",
- "ButtonUpdatesForegroundColor": "#FFFFFF",
- "ButtonBackgroundColor": "#000019",
- "ButtonBackgroundPressedColor": "#9CCC65",
- "ButtonBackgroundMouseoverColor": "#FF5733",
- "ButtonBackgroundSelectedColor": "#FF5733",
- "ButtonForegroundColor": "#9CCC65",
- "ToggleButtonOnColor": "#2e77ff",
- "ButtonBorderThickness": "1",
- "ButtonMargin": "1",
- "ButtonCornerRadius": "2",
- "ToggleButtonHeight": "25",
- "BorderColor": "#FFAC1C",
- "BorderOpacity": "0.2",
- "ShadowPulse": "Forever"
+ "CustomDialogFontSize": "12",
+ "CustomDialogFontSizeHeader": "14",
+ "CustomDialogIconSize": "25",
+ "CustomDialogWidth": "400",
+ "CustomDialogHeight": "200",
+
+ "FontSize": "12",
+ "FontFamily": "Arial",
+ "FontSizeHeading": "14",
+ "HeaderFontFamily": "Consolas, Monaco",
+
+ "CheckBoxBulletDecoratorFontSize": "14",
+ "CheckBoxMargin": "15,0,0,2",
+
+ "TabButtonFontSize": "14",
+ "TabButtonWidth": "100",
+ "TabButtonHeight": "25",
+ "TabRowHeightInPixels": "50",
+ "IconFontSize": "14",
+ "IconButtonSize": "35",
+ "WinUtilIconSize": "Auto",
+ "SettingsIconFontSize": "18",
+
+ "MicroWinLogoSize": "10",
+
+ "ComboBoxBackgroundColor": "#000000",
+ "LabelboxForegroundColor": "#FFEE58",
+ "MainForegroundColor": "#9CCC65",
+ "MainBackgroundColor": "#000000",
+ "LabelBackgroundColor": "#000000",
+ "LinkForegroundColor": "#add8e6",
+ "LinkHoverForegroundColor": "#FFFFFF",
+ "ComboBoxForegroundColor": "#FFEE58",
+
+ "ButtonFontSize": "12",
+ "ButtonFontFamily": "Arial",
+ "ButtonWidth": "200",
+ "ButtonHeight": "25",
+ "ConfigTabButtonFontSize": "16",
+
+ "SearchBarWidth": "200",
+ "SearchBarHeight": "25",
+ "SearchBarTextBoxFontSize": "16",
+ "SearchBarClearButtonFontSize": "14",
+
+ "ButtonInstallBackgroundColor": "#222222",
+ "ButtonTweaksBackgroundColor": "#333333",
+ "ButtonConfigBackgroundColor": "#444444",
+ "ButtonUpdatesBackgroundColor": "#555555",
+ "ButtonInstallForegroundColor": "#FFFFFF",
+ "ButtonTweaksForegroundColor": "#FFFFFF",
+ "ButtonConfigForegroundColor": "#FFFFFF",
+ "ButtonUpdatesForegroundColor": "#FFFFFF",
+ "ButtonBackgroundColor": "#000019",
+ "ButtonBackgroundPressedColor": "#9CCC65",
+ "ButtonBackgroundMouseoverColor": "#FF5733",
+ "ButtonBackgroundSelectedColor": "#FF5733",
+ "ButtonForegroundColor": "#9CCC65",
+ "ToggleButtonOnColor": "#2e77ff",
+
+ "ButtonBorderThickness": "1",
+ "ButtonMargin": "1",
+ "ButtonCornerRadius": "2",
+ "BorderColor": "#FFAC1C",
+ "BorderOpacity": "0.2",
+ "ShadowPulse": "Forever"
}
-}
\ No newline at end of file
+}
diff --git a/config/tweaks.json b/config/tweaks.json
index 637aa9dc..125c0c62 100644
--- a/config/tweaks.json
+++ b/config/tweaks.json
@@ -2983,35 +2983,75 @@
]
},
"WPFToggleDarkMode": {
- "Content": "Dark Theme",
+ "Content": "Enable Dark Theme for Windows",
"Description": "Enable/Disable Dark Mode.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a060_",
+ "Order": "a100_",
"Type": "Toggle"
},
"WPFToggleBingSearch": {
- "Content": "Bing Search in Start Menu",
+ "Content": "Enable Bing Search in Start Menu",
"Description": "If enable then includes web search results from Bing in your Start Menu search.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a061_",
+ "Order": "a101_",
"Type": "Toggle"
},
"WPFToggleNumLock": {
- "Content": "NumLock on Startup",
+ "Content": "Enable NumLock on Startup",
"Description": "Toggle the Num Lock key state when your computer starts.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a062_",
+ "Order": "a102_",
"Type": "Toggle"
},
"WPFToggleVerboseLogon": {
- "Content": "Verbose Logon Messages",
+ "Content": "Enable Verbose Messages During Logon",
"Description": "Show detailed messages during the login process for troubleshooting and diagnostics.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a063_",
+ "Order": "a103_",
+ "Type": "Toggle"
+ },
+ "WPFToggleSnapWindow": {
+ "Content": "Enable Snap Window",
+ "Description": "If enabled you can align windows by dragging them. | Relogin Required",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a104_",
+ "Type": "Toggle"
+ },
+ "WPFToggleSnapFlyout": {
+ "Content": "Enable Snap Assist Flyout",
+ "Description": "If enabled then Snap preview is disabled when maximize button is hovered.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a105_",
+ "Type": "Toggle"
+ },
+ "WPFToggleSnapSuggestion": {
+ "Content": "Enable Snap Assist Suggestion",
+ "Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a106_",
+ "Type": "Toggle"
+ },
+ "WPFToggleMouseAcceleration": {
+ "Content": "Enable Mouse Acceleration",
+ "Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a107_",
+ "Type": "Toggle"
+ },
+ "WPFToggleStickyKeys": {
+ "Content": "Enable Sticky Keys",
+ "Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a108_",
"Type": "Toggle"
},
"WPFToggleShowExt": {
@@ -3019,55 +3059,31 @@
"Description": "If enabled then File extensions (e.g., .txt, .jpg) are visible.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a064_",
- "Type": "Toggle"
- },
- "WPFToggleSnapWindow": {
- "Content": "Snap Window",
- "Description": "If enabled you can align windows by dragging them. | Relogin Required",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a065_",
- "Type": "Toggle"
- },
- "WPFToggleSnapFlyout": {
- "Content": "Snap Assist Flyout",
- "Description": "If enabled then Snap preview is disabled when maximize button is hovered.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a066_",
- "Type": "Toggle"
- },
- "WPFToggleSnapSuggestion": {
- "Content": "Snap Assist Suggestion",
- "Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a067_",
- "Type": "Toggle"
- },
- "WPFToggleMouseAcceleration": {
- "Content": "Mouse Acceleration",
- "Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a068_",
- "Type": "Toggle"
- },
- "WPFToggleStickyKeys": {
- "Content": "Sticky Keys",
- "Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a070_",
+ "Order": "a200_",
"Type": "Toggle"
},
"WPFToggleTaskbarSearch": {
- "Content": "Taskbar Search",
+ "Content": "Show Search Button in Taskbar",
"Description": "If Enabled Search Button will be on the taskbar.",
"category": "Customize Preferences",
"panel": "2",
- "Order": "a068_",
+ "Order": "a201_",
+ "Type": "Toggle"
+ },
+ "WPFToggleTaskView": {
+ "Content": "Show Task View Button in Taskbar",
+ "Description": "If Enabled then Task View Button in Taskbar will be shown.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a202_",
+ "Type": "Toggle"
+ },
+ "WPFToggleTaskbarWidgets": {
+ "Content": "Show Widgets Button in Taskbar",
+ "Description": "If Enabled then Widgets Button in Taskbar will be shown.",
+ "category": "Customize Preferences",
+ "panel": "2",
+ "Order": "a203_",
"Type": "Toggle"
},
"WPFOOSUbutton": {
@@ -3075,15 +3091,7 @@
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a039_",
- "Type": "220"
- },
- "WPFToggleTaskbarWidgets": {
- "Content": "Taskbar Widgets",
- "Description": "If Enabled then Widgets Icon in Taskbar will be shown.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a069_",
- "Type": "Toggle"
+ "Type": "Button"
},
"WPFchangedns": {
"Content": "DNS",
@@ -3098,42 +3106,37 @@
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a041_",
- "Type": "160"
+ "Type": "Button"
},
"WPFUndoall": {
"Content": "Undo Selected Tweaks",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a042_",
- "Type": "160"
+ "Type": "Button"
},
"WPFAddUltPerf": {
"Content": "Add and Activate Ultimate Performance Profile",
"category": "Performance Plans",
"panel": "2",
"Order": "a080_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFRemoveUltPerf": {
"Content": "Remove Ultimate Performance Profile",
"category": "Performance Plans",
"panel": "2",
"Order": "a081_",
- "Type": "300"
+ "Type": "Button",
+ "ButtonWidth": "300"
},
"WPFWinUtilShortcut": {
"Content": "Create WinUtil Shortcut",
"category": "Shortcuts",
"panel": "2",
"Order": "a082_",
- "Type": "300"
- },
- "WPFToggleTaskView": {
- "Content": "Task View",
- "Description": "If Enabled then Task View Icon in Taskbar will be shown.",
- "category": "Customize Preferences",
- "panel": "2",
- "Order": "a069_",
- "Type": "Toggle"
+ "Type": "Button",
+ "ButtonWidth": "300"
}
}
diff --git a/functions/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1
index ea6d69f5..231af7af 100644
--- a/functions/private/Get-TabXaml.ps1
+++ b/functions/private/Get-TabXaml.ps1
@@ -6,8 +6,10 @@ function Get-TabXaml {
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
.PARAMETER tabname
The name of the tab to generate XAML for
+ Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
+ Otherwise, it'll throw an exception
.PARAMETER columncount
- The number of columns to display the applications in
+ The number of columns to display the applications in, default is 0
.OUTPUTS
The XAML for the tab
.EXAMPLE
@@ -15,10 +17,20 @@ function Get-TabXaml {
#>
- param( [Parameter(Mandatory=$true)]
- $tabname,
- $columncount = 0
+ param(
+ [Parameter(Mandatory, position=0)]
+ [string]$tabname,
+
+ [Parameter(position=1)]
+ [ValidateRange(0,10)] # 10 panels as max number is more then enough
+ [int]$columncount = 0
)
+
+ # Validate tabname
+ if ($sync.configs.$tabname -eq $null) {
+ throw "Invalid parameter passed, can't find '$tabname' in '`$sync.configs' variable, please double check any calls to 'Get-TabXaml' function."
+ }
+
$organizedData = @{}
# Iterate through JSON data and organize by panel and category
foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
@@ -39,6 +51,7 @@ function Get-TabXaml {
ComboItems = $appInfo.ComboItems
# Checked is the property to set startup checked status of checkbox (Default is false)
Checked = $appInfo.Checked
+ ButtonWidth = $appInfo.ButtonWidth
}
if (-not $organizedData.ContainsKey($appObject.panel)) {
@@ -53,7 +66,22 @@ function Get-TabXaml {
# Add Order property to keep the original order of tweaks and features
$organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
}
- $panelcount=0
+
+ # Same tab amount in last line of 'inputXML.xaml' file
+ # TODO: Get the base repeat (amount) of tabs from last line (or even lines)
+ # so it can dynamicly react to whatever is before this generated XML string.
+ # .. may be solve this even before calling this function, and pass the result as a parameter?
+ $tab_repeat = 7
+ $spaces_per_tab = 4 # The convenction used across the code base
+ $tab_as_spaces = $(" " * $spaces_per_tab)
+ $precal_indent = $($tab_as_spaces * $tab_repeat)
+ $precal_indent_p1 = $($tab_as_spaces * ($tab_repeat + 1))
+ $precal_indent_p2 = $($tab_as_spaces * ($tab_repeat + 2))
+ $precal_indent_m1 = $($tab_as_spaces * ($tab_repeat - 1))
+ $precal_indent_m2 = $($tab_as_spaces * ($tab_repeat - 2))
+
+ # Calculate the needed number of panels
+ $panelcount = 0
$paneltotal = $organizedData.Keys.Count
if ($columncount -gt 0) {
$appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
@@ -61,19 +89,27 @@ function Get-TabXaml {
$paneltotal = $columncount
}
# add ColumnDefinitions to evenly draw colums
- $blockXml="`r`n"+("`r`n"*($paneltotal))+"`r`n"
- # Iterate through organizedData by panel, category, and application
+ $blockXml = ""
+ $blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat) +
+ "") * $paneltotal
+ $blockXml += $("`r`n" + " " * ($spaces_per_tab * ($tab_repeat - 1))) +
+ "" + "`r`n"
+
+ # Iterate through 'organizedData' by panel, category, and application
$count = 0
foreach ($panel in ($organizedData.Keys | Sort-Object)) {
- $blockXml += "`r`n`r`n"
+ $blockXml += $precal_indent_m1 + "" + "`r`n"
+ $blockXml += $precal_indent + "" + "`r`n"
$panelcount++
foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
$count++
if ($columncount -gt 0) {
$panelcount2 = [Int](($count)/$maxcount-0.5)
if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`r`n`r`n`r`n"
- $blockXml += "`r`n`r`n"
+ $blockXml += $precal_indent_p2 + "" + "`r`n"
+ $blockXml += $precal_indent_p1 + "" + "`r`n"
+ $blockXml += $precal_indent_p1 + "" + "`r`n"
+ $blockXml += $precal_indent_p2 + "" + "`r`n"
$panelcount++
}
}
@@ -83,49 +119,99 @@ function Get-TabXaml {
$categorycontent = $($category -replace '^.__', '')
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
- $blockXml += "`r`n"
+ $blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat)) +
+ "" + "`r`n" + "`r`n"
$sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
foreach ($appName in $sortedApps) {
$count++
+
if ($columncount -gt 0) {
$panelcount2 = [Int](($count)/$maxcount-0.5)
+ # Verify the indentation actually works...
if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`r`n`r`n`r`n"
- $blockXml += "`r`n`r`n"
+ $blockXml += $precal_indent_m1 +
+ "" + "`r`n"
+ $blockXml += $precal_indent_m2 +
+ "" + "`r`n"
+ $blockXml += $precal_indent_m2 +
+ "" + "`r`n"
+ $blockXml += $precal_indent_m1 +
+ "" + "`r`n"
$panelcount++
}
}
+
$appInfo = $organizedData[$panel][$category][$appName]
- if ("Toggle" -eq $appInfo.Type) {
- $blockXml += "`r`n`r`n"
- } elseif ("Combobox" -eq $appInfo.Type) {
- $blockXml += "`r`n"
- # If it is a digit, type is button and button length is digits
- } elseif ($appInfo.Type -match "^[\d\.]+$") {
- $blockXml += "`r`n"
- # else it is a checkbox
- } else {
- $checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
- if ($null -eq $appInfo.Link)
- {
- $blockXml += "`r`n"
+
+ "Combobox" {
+ $blockXml += $precal_indent_m1 +
+ "" + "`r`n"
+ $blockXml += $precal_indent + "" + "`r`n"
+ $blockXml += $precal_indent +
+ "" + "`r`n"
+
+ $addfirst="IsSelected=""True"""
+ foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
+ $blockXml += $precal_indent_p1 +
+ "" + "`r`n"
+ $addfirst=""
+ }
+
+ $blockXml += $precal_indent_p1 + "" + "`r`n"
+ $blockXml += $precal_indent + "" + "`r`n"
}
- else
- {
- $blockXml += "`r`n`r`n`r`n"
+
+ "Button" {
+ if ($appInfo.ButtonWidth -ne $null) {
+ $ButtonWidthStr = "Width=""$($appInfo.ButtonWidth)"""
+ }
+ $blockXml += $precal_indent +
+ "" + "`r`n"
+ }
+
+ # else it is a checkbox
+ default {
+ $checkedStatus = If ($appInfo.Checked -eq $null) {""} Else {" IsChecked=""$($appInfo.Checked)"""}
+ if ($appInfo.Link -eq $null) {
+ $blockXml += $precal_indent +
+ "" + "`r`n"
+ } else {
+ $blockXml += $precal_indent +
+ "" + "`r`n"
+ $blockXml += $precal_indent_p1 +
+ "" + "`r`n"
+ $blockXml += $precal_indent_p1 +
+ "" + "`r`n"
+ $blockXml += $precal_indent +
+ "" + "`r`n"
+ }
}
}
}
}
- $blockXml +="`r`n`r`n`r`n"
+
+ $blockXml += $precal_indent_p1 + "" + "`r`n"
+ $blockXml += $precal_indent + "" + "`r`n"
}
return ($blockXml)
}
diff --git a/functions/private/Show-CustomDialog.ps1 b/functions/private/Show-CustomDialog.ps1
index 594d9019..dc6eb0de 100644
--- a/functions/private/Show-CustomDialog.ps1
+++ b/functions/private/Show-CustomDialog.ps1
@@ -15,6 +15,15 @@ function Show-CustomDialog {
.PARAMETER Height
The height of the custom dialog window.
+ .PARAMETER FontSize
+ The Font Size for text shown inside the custom dialog window.
+
+ .PARAMETER HeaderFontSize
+ The Font Size for the Header of the custom dialog window.
+
+ .PARAMETER IconSize
+ The Size to use for Icon inside the custom dialog window.
+
.EXAMPLE
Show-CustomDialog -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200
@@ -22,7 +31,10 @@ function Show-CustomDialog {
param(
[string]$Message,
[int]$Width = 300,
- [int]$Height = 200
+ [int]$Height = 200,
+ [int]$FontSize = 10,
+ [int]$HeaderFontSize = 14,
+ [int]$IconSize = 25
)
Add-Type -AssemblyName PresentationFramework
@@ -48,6 +60,7 @@ function Show-CustomDialog {
$dialog.Foreground = $foregroundColor
$dialog.Background = $backgroundColor
$dialog.FontFamily = $font
+ $dialog.FontSize = $FontSize
# Create a Border for the green edge with rounded corners
$border = New-Object Windows.Controls.Border
@@ -111,8 +124,8 @@ function Show-CustomDialog {
[Windows.Controls.Grid]::SetRow($stackPanel, 0) # Set the row to the second row (0-based index)
$viewbox = New-Object Windows.Controls.Viewbox
- $viewbox.Width = 25
- $viewbox.Height = 25
+ $viewbox.Width = $IconSize
+ $viewbox.Height = $IconSize
# Combine the paths into a single string
# $cttLogoPath = @"
@@ -174,7 +187,7 @@ $cttLogoPath = @"
# Add "Winutil" text
$winutilTextBlock = New-Object Windows.Controls.TextBlock
$winutilTextBlock.Text = "Winutil"
- $winutilTextBlock.FontSize = 18 # Adjust font size as needed
+ $winutilTextBlock.FontSize = $HeaderFontSize
$winutilTextBlock.Foreground = $foregroundColor
$winutilTextBlock.Margin = New-Object Windows.Thickness(10, 5, 10, 5) # Add margins around the text block
$stackPanel.Children.Add($winutilTextBlock)
@@ -242,6 +255,7 @@ $cttLogoPath = @"
# Add OK button
$okButton = New-Object Windows.Controls.Button
$okButton.Content = "OK"
+ $okButton.FontSize = $FontSize
$okButton.Width = 80
$okButton.Height = 30
$okButton.HorizontalAlignment = [Windows.HorizontalAlignment]::Center
diff --git a/scripts/main.ps1 b/scripts/main.ps1
index 71087cdb..4895437e 100644
--- a/scripts/main.ps1
+++ b/scripts/main.ps1
@@ -70,15 +70,16 @@ $inputXML = Set-WinUtilUITheme -inputXML $inputXML -themeName $ctttheme
# Read the XAML file
$reader = (New-Object System.Xml.XmlNodeReader $xaml)
-try { $sync["Form"] = [Windows.Markup.XamlReader]::Load( $reader ) }
-catch [System.Management.Automation.MethodInvocationException] {
+try {
+ $sync["Form"] = [Windows.Markup.XamlReader]::Load( $reader )
+} catch [System.Management.Automation.MethodInvocationException] {
Write-Warning "We ran into a problem with the XAML code. Check the syntax for this control..."
Write-Host $error[0].Exception.Message -ForegroundColor Red
+
If ($error[0].Exception.Message -like "*button*") {
write-warning "Ensure your <button in the `$inputXML does NOT have a Click=ButtonClick property. PS can't handle this`n`n`n`n"
}
-}
-catch {
+} catch {
Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
}
@@ -163,9 +164,9 @@ $sync["Form"].Add_Closing({
})
# Attach the event handler to the Click event
-$sync.CheckboxFilterClear.Add_Click({
- $sync.CheckboxFilter.Text = ""
- $sync.CheckboxFilterClear.Visibility = "Collapsed"
+$sync.SearchBarClearButton.Add_Click({
+ $sync.SearchBar.Text = ""
+ $sync.SearchBarClearButton.Visibility = "Collapsed"
})
# add some shortcuts for people that don't like clicking
@@ -176,9 +177,9 @@ $commonKeyEvents = {
if ($_.Key -eq "Escape")
{
- $sync.CheckboxFilter.SelectAll()
- $sync.CheckboxFilter.Text = ""
- $sync.CheckboxFilterClear.Visibility = "Collapsed"
+ $sync.SearchBar.SelectAll()
+ $sync.SearchBar.Text = ""
+ $sync.SearchBarClearButton.Visibility = "Collapsed"
return
}
@@ -209,11 +210,11 @@ $commonKeyEvents = {
}
# shortcut for the filter box
if ($_.Key -eq "F" -and $_.KeyboardDevice.Modifiers -eq "Ctrl") {
- if ($sync.CheckboxFilter.Text -eq "Ctrl-F to filter") {
- $sync.CheckboxFilter.SelectAll()
- $sync.CheckboxFilter.Text = ""
+ if ($sync.SearchBar.Text -eq "Ctrl-F to filter") {
+ $sync.SearchBar.SelectAll()
+ $sync.SearchBar.Text = ""
}
- $sync.CheckboxFilter.Focus()
+ $sync.SearchBar.Focus()
}
}
@@ -400,13 +401,13 @@ $labels = @{}
$allCategories = $checkBoxes.Name | ForEach-Object {$sync.configs.applications.$_} | Select-Object -Unique -ExpandProperty category
-$sync["CheckboxFilter"].Add_TextChanged({
+$sync["SearchBar"].Add_TextChanged({
- if ($sync.CheckboxFilter.Text -ne "") {
- $sync.CheckboxFilterClear.Visibility = "Visible"
+ if ($sync.SearchBar.Text -ne "") {
+ $sync.SearchBarClearButton.Visibility = "Visible"
}
else {
- $sync.CheckboxFilterClear.Visibility = "Collapsed"
+ $sync.SearchBarClearButton.Visibility = "Collapsed"
}
$activeApplications = @()
@@ -417,7 +418,7 @@ $sync["CheckboxFilter"].Add_TextChanged({
continue
}
- $textToSearch = $sync.CheckboxFilter.Text.ToLower()
+ $textToSearch = $sync.SearchBar.Text.ToLower()
$checkBoxName = $CheckBox.Key
$textBlockName = $checkBoxName + "Link"
@@ -497,7 +498,12 @@ MicroWin : @KonTy
GitHub : ChrisTitusTech/winutil
Version : $($sync.version)
"@
- Show-CustomDialog -Message $authorInfo -Width 400
+ $FontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSize
+ $HeaderFontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSizeHeader
+ $IconSize = $sync.configs.themes.$ctttheme.CustomDialogIconSize
+ $Width = $sync.configs.themes.$ctttheme.CustomDialogWidth
+ $Height = $sync.configs.themes.$ctttheme.CustomDialogHeight
+ Show-CustomDialog -Message $authorInfo -Width $Width -Height $Height -FontSize $FontSize -HeaderFontSize $HeaderFontSize -IconSize $IconSize
})
$sync["Form"].ShowDialog() | out-null
Stop-Transcript
diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml
index 0132d2bf..4648924f 100644
--- a/xaml/inputXML.xaml
+++ b/xaml/inputXML.xaml
@@ -49,6 +49,8 @@
@@ -197,7 +200,9 @@
BorderBrush="{ButtonBackgroundColor}"
BorderThickness="{ButtonBorderThickness}"
CornerRadius="{ButtonCornerRadius}">
-
@@ -237,7 +242,9 @@
-
+
+
+
@@ -266,12 +273,12 @@
-
-
-
+
@@ -586,51 +581,51 @@
-
+
-
-
-
+
Install
-
-
+
Tweaks
-
-
+
Config
-
-
+
Updates
-
-
+
MicroWin
@@ -642,13 +637,23 @@
+
@@ -656,11 +661,19 @@
Grid.Column="0"
VerticalAlignment="Center" HorizontalAlignment="Left"
FontFamily="Segoe MDL2 Assets"
- FontSize="14" Margin="16,0,0,0">
+ FontSize="{IconFontSize}"
+ Margin="16,0,0,0">
+
@@ -733,17 +746,17 @@
-
+
{{InstallPanel_tweaks}}
-
-
-
-
-
-
+
+
+
+
+
+
@@ -774,19 +787,19 @@
-
+
This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings.Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.
-
+
This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release.Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don't break other systems. You don't want to go without these for ANY extended periods of time.
-
+
This completely disables ALL Windows Updates and is NOT RECOMMENDED. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. Note: Your system will be easier to hack and infect without security updates.
@@ -794,7 +807,7 @@
-
+
@@ -809,12 +822,12 @@
HorizontalAlignment="Stretch">
-
+
Choose a Windows ISO file that you've downloaded
Check the status in the console
-
@@ -831,6 +844,8 @@
Foreground="{LabelboxForegroundColor}">
@@ -896,7 +911,7 @@
+ FontSize="{IconFontSize}" Margin="16,0,0,0">
/\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __