Made NumericUpDown looks better in the command bar.

Made TabBar in TabHost looks slightly better.
This commit is contained in:
Creeper Lv
2025-12-24 03:31:39 +11:00
parent 377d7fce23
commit 10453b0ae0
5 changed files with 160 additions and 11 deletions

View File

@@ -8,6 +8,140 @@
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<x:Double x:Key="ScrollBarSize">7</x:Double>
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Template">
<ControlTemplate>
<DataValidationErrors>
<ButtonSpinner Name="PART_Spinner"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}"
IsTabStop="False"
Padding="0"
MinWidth="0"
MinHeight="0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}">
<TextBox Name="PART_TextBox"
Background="Transparent"
BorderBrush="Transparent"
Margin="-1"
Padding="{TemplateBinding Padding}"
MinWidth="0"
Foreground="{TemplateBinding Foreground}"
Watermark="{TemplateBinding Watermark}"
IsReadOnly="{TemplateBinding IsReadOnly}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Text="{TemplateBinding Text}"
TextAlignment="{TemplateBinding TextAlignment}"
AcceptsReturn="False"
TextWrapping="NoWrap"
MinHeight="0"
InnerLeftContent="{Binding InnerLeftContent, RelativeSource={RelativeSource TemplatedParent}}"
InnerRightContent="{Binding InnerRightContent, RelativeSource={RelativeSource TemplatedParent}}"/>
</ButtonSpinner>
</DataValidationErrors>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type ButtonSpinner}" TargetType="ButtonSpinner">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Padding" Value="10, 0" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Focusable" Value="True"/>
<Setter Property="Template">
<ControlTemplate>
<DataValidationErrors>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
MinHeight="{TemplateBinding MinHeight}">
<DockPanel>
<StackPanel Name="PART_SpinnerPanel"
TabIndex="2"
DockPanel.Dock="Right"
Orientation="Horizontal"
IsVisible="{TemplateBinding ShowButtonSpinner}">
<RepeatButton Name="PART_IncreaseButton"
IsTabStop="{TemplateBinding IsTabStop}"
Theme="{StaticResource FluentButtonSpinnerRepeatButton}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerLeftThickness}}"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
MinHeight="0"
Foreground="{TemplateBinding Foreground}"
MinWidth="34">
<PathIcon Width="16"
Height="8"
Data="{StaticResource ButtonSpinnerIncreaseButtonIcon}" />
</RepeatButton>
<RepeatButton Name="PART_DecreaseButton"
IsTabStop="{TemplateBinding IsTabStop}"
Theme="{StaticResource FluentButtonSpinnerRepeatButton}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerLeftThickness}}"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
MinHeight="0"
Foreground="{TemplateBinding Foreground}"
MinWidth="34">
<PathIcon Width="16"
Height="8"
Data="{StaticResource ButtonSpinnerDecreaseButtonIcon}" />
</RepeatButton>
</StackPanel>
<ContentPresenter Name="PART_ContentPresenter"
Grid.Column="1"
TabIndex="1"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}" />
</DockPanel>
</Border>
</DataValidationErrors>
</ControlTemplate>
</Setter>
<Style Selector="^:left">
<Style Selector="^ /template/ StackPanel#PART_SpinnerPanel">
<Setter Property="DockPanel.Dock" Value="Left"/>
</Style>
<Style Selector="^ /template/ RepeatButton">
<Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerRightThickness}}"/>
</Style>
</Style>
<Style Selector="^:error">
<Setter Property="BorderBrush" Value="{DynamicResource SystemErrorTextColor}" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton"> <ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton">
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
@@ -78,7 +212,7 @@
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#CheckOuterBorder"> <Style Selector="^:pointerover /template/ Border#CheckOuterBorder">
<!-- <Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterBorderCheckedStrokePointerOver}" /> <!-- <Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterBorderCheckedStrokePointerOver}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterBorderCheckedFillPointerOver}" />--> <Setter Property="Fill" Value="{DynamicResource RadioButtonOuterBorderCheckedFillPointerOver}" />-->
</Style> </Style>
@@ -98,7 +232,7 @@
</Style> </Style>
<Style Selector="^:pressed /template/ Border#OuterBorder"> <Style Selector="^:pressed /template/ Border#OuterBorder">
<!-- <Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterBorderStrokePressed}" /> <!-- <Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterBorderStrokePressed}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterBorderFillPressed}" />--> <Setter Property="Fill" Value="{DynamicResource RadioButtonOuterBorderFillPressed}" />-->
</Style> </Style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -11,18 +11,18 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Margin="12" Background="#2888" CornerRadius="16" Padding="8,0">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
<Border Margin="12" Background="#2888" CornerRadius="12" Padding="4"> <StackPanel Name="TabContainer" Orientation="Horizontal" Margin="4">
<StackPanel Name="TabContainer" Orientation="Horizontal" >
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="Button"> <Style Selector="Button">
<Setter Property="CornerRadius" Value="12"/> <Setter Property="CornerRadius" Value="12"/>
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<TextBlock/> <TextBlock Margin="0,4"/>
</StackPanel> </StackPanel>
</Border>
</ScrollViewer> </ScrollViewer>
</Border>
<Border Grid.Row="1" Background="#2888" CornerRadius="6"> <Border Grid.Row="1" Background="#2888" CornerRadius="6">
<Grid Name="PageContainer"> <Grid Name="PageContainer">

