mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-04-01 17:12:09 +00:00
Correct the Header Font Size (#3257)
* Correct the Header Font Size naming and simplify the creation of the Selected Apps Button * Adjust HeaderFontSize from 18 to 16 for improved readability
This commit is contained in:
parent
b3dd1a1a50
commit
8f9e7d1b7c
@ -7,7 +7,7 @@
|
||||
"CustomDialogHeight": "200",
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"HeadingFontSize": "16",
|
||||
"HeaderFontSize": "16",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
"CheckBoxBulletDecoratorSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
|
@ -42,7 +42,7 @@ function Initialize-InstallCategoryAppList {
|
||||
$loadingLabel.Content = "Loading, please wait..."
|
||||
$loadingLabel.HorizontalAlignment = "Center"
|
||||
$loadingLabel.VerticalAlignment = "Center"
|
||||
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
||||
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
|
||||
$loadingLabel.FontWeight = [Windows.FontWeights]::Bold
|
||||
$loadingLabel.Foreground = [Windows.Media.Brushes]::Gray
|
||||
$sync.LoadingLabel = $loadingLabel
|
||||
|
@ -29,7 +29,8 @@ function Initialize-InstallHeader {
|
||||
$buttonConfigs = @(
|
||||
@{Name="WPFInstall"; Content="Install/Upgrade Selected"},
|
||||
@{Name="WPFInstallUpgrade"; Content="Upgrade All"},
|
||||
@{Name="WPFUninstall"; Content="Uninstall Selected"}
|
||||
@{Name="WPFUninstall"; Content="Uninstall Selected"},
|
||||
@{Name="WPFselectedAppsButton"; Content="Selected Apps: 0"}
|
||||
)
|
||||
|
||||
foreach ($config in $buttonConfigs) {
|
||||
@ -38,18 +39,9 @@ function Initialize-InstallHeader {
|
||||
$sync[$config.Name] = $button
|
||||
}
|
||||
|
||||
$selectedAppsButton = New-Object Windows.Controls.Button
|
||||
$selectedAppsButton.Name = "WPFselectedAppsButton"
|
||||
$selectedAppsButton.Content = "Selected Apps: 0"
|
||||
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
||||
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::MarginProperty, "TabContentMargin")
|
||||
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
|
||||
$selectedAppsButton.HorizontalAlignment = "Center"
|
||||
$selectedAppsButton.VerticalAlignment = "Center"
|
||||
|
||||
$selectedAppsPopup = New-Object Windows.Controls.Primitives.Popup
|
||||
$selectedAppsPopup.IsOpen = $false
|
||||
$selectedAppsPopup.PlacementTarget = $selectedAppsButton
|
||||
$selectedAppsPopup.PlacementTarget = $sync.WPFselectedAppsButton
|
||||
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
|
||||
$selectedAppsPopup.AllowsTransparency = $true
|
||||
|
||||
@ -66,24 +58,21 @@ function Initialize-InstallHeader {
|
||||
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel
|
||||
|
||||
# Toggle selectedAppsPopup open/close with button
|
||||
$selectedAppsButton.Add_Click({
|
||||
$sync.WPFselectedAppsButton.Add_Click({
|
||||
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
|
||||
})
|
||||
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
|
||||
$selectedAppsButton.Add_MouseLeave({
|
||||
$sync.WPFselectedAppsButton.Add_MouseLeave({
|
||||
if (-not $sync.selectedAppsPopup.IsMouseOver) {
|
||||
$sync.selectedAppsPopup.IsOpen = $false
|
||||
}
|
||||
})
|
||||
$selectedAppsPopup.Add_MouseLeave({
|
||||
if (-not $selectedAppsButton.IsMouseOver) {
|
||||
if (-not $sync.WPFselectedAppsButton.IsMouseOver) {
|
||||
$sync.selectedAppsPopup.IsOpen = $false
|
||||
}
|
||||
})
|
||||
|
||||
$null = $wrapPanelTop.Children.Add($selectedAppsButton)
|
||||
$sync.$($selectedAppsButton.Name) = $selectedAppsButton
|
||||
|
||||
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
|
||||
$null = $TargetElement.Children.Add($wrapPanelTop)
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ function Invoke-WPFUIElements {
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$label.Content = $category -replace ".*__", ""
|
||||
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
||||
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
|
||||
$label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily")
|
||||
$itemsControl.Items.Add($label) | Out-Null
|
||||
$sync[$category] = $label
|
||||
|
@ -202,7 +202,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
|
||||
<Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSizeHeading}"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource HeaderFontSize}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
|
Loading…
Reference in New Issue
Block a user