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",
|
"CustomDialogHeight": "200",
|
||||||
"FontSize": "12",
|
"FontSize": "12",
|
||||||
"FontFamily": "Arial",
|
"FontFamily": "Arial",
|
||||||
"HeadingFontSize": "16",
|
"HeaderFontSize": "16",
|
||||||
"HeaderFontFamily": "Consolas, Monaco",
|
"HeaderFontFamily": "Consolas, Monaco",
|
||||||
"CheckBoxBulletDecoratorSize": "14",
|
"CheckBoxBulletDecoratorSize": "14",
|
||||||
"CheckBoxMargin": "15,0,0,2",
|
"CheckBoxMargin": "15,0,0,2",
|
||||||
|
@ -42,7 +42,7 @@ function Initialize-InstallCategoryAppList {
|
|||||||
$loadingLabel.Content = "Loading, please wait..."
|
$loadingLabel.Content = "Loading, please wait..."
|
||||||
$loadingLabel.HorizontalAlignment = "Center"
|
$loadingLabel.HorizontalAlignment = "Center"
|
||||||
$loadingLabel.VerticalAlignment = "Center"
|
$loadingLabel.VerticalAlignment = "Center"
|
||||||
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
|
||||||
$loadingLabel.FontWeight = [Windows.FontWeights]::Bold
|
$loadingLabel.FontWeight = [Windows.FontWeights]::Bold
|
||||||
$loadingLabel.Foreground = [Windows.Media.Brushes]::Gray
|
$loadingLabel.Foreground = [Windows.Media.Brushes]::Gray
|
||||||
$sync.LoadingLabel = $loadingLabel
|
$sync.LoadingLabel = $loadingLabel
|
||||||
|
@ -29,7 +29,8 @@ function Initialize-InstallHeader {
|
|||||||
$buttonConfigs = @(
|
$buttonConfigs = @(
|
||||||
@{Name="WPFInstall"; Content="Install/Upgrade Selected"},
|
@{Name="WPFInstall"; Content="Install/Upgrade Selected"},
|
||||||
@{Name="WPFInstallUpgrade"; Content="Upgrade All"},
|
@{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) {
|
foreach ($config in $buttonConfigs) {
|
||||||
@ -38,18 +39,9 @@ function Initialize-InstallHeader {
|
|||||||
$sync[$config.Name] = $button
|
$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 = New-Object Windows.Controls.Primitives.Popup
|
||||||
$selectedAppsPopup.IsOpen = $false
|
$selectedAppsPopup.IsOpen = $false
|
||||||
$selectedAppsPopup.PlacementTarget = $selectedAppsButton
|
$selectedAppsPopup.PlacementTarget = $sync.WPFselectedAppsButton
|
||||||
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
|
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
|
||||||
$selectedAppsPopup.AllowsTransparency = $true
|
$selectedAppsPopup.AllowsTransparency = $true
|
||||||
|
|
||||||
@ -66,24 +58,21 @@ function Initialize-InstallHeader {
|
|||||||
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel
|
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel
|
||||||
|
|
||||||
# Toggle selectedAppsPopup open/close with button
|
# Toggle selectedAppsPopup open/close with button
|
||||||
$selectedAppsButton.Add_Click({
|
$sync.WPFselectedAppsButton.Add_Click({
|
||||||
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
|
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
|
||||||
})
|
})
|
||||||
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
|
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
|
||||||
$selectedAppsButton.Add_MouseLeave({
|
$sync.WPFselectedAppsButton.Add_MouseLeave({
|
||||||
if (-not $sync.selectedAppsPopup.IsMouseOver) {
|
if (-not $sync.selectedAppsPopup.IsMouseOver) {
|
||||||
$sync.selectedAppsPopup.IsOpen = $false
|
$sync.selectedAppsPopup.IsOpen = $false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$selectedAppsPopup.Add_MouseLeave({
|
$selectedAppsPopup.Add_MouseLeave({
|
||||||
if (-not $selectedAppsButton.IsMouseOver) {
|
if (-not $sync.WPFselectedAppsButton.IsMouseOver) {
|
||||||
$sync.selectedAppsPopup.IsOpen = $false
|
$sync.selectedAppsPopup.IsOpen = $false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$null = $wrapPanelTop.Children.Add($selectedAppsButton)
|
|
||||||
$sync.$($selectedAppsButton.Name) = $selectedAppsButton
|
|
||||||
|
|
||||||
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
|
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
|
||||||
$null = $TargetElement.Children.Add($wrapPanelTop)
|
$null = $TargetElement.Children.Add($wrapPanelTop)
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ function Invoke-WPFUIElements {
|
|||||||
|
|
||||||
$label = New-Object Windows.Controls.Label
|
$label = New-Object Windows.Controls.Label
|
||||||
$label.Content = $category -replace ".*__", ""
|
$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")
|
$label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily")
|
||||||
$itemsControl.Items.Add($label) | Out-Null
|
$itemsControl.Items.Add($label) | Out-Null
|
||||||
$sync[$category] = $label
|
$sync[$category] = $label
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
|
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
|
||||||
<Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}"/>
|
<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="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user