SettingsLayout.axaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <UserControl x:Class="SukiUI.Controls.SettingsLayout"
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:controls="clr-namespace:SukiUI.Controls"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:theme="clr-namespace:SukiUI.Theme"
  8. d:DesignHeight="450"
  9. d:DesignWidth="800"
  10. mc:Ignorable="d">
  11. <UserControl.Styles>
  12. <Style Selector="RadioButton.MenuChip">
  13. <Setter Property="Background" Value="Transparent" />
  14. <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
  15. <Setter Property="BorderThickness" Value="0" />
  16. <Setter Property="Transitions">
  17. <Transitions>
  18. <ThicknessTransition Property="Margin" Duration="0:0:0.4" />
  19. </Transitions>
  20. </Setter>
  21. <Setter Property="Template">
  22. <ControlTemplate>
  23. <Grid HorizontalAlignment="Left">
  24. <Border Width="250"
  25. Height="45"
  26. Margin="20,2,5,0"
  27. Padding="20,4,12,4"
  28. HorizontalAlignment="Left"
  29. Background="{TemplateBinding Background}"
  30. BorderBrush="{TemplateBinding BorderBrush}"
  31. BorderThickness="{TemplateBinding BorderThickness}"
  32. CornerRadius="8">
  33. <StackPanel HorizontalAlignment="Left"
  34. VerticalAlignment="Center"
  35. Orientation="Horizontal">
  36. <Ellipse Name="EL"
  37. Width="5"
  38. Height="5"
  39. Margin="2,0,20,0"
  40. Fill="{DynamicResource SukiPrimaryColor}" />
  41. <ContentPresenter Name="PART_ContentPresenter"
  42. Grid.Column="1"
  43. VerticalAlignment="Center"
  44. Content="{TemplateBinding Content}"
  45. ContentTemplate="{TemplateBinding ContentTemplate}"
  46. RecognizesAccessKey="True" />
  47. </StackPanel>
  48. </Border>
  49. </Grid>
  50. </ControlTemplate>
  51. </Setter>
  52. </Style>
  53. <Style Selector="RadioButton.MenuChip:checked">
  54. <Setter Property="TextBlock.FontWeight" Value="{DynamicResource DefaultDemiBold}" />
  55. <Setter Property="BorderThickness" Value="0,0,0,0" />
  56. <Setter Property="BorderBrush" Value="{DynamicResource SukiPrimaryColor}" />
  57. </Style>
  58. <Style Selector="RadioButton.MenuChip:pointerover /template/ Border">
  59. <Setter Property="Background" Value="{DynamicResource SukiLightBackground}" />
  60. </Style>
  61. <Style Selector="RadioButton.MenuChip TextBlock">
  62. <Setter Property="FontSize" Value="50" />
  63. </Style>
  64. <Style Selector="RadioButton.MenuChip:checked TextBlock">
  65. <Setter Property="FontWeight" Value="{DynamicResource DefaultDemiBold}" />
  66. <Setter Property="Foreground" Value="{DynamicResource SukiPrimaryColor}" />
  67. </Style>
  68. <Style Selector="RadioButton.MenuChip Ellipse">
  69. <Setter Property="Opacity" Value="0" />
  70. <Setter Property="Transitions">
  71. <Transitions>
  72. <DoubleTransition Property="Opacity" Duration="0:0:0.3" />
  73. </Transitions>
  74. </Setter>
  75. </Style>
  76. <Style Selector="RadioButton.MenuChip:checked Ellipse">
  77. <Setter Property="Opacity" Value="1" />
  78. </Style>
  79. <Style Selector="RadioButton.MenuChip /template/ Border">
  80. <Setter Property="TextBlock.FontSize" Value="16" />
  81. </Style>
  82. <Style Selector="RadioButton.MenuChip:checked /template/ Border">
  83. <Setter Property="Transitions">
  84. <Transitions>
  85. <BrushTransition Property="Background" Duration="0:0:0.15" />
  86. </Transitions>
  87. </Setter>
  88. <Setter Property="TextBlock.FontWeight" Value="{DynamicResource DefaultDemiBold}" />
  89. <Setter Property="TextBlock.Foreground" Value="{DynamicResource SukiPrimaryColor}" />
  90. <Setter Property="Background" Value="{DynamicResource SukiPrimaryColor10}" />
  91. <Setter Property="BorderBrush" Value="{DynamicResource SukiPrimaryColor}" />
  92. <Setter Property="BorderThickness" Value="0,0,0,0" />
  93. </Style>
  94. <Style Selector="RadioButton.MenuChip /template/ ContentPresenter#PART_ContentPresenter">
  95. <Setter Property="Transitions">
  96. <Transitions>
  97. <ThicknessTransition Property="Margin" Duration="0:0:0.25" />
  98. </Transitions>
  99. </Setter>
  100. </Style>
  101. <Style Selector="controls|SettingsLayout">
  102. <Setter Property="Template">
  103. <ControlTemplate>
  104. <DockPanel MaxWidth="1400" SizeChanged="DockPanel_SizeChanged">
  105. <StackPanel Name="StackSummary"
  106. Width="400"
  107. Margin="0,25,0,0"
  108. HorizontalAlignment="Left"
  109. DockPanel.Dock="Left" />
  110. <ScrollViewer Name="MyScroll" Classes="Stack">
  111. <StackPanel Name="StackItems"
  112. Margin="20,0"
  113. theme:StackPanelExtensions.AnimatedScroll="True" />
  114. </ScrollViewer>
  115. </DockPanel>
  116. </ControlTemplate>
  117. </Setter>
  118. </Style>
  119. </UserControl.Styles>
  120. </UserControl>