View File

@@ -6,12 +6,25 @@
x:Class="Progrart.Pages.AboutPage"> x:Class="Progrart.Pages.AboutPage">
<ScrollViewer> <ScrollViewer>
<StackPanel> <StackPanel>
<Image Source="/Assets/Icon-FG.png" Width="100" Height="100"/> <StackPanel.Styles>
<TextBlock FontSize="36" TextAlignment="Center" Margin="0,50">Progrart</TextBlock> <Style Selector="Image">
<Setter Property="Transitions">
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.1" />
</Transitions>
</Setter>
</Style>
<Style Selector="Image:pointerover">
<Setter Property="RenderTransform" Value="scale(1.25)" />
</Style>
</StackPanel.Styles>
<Image Source="/Assets/Icon-Rounded-FG.png" Margin="0,50" Width="150" Height="150"/>
<TextBlock FontSize="36" TextAlignment="Center" Margin="0,0,0,30">Progrart</TextBlock>
<TextBlock FontSize="18" TextAlignment="Center">Version: 0.0.0.0-preview</TextBlock> <TextBlock FontSize="18" TextAlignment="Center">Version: 0.0.0.0-preview</TextBlock>
<TextBlock FontSize="24" TextAlignment="Center" Margin="0,25">Third-Party Libs</TextBlock> <TextBlock FontSize="24" TextAlignment="Center" Margin="0,25">Third-Party Libs</TextBlock>
<TextBlock FontSize="17" TextAlignment="Center">Avalonia - github.com/avaloniaui</TextBlock> <TextBlock FontSize="17" TextAlignment="Center">Avalonia - github.com/avaloniaui</TextBlock>
<TextBlock FontSize="17" TextAlignment="Center">PanAndZoom - GitHub - wieslawsoltes/PanAndZoom</TextBlock> <TextBlock FontSize="17" TextAlignment="Center">PanAndZoom - GitHub - wieslawsoltes/PanAndZoom</TextBlock>
<TextBlock FontSize="17" TextAlignment="Center">DialogHost - GitHub - AvaloniaUtils/DialogHost.Avalonia</TextBlock>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>

View File

