-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI/UX] Update the look & feel of the GUI (#2884)
* Add @CodingWonders to the About page for his contribution and determination to make WinUtil (and MicroWin) the best software it can be! * Remove the 'LogoSize' Parameter for About page - Make every sponsor in the sponsors list a link to ChrisTitusTech's Sponsors web link * Change Theme Option name from 'ConfigTabButtonFontSize' to 'ConfigUpdateButtonFontSize' - Lower its value from 16 to 14 * Change Theme Option name from 'FontSizeHeading' to 'HeadingFontSize' for consistency * Update 'LinkForegroundColor' for Light Theme to be lighter which'll make link hover color more noticeable * Update 'Show-CustomDialog' Private Function - Made a lot of theming/styling choices for Custom Dialogs exposed as parameters. - Update the documentation for these new parameters in 'Show-CustomDialog' Function. - Add a Link Hover Effect using 'Add_EVENT' methods (This can be tweaks/tuned-down if needed). - Made use of 'Title' Parameter for 'Show-CustomDialog' Function inside 'scripts/main.ps1' script, to change Dialog Window Title. - Now you can change the Logo Size of WinUtil through the 'LogoSize' Theming Option (the option was there, but not used in implementation). * Preprocessing result * Fix Settings Popup not closing after losing focus - Add trivial null checks for better debugging of UI code * Remove unnecessary whitespace indentation in 'main.ps1' script * Add a new 'Invoke-WPFPopup' Function to Better Handle Showing/Hiding/Toggling of Popups * Improve 'Invoke-WPFPopup' by @MyDrift-user Thanks for the improvements :) --------- Co-authored-by: MyDrift <[email protected]> Co-authored-by: Chris Titus <[email protected]>
- Loading branch information
1 parent
e2ce998
commit 83450ae
Showing
5 changed files
with
182 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
function Invoke-WPFPopup { | ||
param ( | ||
[ValidateSet("Show", "Hide", "Toggle")] | ||
[string]$Action = "", | ||
|
||
[string[]]$Popups = @(), | ||
|
||
[ValidateScript({ | ||
$invalid = $_.GetEnumerator() | Where-Object { $_.Value -notin @("Show", "Hide", "Toggle") } | ||
if ($invalid) { | ||
throw "Found invalid Popup-Action pair(s): " + ($invalid | ForEach-Object { "$($_.Key) = $($_.Value)" } -join "; ") | ||
} | ||
$true | ||
})] | ||
[hashtable]$PopupActionTable = @{} | ||
) | ||
|
||
if (-not $PopupActionTable.Count -and (-not $Action -or -not $Popups.Count)) { | ||
throw "Provide either 'PopupActionTable' or both 'Action' and 'Popups'." | ||
} | ||
|
||
if ($PopupActionTable.Count -and ($Action -or $Popups.Count)) { | ||
throw "Use 'PopupActionTable' on its own, or 'Action' with 'Popups'." | ||
} | ||
|
||
# Collect popups and actions | ||
$PopupsToProcess = if ($PopupActionTable.Count) { | ||
$PopupActionTable.GetEnumerator() | ForEach-Object { [PSCustomObject]@{ Name = "$($_.Key)Popup"; Action = $_.Value } } | ||
} else { | ||
$Popups | ForEach-Object { [PSCustomObject]@{ Name = "$_`Popup"; Action = $Action } } | ||
} | ||
|
||
$PopupsNotFound = @() | ||
|
||
# Apply actions | ||
foreach ($popupEntry in $PopupsToProcess) { | ||
$popupName = $popupEntry.Name | ||
|
||
if (-not $sync.$popupName) { | ||
$PopupsNotFound += $popupName | ||
continue | ||
} | ||
|
||
$sync.$popupName.IsOpen = switch ($popupEntry.Action) { | ||
"Show" { $true } | ||
"Hide" { $false } | ||
"Toggle" { -not $sync.$popupName.IsOpen } | ||
} | ||
} | ||
|
||
if ($PopupsNotFound.Count -gt 0) { | ||
throw "Could not find the following popups: $($PopupsNotFound -join ', ')" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.