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:
Martin Wiethan 2025-03-19 20:05:55 +01:00 committed by GitHub
parent b3dd1a1a50
commit 8f9e7d1b7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 21 deletions

View File

@ -7,7 +7,7 @@
"CustomDialogHeight": "200",
"FontSize": "12",
"FontFamily": "Arial",
"HeadingFontSize": "16",
"HeaderFontSize": "16",
"HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorSize": "14",
"CheckBoxMargin": "15,0,0,2",

View File

@ -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

View File

@ -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)
}

View File

@ -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

View File

@ -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"/>