@@ -136,7 +136,9 @@
</Button> </Button>
<Border Margin="4,6" Width="1" Background="#8888"></Border> <Border Margin="4,6" Width="1" Background="#8888"></Border>
<NumericUpDown Name="SizeBox" Minimum="1" Maximum="16384" FormatString="00000" <NumericUpDown Name="SizeBox" Minimum="1" Maximum="16384" FormatString="00000"
Value="1024" VerticalAlignment="Center" Padding="4,2" VerticalContentAlignment="Center" MinHeight="0"/> Value="1024" VerticalAlignment="Center" Padding="4,2"
Margin="5,0"
VerticalContentAlignment="Center" MinHeight="0"/>
<CheckBox Name="IsDebugBox" Margin="7,0" Content="Is Debug"/> <CheckBox Name="IsDebugBox" Margin="7,0" Content="Is Debug"/>
<Button Name="RunButton" ToolTip.Tip="Preview"> <Button Name="RunButton" ToolTip.Tip="Preview">
<PathIcon Foreground="#0A0" Data="F1 M 17.24 10.48 C 17.453333 10.613333 17.633331 10.799999 17.779999 11.039999 C 17.926666 11.28 18 11.533333 18 11.799999 C 18 12.066667 17.926666 12.32 17.779999 12.559999 C 17.633331 12.799999 17.453333 12.986667 17.24 13.12 L 7.24 18.599998 C 7 18.733334 6.746666 18.799999 6.48 18.799999 C 6.213333 18.799999 5.966666 18.733334 5.74 18.599998 C 5.513333 18.466667 5.333333 18.279999 5.2 18.039999 C 5.066667 17.799999 5 17.546665 5 17.279999 L 5 6.32 C 5 6.053333 5.066667 5.799999 5.2 5.559999 C 5.333333 5.32 5.513333 5.133333 5.74 5 C 5.966666 4.866667 6.213333 4.799999 6.48 4.799999 C 6.746666 4.799999 7 4.866667 7.24 5 Z M 16.719999 12.24 C 16.906666 12.133333 17 11.986667 17 11.799999 C 17 11.613333 16.906666 11.466667 16.719999 11.36 L 6.76 5.879999 C 6.573333 5.773333 6.4 5.766666 6.24 5.86 C 6.08 5.953334 6 6.106668 6 6.32 L 6 17.279999 C 6 17.493332 6.08 17.646666 6.24 17.74 C 6.4 17.833332 6.573333 17.826666 6.76 17.719999 Z " VerticalAlignment="Center" HorizontalAlignment="Center" /> <PathIcon Foreground="#0A0" Data="F1 M 17.24 10.48 C 17.453333 10.613333 17.633331 10.799999 17.779999 11.039999 C 17.926666 11.28 18 11.533333 18 11.799999 C 18 12.066667 17.926666 12.32 17.779999 12.559999 C 17.633331 12.799999 17.453333 12.986667 17.24 13.12 L 7.24 18.599998 C 7 18.733334 6.746666 18.799999 6.48 18.799999 C 6.213333 18.799999 5.966666 18.733334 5.74 18.599998 C 5.513333 18.466667 5.333333 18.279999 5.2 18.039999 C 5.066667 17.799999 5 17.546665 5 17.279999 L 5 6.32 C 5 6.053333 5.066667 5.799999 5.2 5.559999 C 5.333333 5.32 5.513333 5.133333 5.74 5 C 5.966666 4.866667 6.213333 4.799999 6.48 4.799999 C 6.746666 4.799999 7 4.866667 7.24 5 Z M 16.719999 12.24 C 16.906666 12.133333 17 11.986667 17 11.799999 C 17 11.613333 16.906666 11.466667 16.719999 11.36 L 6.76 5.879999 C 6.573333 5.773333 6.4 5.766666 6.24 5.86 C 6.08 5.953334 6 6.106668 6 6.32 L 6 17.279999 C 6 17.493332 6.08 17.646666 6.24 17.74 C 6.4 17.833332 6.573333 17.826666 6.76 17.719999 Z " VerticalAlignment="Center" HorizontalAlignment="Center" />