Skip to content

Commit df7b2ad

Browse files
committed
Correct height of a row
1 parent 05d070e commit df7b2ad

File tree

1 file changed

+42
-15
lines changed

1 file changed

+42
-15
lines changed

Material.Avalonia.DataGrid/DataGrid.xaml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@
214214

215215
<Style Selector="DataGridRowGroupHeader">
216216
<Setter Property="Background" Value="{DynamicResource ThemeControlMidHighBrush}" />
217-
<Setter Property="Height" Value="20" />
218217
<Setter Property="Template">
219218
<ControlTemplate>
220219
<DataGridFrozenGrid Name="Root"
221220
Background="{TemplateBinding Background}"
221+
MinHeight="52"
222222
ColumnDefinitions="Auto,Auto,Auto,Auto"
223223
RowDefinitions="Auto,*,Auto">
224224

@@ -238,23 +238,50 @@
238238
</Setter>
239239
</Style>
240240

241-
<Style Selector="DataGridRowGroupHeader /template/ ToggleButton#ExpanderButton">
241+
<Style Selector="DataGridRowGroupHeader /template/ ToggleButton#PART_ExpanderButton">
242+
<Setter Property="Cursor" Value="Hand" />
243+
<Setter Property="Focusable" Value="False" />
244+
<Setter Property="CornerRadius" Value="16" />
245+
<Setter Property="Width" Value="24" />
246+
<Setter Property="Height" Value="24" />
247+
<Setter Property="Margin" Value="4,0,0,0" />
242248
<Setter Property="Template">
243-
<ControlTemplate>
244-
<Border Grid.Column="0" Width="20" Height="20" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
245-
<Path Fill="{TemplateBinding Foreground}"
246-
HorizontalAlignment="Center"
247-
VerticalAlignment="Center"
248-
Data="M 0 2 L 4 6 L 0 10 Z" />
249-
</Border>
250-
</ControlTemplate>
249+
<Setter.Value>
250+
<ControlTemplate>
251+
<Border Background="Transparent"
252+
CornerRadius="{TemplateBinding CornerRadius}"
253+
ClipToBounds="True">
254+
<ripple:RippleEffect Name="PART_Ripple"
255+
RippleFill="{TemplateBinding Foreground,
256+
Converter={StaticResource BrushRoundConverter}}">
257+
<Panel Name="PART_InnerPanel" Width="24" Height="24">
258+
<Path Data="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"
259+
Name="ExpandPath"
260+
Fill="{TemplateBinding Foreground}"
261+
Stroke="{TemplateBinding Foreground}" />
262+
</Panel>
263+
</ripple:RippleEffect>
264+
</Border>
265+
</ControlTemplate>
266+
</Setter.Value>
251267
</Setter>
252-
</Style>
253268

254-
<Style Selector="DataGridRowGroupHeader /template/ ToggleButton#ExpanderButton:checked /template/ Path">
255-
<Setter Property="RenderTransform">
256-
<RotateTransform Angle="90" />
257-
</Setter>
269+
<Style Selector="^:not(.no-transitions) /template/ Panel#PART_InnerPanel">
270+
<Setter Property="Transitions">
271+
<Transitions>
272+
<TransformOperationsTransition Duration="0:0:0.25" Property="RenderTransform" Easing="CircularEaseOut" />
273+
</Transitions>
274+
</Setter>
275+
</Style>
276+
277+
<Style Selector="^ /template/ Panel#PART_InnerPanel">
278+
<Setter Property="RenderTransform" Value="rotate(0deg)" />
279+
</Style>
280+
281+
<!-- Rotate the arrow to 45 degrees when group expanded -->
282+
<Style Selector="^:checked /template/ Panel#PART_InnerPanel">
283+
<Setter Property="RenderTransform" Value="rotate(45deg)" />
284+
</Style>
258285
</Style>
259286

260287
<Style Selector="DataGrid">

0 commit comments

Comments
 (0)