Skip to content

Commit 46dc013

Browse files
authored
change "Width" to "MinWidth" in Calendar styles so days and months are not cut off when using a large(r) fontsize (#3693)
1 parent 6524fe0 commit 46dc013

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/MainDemo.Wpf/App.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@
143143
<Setter Property="Height" Value="1" />
144144
<Setter Property="Fill" Value="{DynamicResource MaterialDesignDivider}" />
145145
</Style>
146+
147+
<Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
148+
<Setter Property="FontSize" Value="30"/>
149+
</Style>
150+
146151
</ResourceDictionary>
147152
</Application.Resources>
148153
</Application>

src/MainDemo.Wpf/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"Demo App": {
44
"commandName": "Project",
5-
"commandLineArgs": "-p Home -t Inherit -f LeftToRight"
5+
"commandLineArgs": "-p Picker -t Inherit -f LeftToRight"
66
}
77
}
88
}

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Calendar.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,14 @@
154154
</Setter.Value>
155155
</Setter>
156156
<Setter Property="VerticalContentAlignment" Value="Center" />
157-
<Setter Property="Width" Value="48" />
157+
<Setter Property="MinWidth" Value="48" />
158158
<Setter Property="wpf:CalendarAssist.SelectionColor" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
159159
<Setter Property="wpf:CalendarAssist.SelectionForegroundColor" Value="{DynamicResource MaterialDesign.Brush.Primary.Foreground}" />
160160
</Style>
161161

162162
<Style x:Key="MaterialDesignCalendarDayButton" TargetType="{x:Type CalendarDayButton}">
163163
<Setter Property="Cursor" Value="Hand" />
164164
<Setter Property="FontSize" Value="12" />
165-
<Setter Property="Height" Value="28" />
166165
<Setter Property="HorizontalContentAlignment" Value="Center" />
167166
<Setter Property="Margin" Value="2" />
168167
<Setter Property="MinHeight" Value="5" />
@@ -317,7 +316,8 @@
317316
</Setter.Value>
318317
</Setter>
319318
<Setter Property="VerticalContentAlignment" Value="Center" />
320-
<Setter Property="Width" Value="28" />
319+
<Setter Property="MinWidth" Value="28" />
320+
<Setter Property="MinHeight" Value="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"/>
321321
<Setter Property="wpf:CalendarAssist.SelectionColor" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
322322
<Setter Property="wpf:CalendarAssist.SelectionForegroundColor" Value="{DynamicResource MaterialDesign.Brush.Primary.Foreground}" />
323323
<Style.Triggers>

0 commit comments

Comments
 (0)