Merge pull request #460 from irihitech/popup
Adjust Padding for ComboBox, ListBox, DatePicker, and TimePicker Items
This commit is contained in:
commit
7f6a5615e6
@ -30,11 +30,11 @@
|
||||
<ControlTheme x:Key="{x:Type ComboBox}" TargetType="ComboBox">
|
||||
<Setter Property="Padding" Value="{DynamicResource ComboBoxSelectorDefaultPadding}" />
|
||||
<Setter Property="FocusAdorner" Value="{x:Null}" />
|
||||
<Setter Property="MaxDropDownHeight" Value="504" />
|
||||
<Setter Property="MaxDropDownHeight" Value="{DynamicResource ComboBoxPopupMaxDropDownHeight}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorBorderBrush}" />
|
||||
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource ComboBoxSelectorThickness}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
@ -66,8 +66,7 @@
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,
|
||||
Converter={x:Static ObjectConverters.IsNull}}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Opacity="0.3"
|
||||
Text="{TemplateBinding PlaceholderText}" />
|
||||
<ContentPresenter
|
||||
@ -81,27 +80,19 @@
|
||||
<Button
|
||||
Name="ClearButton"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,8,0"
|
||||
Margin="{DynamicResource ComboBoxClearButtonMargin}"
|
||||
Command="{Binding $parent[ComboBox].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
Theme="{DynamicResource InnerIconButton}" />
|
||||
<Border
|
||||
Name="DropDownOverlay"
|
||||
Grid.Column="1"
|
||||
Width="30"
|
||||
Margin="0,1,1,1"
|
||||
HorizontalAlignment="Right"
|
||||
Background="Transparent"
|
||||
IsVisible="False" />
|
||||
|
||||
<PathIcon
|
||||
Name="DropDownGlyph"
|
||||
Grid.Column="1"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Margin="0,0,12,0"
|
||||
Width="{DynamicResource ComboBoxIconWidth}"
|
||||
Height="{DynamicResource ComboBoxIconHeight}"
|
||||
Margin="{DynamicResource ComboBoxIconMargin}"
|
||||
Data="{DynamicResource ComboBoxIcon}"
|
||||
Foreground="{DynamicResource ComboBoxIconDefaultForeground}"
|
||||
IsHitTestVisible="False"
|
||||
@ -120,21 +111,20 @@
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
Name="PopupBorder"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="{DynamicResource ComboBoxPopupBorderMargin}"
|
||||
Background="{DynamicResource ComboBoxPopupBackground}"
|
||||
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
|
||||
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
|
||||
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="6">
|
||||
CornerRadius="{DynamicResource ComboBoxPopupBoxCornerRadius}"
|
||||
ClipToBounds="True">
|
||||
<ScrollViewer
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
@ -22,11 +22,12 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource DateTimePickerFlyoutBoxShadow}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
ClipToBounds="True">
|
||||
<Grid Name="ContentPanel" RowDefinitions="*,Auto">
|
||||
<Grid Name="PART_PickerContainer">
|
||||
<Grid.Styles>
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Setter Property="Theme" Value="{StaticResource DateTimePickerItem}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
@ -108,6 +109,7 @@
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Height="1"
|
||||
VerticalAlignment="Top"
|
||||
@ -177,6 +179,7 @@
|
||||
<TextBlock
|
||||
Name="PART_MonthTextBlock"
|
||||
Padding="12,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
|
@ -65,10 +65,6 @@
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^.MonthItem">
|
||||
<Setter Property="Padding" Value="{DynamicResource DatePickerFlyoutPresenterMonthPadding}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- This is used for both the accept/dismiss & buttons in the presenter -->
|
||||
|
@ -205,13 +205,13 @@
|
||||
<Setter Property="MinHeight" Value="{DynamicResource ScrollBarThickness}" />
|
||||
<Setter Property="Width" Value="{DynamicResource ScrollBarThumbThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ RepeatButton > PathIcon">
|
||||
<Style Selector="^ /template/ RepeatButton > PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ScrollBarButtonDefaultForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > PathIcon">
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ScrollBarButtonPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ RepeatButton:pressed > PathIcon">
|
||||
<Style Selector="^ /template/ RepeatButton:pressed > PathIcon">
|
||||
<Setter Property="RenderTransform" Value="scale(0.92)" />
|
||||
</Style>
|
||||
|
||||
@ -346,11 +346,11 @@
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ RepeatButton > Path">
|
||||
<Style Selector="^ /template/ RepeatButton > Path">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorScrollBarButtonDefaultForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > Path">
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > Path">
|
||||
<Setter Property="Fill" Value="{DynamicResource ColorScrollBarButtonPointeroverForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
@ -32,10 +32,10 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ Border#PART_BorderSeparator">
|
||||
|
@ -22,11 +22,12 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource DateTimePickerFlyoutBoxShadow}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
ClipToBounds="True">
|
||||
<Grid Name="ContentPanel" RowDefinitions="*,Auto">
|
||||
<Grid Name="PART_PickerContainer">
|
||||
<Grid.Styles>
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Setter Property="Theme" Value="{StaticResource DateTimePickerItem}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
@ -130,6 +131,7 @@
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Height="1"
|
||||
VerticalAlignment="Top"
|
||||
|
@ -1,14 +1,22 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<CornerRadius x:Key="ComboBoxSelectorCornerRadius">3</CornerRadius>
|
||||
<Thickness x:Key="ComboBoxSelectorThickness">1</Thickness>
|
||||
|
||||
<Thickness x:Key="ComboBoxItemDefaultPadding">8 4</Thickness>
|
||||
<Thickness x:Key="ComboBoxItemDefaultPadding">12 8</Thickness>
|
||||
<Thickness x:Key="ComboBoxSelectorDefaultPadding">8 0</Thickness>
|
||||
|
||||
<x:Double x:Key="ComboBoxPopupMaxDropDownHeight">504</x:Double>
|
||||
<Thickness x:Key="ComboBoxPopupBorderThickness">1</Thickness>
|
||||
<CornerRadius x:Key="ComboBoxPopupBoxCornerRadius">6</CornerRadius>
|
||||
|
||||
<Thickness x:Key="ComboBoxClearButtonMargin">0 0 8 0</Thickness>
|
||||
<Thickness x:Key="ComboBoxIconMargin">0 0 12 0</Thickness>
|
||||
<x:Double x:Key="ComboBoxIconWidth">12</x:Double>
|
||||
<x:Double x:Key="ComboBoxIconHeight">12</x:Double>
|
||||
<StreamGeometry x:Key="ComboBoxIcon">
|
||||
M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z
|
||||
</StreamGeometry>
|
||||
<Thickness x:Key="ComboBoxPopupBorderMargin">0 4</Thickness>
|
||||
|
||||
<x:Double x:Key="ComboBoxDefaultHeight">32</x:Double>
|
||||
<x:Double x:Key="ComboBoxSmallHeight">24</x:Double>
|
||||
|
@ -4,10 +4,10 @@
|
||||
<StreamGeometry x:Key="DateTimePickerAcceptGlyph">M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915 9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019 9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246 5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988 14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="DateTimePickerDismissGlyph">M17.6568 19.7782C18.2426 20.3639 19.1924 20.3639 19.7782 19.7782C20.3639 19.1924 20.3639 18.2426 19.7782 17.6568L14.1213 12L19.7782 6.34313C20.3639 5.75734 20.3639 4.8076 19.7782 4.22181C19.1924 3.63602 18.2426 3.63602 17.6568 4.22181L12 9.87866L6.34313 4.22181C5.75734 3.63602 4.8076 3.63602 4.22181 4.22181C3.63602 4.8076 3.63602 5.75734 4.22181 6.34313L9.87866 12L4.22181 17.6568C3.63602 18.2426 3.63602 19.1924 4.22181 19.7782C4.8076 20.3639 5.75734 20.3639 6.34313 19.7782L12 14.1213L17.6568 19.7782Z</StreamGeometry>
|
||||
|
||||
<x:Double x:Key="DateTimePickerListBoxItemHeight">30</x:Double>
|
||||
<x:Double x:Key="DateTimePickerListBoxItemHeight">36</x:Double>
|
||||
|
||||
|
||||
<Thickness x:Key="DateTimePickerFlyoutPadding">16 0</Thickness>
|
||||
<Thickness x:Key="DateTimePickerFlyoutPadding">0</Thickness>
|
||||
<Thickness x:Key="DateTimePickerFlyoutBorderMargin">8</Thickness>
|
||||
|
||||
<x:Double x:Key="DateTimePickerButtonSmallHeight">24</x:Double>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ListBox -->
|
||||
<Thickness x:Key="ListBoxItemDefaultPadding">8 4</Thickness>
|
||||
<Thickness x:Key="ListBoxItemDefaultPadding">12 8</Thickness>
|
||||
<CornerRadius x:Key="ListBoxItemCornerRadius">3</CornerRadius>
|
||||
|
||||
</ResourceDictionary>
|
Loading…
x
Reference in New Issue
Block a user