Skip to content

Commit 134cddd

Browse files
Copilotrabbitismzdpcdt
authored
Add Small and Large size variants to date/time picker controls (#877)
* Initial plan * Add Small and Large style classes to DatePicker, TimePicker, DateTimePicker, DateRangePicker, and TimeRangePicker controls Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com> * fix: fix MinHeight in TimePicker when Classes include Small. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com> Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
1 parent 13362d6 commit 134cddd

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

src/Ursa.Themes.Semi/Controls/DatePicker.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,12 @@
130130
<Style Selector="^:focus-within /template/ Border#Background">
131131
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
132132
</Style>
133+
134+
<Style Selector="^.Large">
135+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
136+
</Style>
137+
<Style Selector="^.Small">
138+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
139+
</Style>
133140
</ControlTheme>
134141
</ResourceDictionary>

src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,12 @@
169169
<Style Selector="^ /template/ Border#Background:focus-within">
170170
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
171171
</Style>
172+
173+
<Style Selector="^.Large">
174+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
175+
</Style>
176+
<Style Selector="^.Small">
177+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
178+
</Style>
172179
</ControlTheme>
173180
</ResourceDictionary>

src/Ursa.Themes.Semi/Controls/DateTimePicker.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,12 @@
138138
<Style Selector="^:focus-within /template/ Border#Background">
139139
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
140140
</Style>
141+
142+
<Style Selector="^.Large">
143+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
144+
</Style>
145+
<Style Selector="^.Small">
146+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
147+
</Style>
141148
</ControlTheme>
142149
</ResourceDictionary>

src/Ursa.Themes.Semi/Controls/TimePicker.axaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
Grid.Column="0"
128128
HorizontalAlignment="Stretch"
129129
VerticalAlignment="Stretch"
130+
MinHeight="{TemplateBinding MinHeight}"
130131
Foreground="{TemplateBinding Foreground}"
131132
InnerLeftContent="{TemplateBinding InnerLeftContent}"
132133
InnerRightContent="{TemplateBinding InnerRightContent}"
@@ -234,5 +235,12 @@
234235
<Style Selector="^:focus-within /template/ Border#Background">
235236
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
236237
</Style>
238+
239+
<Style Selector="^.Large">
240+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
241+
</Style>
242+
<Style Selector="^.Small">
243+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
244+
</Style>
237245
</ControlTheme>
238246
</ResourceDictionary>

src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,12 @@
189189
<Style Selector="^ /template/ Border#Background:focus-within">
190190
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
191191
</Style>
192+
193+
<Style Selector="^.Large">
194+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
195+
</Style>
196+
<Style Selector="^.Small">
197+
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
198+
</Style>
192199
</ControlTheme>
193200
</ResourceDictionary>

0 commit comments

Comments
 (0)