Merge pull request #60 from irihitech/fix

Fix: fix various issues.
This commit is contained in:
Dong Bin 2023-01-30 23:14:45 +08:00 committed by GitHub
commit 1030fa47e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 49 additions and 12 deletions

View File

@ -10,13 +10,11 @@
<Setter Property="BorderBrush" Value="{DynamicResource AutoCompleteBoxDefaultBorderBrush}" />
<Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="600" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="4" />
<Setter Property="Template">
<ControlTemplate TargetType="AutoCompleteBox">
<Panel>
<TextBox
Name="PART_TextBox"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"

View File

@ -89,6 +89,15 @@
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />

View File

@ -54,7 +54,7 @@
Viewport height is set from # of rows displayed (2-8) in Month mode, = ~290 for 6 weeks (+ day names)
-->
<Grid
MinWidth="200"
MinWidth="{DynamicResource CalendarMinWidth}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
RowDefinitions="Auto,*">

View File

@ -172,18 +172,19 @@
</Border>
<Popup
Name="PART_Popup"
HorizontalOffset="{DynamicResource MenuFlyoutSubItemPopupHorizontalOffset}"
HorizontalOffset="-8"
IsLightDismissEnabled="False"
IsOpen="{TemplateBinding IsSubMenuOpen,
Mode=TwoWay}"
PlacementMode="Right"
VerticalOffset="-4"
WindowManagerAddShadowHint="False">
<Border
MinWidth="{DynamicResource MenuFlyoutMinWidth}"
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
Margin="4"
Margin="8"
Padding="{DynamicResource MenuFlyoutPadding}"
HorizontalAlignment="Stretch"
Background="{DynamicResource MenuFlyoutBackground}"
@ -274,17 +275,19 @@
<Popup
Name="PART_Popup"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalOffset="-8"
IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsSubMenuOpen,
Mode=TwoWay}"
OverlayInputPassThroughElement="{Binding $parent[Menu]}"
VerticalOffset="-4"
WindowManagerAddShadowHint="False">
<Border
MinWidth="{DynamicResource MenuFlyoutMinWidth}"
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
Margin="4"
Margin="8"
Padding="{DynamicResource MenuFlyoutPadding}"
HorizontalAlignment="Stretch"
Background="{DynamicResource MenuFlyoutBackground}"

View File

@ -20,7 +20,7 @@
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
Margin="0,4"
Margin="8"
Padding="{DynamicResource MenuFlyoutPadding}"
HorizontalAlignment="Stretch"
Background="{DynamicResource MenuFlyoutBackground}"

View File

@ -18,8 +18,8 @@
<ControlTemplate TargetType="NotificationCard">
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
<Border
Margin="4"
BoxShadow="0 0 14 #1A000000"
Margin="8"
BoxShadow="0 0 8 0 #1A000000"
CornerRadius="{TemplateBinding CornerRadius}">
<Border
Background="{TemplateBinding Background}"

View File

@ -18,6 +18,28 @@
Theme="{StaticResource BorderlessTextBox}" />
</StackPanel>
</Design.PreviewWith>
<MenuFlyout x:Key="DefaultTextBoxContextFlyout" Placement="Bottom">
<MenuItem
x:Name="TextBoxContextFlyoutCutItem"
Command="{Binding $parent[TextBox].Cut}"
Header="Cut"
InputGesture="{x:Static TextBox.CutGesture}"
IsEnabled="{Binding $parent[TextBox].CanCut}" />
<MenuItem
x:Name="TextBoxContextFlyoutCopyItem"
Command="{Binding $parent[TextBox].Copy}"
Header="Copy"
InputGesture="{x:Static TextBox.CopyGesture}"
IsEnabled="{Binding $parent[TextBox].CanCopy}" />
<MenuItem
x:Name="TextBoxContextFlyoutPasteItem"
Command="{Binding $parent[TextBox].Paste}"
Header="Paste"
InputGesture="{x:Static TextBox.PasteGesture}"
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
</MenuFlyout>
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
<ControlTheme.Resources>
<ControlTheme x:Key="InputClearButton" TargetType="Button">
@ -77,6 +99,7 @@
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="TextBox.ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="TextBox.Template">
<ControlTemplate TargetType="TextBox">
<Border

View File

@ -5,7 +5,7 @@
<SolidColorBrush x:Key="AutoCompleteBoxPopupBackground" Color="White" />
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Opacity="0.08" Color="#1C1F23" />
<Thickness x:Key="AutoCompleteBoxPopupBorderThickness">1</Thickness>
<Thickness x:Key="AutoCompleteBoxPopupMargin">0 4</Thickness>
<Thickness x:Key="AutoCompleteBoxPopupMargin">4</Thickness>
<CornerRadius x:Key="AutoCompleteBoxPopupCornerRadius">6</CornerRadius>
<SolidColorBrush x:Key="AutoCompleteBoxBorderlessBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="AutoCompleteBoxBorderlessBackground" Opacity="0.05" Color="#2E3238" />

View File

@ -1,4 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="using:System">
<!-- Add Resources Here -->
<SolidColorBrush x:Key="CalendarBackground" Color="White" />
<SolidColorBrush x:Key="CalendarForeground" Color="#1C1F23" />
@ -43,4 +46,5 @@
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBlackoutForeground" Opacity="0.35" Color="#1C1F23" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonInactiveForeground" Opacity="0.62" Color="#1C1F23" />
<sys:Double x:Key="CalendarMinWidth">240</sys:Double>
</ResourceDictionary>

View File

@ -15,7 +15,7 @@
<Thickness x:Key="MenuFlyoutBorderThickness">1</Thickness>
<Thickness x:Key="MenuFlyoutPadding">0 4</Thickness>
<BoxShadows x:Key="MenuFlyoutBorderBoxShadow">0 0 8 0 #1A000000</BoxShadows>
<CornerRadius x:Key="MenuFlyoutCornerRadius">3</CornerRadius>
<CornerRadius x:Key="MenuFlyoutCornerRadius">6</CornerRadius>
<sys:Double x:Key="MenuFlyoutMinHeight">16</sys:Double>
<sys:Double x:Key="MenuFlyoutMinWidth">100</sys:Double>
<sys:Double x:Key="MenuFlyoutMaxHeight">400</sys:Double>