Styles.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <Styles
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:sys="clr-namespace:System;assembly=netstandard"
  5. xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
  6. <Design.PreviewWith>
  7. <Border Height="2000" Padding="20">
  8. <StackPanel Spacing="5">
  9. <TextBlock Text="Code Font Family" />
  10. <Grid RowDefinitions="*,Auto">
  11. <Menu Grid.Row="1" Width="100">
  12. <MenuItem Header="File">
  13. <MenuItem Header="Test 1" />
  14. <MenuItem Header="Test 2" />
  15. <MenuItem Header="Test 3">
  16. <MenuItem.Icon>
  17. <CheckBox Margin="0" IsChecked="{Binding Checkbox, Mode=TwoWay}" />
  18. </MenuItem.Icon>
  19. </MenuItem>
  20. </MenuItem>
  21. </Menu>
  22. <StackPanel Orientation="Horizontal">
  23. <ToggleButton
  24. Name="btnAdd"
  25. Height="28"
  26. HorizontalAlignment="Right"
  27. Content="Addy" />
  28. <Button
  29. Name="btnRem"
  30. HorizontalAlignment="Right"
  31. Content="Add" />
  32. <TextBox
  33. Width="100"
  34. VerticalAlignment="Center"
  35. Text="Rrrrr"
  36. UseFloatingWatermark="True"
  37. Watermark="Hello" />
  38. <CheckBox>Test Check</CheckBox>
  39. </StackPanel>
  40. </Grid>
  41. <ui:NumberBox Value="1" />
  42. </StackPanel>
  43. </Border>
  44. </Design.PreviewWith>
  45. <Style Selector="Border.small">
  46. <Setter Property="Width" Value="100" />
  47. </Style>
  48. <Style Selector="Border.normal">
  49. <Setter Property="Width" Value="130" />
  50. </Style>
  51. <Style Selector="Border.large">
  52. <Setter Property="Width" Value="160" />
  53. </Style>
  54. <Style Selector="Border.huge">
  55. <Setter Property="Width" Value="200" />
  56. </Style>
  57. <Style Selector="Image.small">
  58. <Setter Property="Width" Value="50" />
  59. </Style>
  60. <Style Selector="Image.normal">
  61. <Setter Property="Width" Value="80" />
  62. </Style>
  63. <Style Selector="Image.large">
  64. <Setter Property="Width" Value="100" />
  65. </Style>
  66. <Style Selector="Image.huge">
  67. <Setter Property="Width" Value="120" />
  68. </Style>
  69. <Style Selector="#TitleBarHost &gt; Image">
  70. <Setter Property="Margin" Value="10" />
  71. </Style>
  72. <Style Selector="#TitleBarHost &gt; Label">
  73. <Setter Property="Margin" Value="5" />
  74. <Setter Property="FontSize" Value="14" />
  75. </Style>
  76. <Style Selector="Button.SystemCaption">
  77. <Setter Property="MinWidth" Value="10" />
  78. </Style>
  79. <Style Selector="DataGridColumnHeader">
  80. <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" />
  81. <Setter Property="HorizontalContentAlignment" Value="Center" />
  82. <Setter Property="BorderThickness" Value="1" />
  83. <Setter Property="VerticalContentAlignment" Value="Center" />
  84. <Setter Property="Background" Value="{DynamicResource ThemeControlBorderColor}" />
  85. <Setter Property="SeparatorBrush" Value="{DynamicResource ThemeControlBorderColor}" />
  86. <Setter Property="Padding" Value="5" />
  87. <Setter Property="Background" Value="{DynamicResource ThemeContentBackgroundColor}" />
  88. <Setter Property="Template">
  89. <ControlTemplate>
  90. <Grid Background="{TemplateBinding Background}" ColumnDefinitions="*,Auto">
  91. <Grid
  92. Margin="{TemplateBinding Padding}"
  93. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  94. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  95. ColumnDefinitions="*,Auto">
  96. <ContentPresenter Content="{TemplateBinding Content}" />
  97. <Path
  98. Name="SortIcon"
  99. Grid.Column="1"
  100. Width="8"
  101. Margin="4,0,0,0"
  102. HorizontalAlignment="Left"
  103. VerticalAlignment="Center"
  104. Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z "
  105. Fill="{TemplateBinding Foreground}"
  106. Stretch="Uniform" />
  107. </Grid>
  108. <Rectangle
  109. Name="VerticalSeparator"
  110. Grid.Column="1"
  111. Width="1"
  112. VerticalAlignment="Stretch"
  113. Fill="{TemplateBinding SeparatorBrush}"
  114. IsVisible="{TemplateBinding AreSeparatorsVisible}" />
  115. </Grid>
  116. </ControlTemplate>
  117. </Setter>
  118. </Style>
  119. <Style Selector="DataGrid">
  120. <Setter Property="RowBackground" Value="{DynamicResource ThemeAccentBrush4}" />
  121. <Setter Property="AlternatingRowBackground" Value="#00FFFFFF" />
  122. <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
  123. <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowColor}" />
  124. <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
  125. </Style>
  126. <Style Selector="DataGridRow:selected:focus /template/ Rectangle#BackgroundRectangle">
  127. <Setter Property="Fill" Value="{DynamicResource SystemAccentColor}" />
  128. <Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedBackgroundOpacity}" />
  129. </Style>
  130. <Style Selector="DataGridRow:pointerover /template/ Rectangle#BackgroundRectangle">
  131. <Setter Property="Fill" Value="{DynamicResource SystemListLowColor}" />
  132. </Style>
  133. <Style Selector="DataGridRow:selected /template/ Rectangle#BackgroundRectangle">
  134. <Setter Property="Fill" Value="{DynamicResource SystemAccentColor}" />
  135. <Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedUnfocusedBackgroundOpacity}" />
  136. </Style>
  137. <Style Selector="DataGridRow:selected:pointerover /template/ Rectangle#BackgroundRectangle">
  138. <Setter Property="Fill" Value="{DynamicResource SystemAccentColor}" />
  139. <Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedHoveredUnfocusedBackgroundOpacity}" />
  140. </Style>
  141. <Style Selector="DataGridRow:selected:pointerover:focus /template/ Rectangle#BackgroundRectangle">
  142. <Setter Property="Fill" Value="{DynamicResource SystemAccentColor}" />
  143. <Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedHoveredBackgroundOpacity}" />
  144. </Style>
  145. <Style Selector="DataGridCell">
  146. <Setter Property="HorizontalAlignment" Value="Center" />
  147. <Setter Property="HorizontalContentAlignment" Value="Center" />
  148. </Style>
  149. <Style Selector="DataGridCell.Left">
  150. <Setter Property="HorizontalAlignment" Value="Left" />
  151. </Style>
  152. <Style Selector="CheckBox">
  153. <Setter Property="BorderThickness" Value="1" />
  154. </Style>
  155. <Style Selector="MenuItem">
  156. <Setter Property="Height" Value="{DynamicResource MenuItemHeight}" />
  157. <Setter Property="Padding" Value="{DynamicResource MenuItemPadding}" />
  158. </Style>
  159. <Style Selector="MenuItem:selected /template/ Border#root">
  160. <Setter Property="Background" Value="{DynamicResource ThemeControlBorderColor}" />
  161. <Setter Property="BorderBrush" Value="{DynamicResource ThemeControlBorderColor}" />
  162. </Style>
  163. <Style Selector="TabItem > ScrollViewer">
  164. <Setter Property="Background" Value="{DynamicResource ThemeBackgroundColor}" />
  165. <Setter Property="Margin" Value="0,-5,0,0" />
  166. </Style>
  167. <Style Selector="TabItem > ScrollViewer > Border">
  168. <Setter Property="BorderThickness" Value="0,1,0,0" />
  169. <Setter Property="Background" Value="{DynamicResource ThemeBackgroundColor}" />
  170. <Setter Property="BorderBrush" Value="{DynamicResource HighlightBrush}" />
  171. </Style>
  172. <Style Selector="Button">
  173. <Setter Property="MinWidth" Value="80" />
  174. </Style>
  175. <Style Selector="ToggleButton">
  176. <Setter Property="Padding" Value="0,-5,0,0" />
  177. </Style>
  178. <Style Selector="TabItem">
  179. <Setter Property="FontSize" Value="14" />
  180. <Setter Property="BorderThickness" Value="0,0,1,0" />
  181. <Setter Property="BorderBrush" Value="{DynamicResource ThemeButtonForegroundColor}" />
  182. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  183. </Style>
  184. <Style Selector="TabItem:pointerover">
  185. <Setter Property="Foreground" Value="{DynamicResource ThemeButtonForegroundColor}" />
  186. </Style>
  187. <Style Selector="TabItem:selected">
  188. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  189. <Setter Property="Foreground" Value="{DynamicResource ThemeBackgroundColor}" />
  190. </Style>
  191. <Style Selector="TextBlock">
  192. <Setter Property="Margin" Value="{DynamicResource TextMargin}" />
  193. <Setter Property="FontSize" Value="{DynamicResource FontSize}" />
  194. <Setter Property="VerticalAlignment" Value="Center" />
  195. </Style>
  196. <Style Selector="Separator">
  197. <Setter Property="Background" Value="{DynamicResource ThemeControlBorderColor}" />
  198. <Setter Property="Foreground" Value="{DynamicResource ThemeControlBorderColor}" />
  199. <Setter Property="MinHeight" Value="1" />
  200. </Style>
  201. <Style Selector=":is(Button).DateTimeFlyoutButtonStyle">
  202. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  203. <Setter Property="Foreground" Value="{DynamicResource ThemeBackgroundColor}" />
  204. </Style>
  205. <Style Selector="DatePickerPresenter">
  206. <Setter Property="BorderThickness" Value="1" />
  207. <Setter Property="BorderBrush" Value="{DynamicResource ThemeButtonForegroundColor}" />
  208. </Style>
  209. <Style Selector="DataGridCell">
  210. <Setter Property="FontSize" Value="14" />
  211. </Style>
  212. <Style Selector="CheckBox TextBlock">
  213. <Setter Property="Margin" Value="0,5,0,0" />
  214. </Style>
  215. <Style Selector="ContextMenu">
  216. <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" />
  217. <Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
  218. </Style>
  219. <Style Selector="TextBox.NumberBoxTextBoxStyle">
  220. <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
  221. </Style>
  222. <Styles.Resources>
  223. <StaticResource x:Key="ListViewItemBackgroundSelected" ResourceKey="ThemeAccentColorBrush" />
  224. <StaticResource x:Key="ListViewItemBackgroundPressed" ResourceKey="SystemAccentColorDark1" />
  225. <StaticResource x:Key="ListViewItemBackgroundPointerOver" ResourceKey="SystemAccentColorDark2" />
  226. <StaticResource x:Key="ListViewItemBackgroundSelectedPressed" ResourceKey="ThemeAccentColorBrush" />
  227. <StaticResource x:Key="ListViewItemBackgroundSelectedPointerOver" ResourceKey="SystemAccentColorDark2" />
  228. <SolidColorBrush
  229. x:Key="DataGridGridLinesBrush"
  230. Opacity="0.4"
  231. Color="{DynamicResource SystemBaseMediumLowColor}" />
  232. <SolidColorBrush x:Key="DataGridSelectionBackgroundBrush" Color="{DynamicResource DataGridSelectionColor}" />
  233. <SolidColorBrush x:Key="MenuFlyoutPresenterBorderBrush" Color="{DynamicResource MenuFlyoutPresenterBorderColor}" />
  234. <SolidColorBrush x:Key="ThemeAccentColorBrush" Color="{DynamicResource SystemAccentColor}" />
  235. <SolidColorBrush x:Key="ListBoxBackground" Color="{DynamicResource ThemeContentBackgroundColor}" />
  236. <SolidColorBrush x:Key="ThemeForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" />
  237. <SolidColorBrush x:Key="ThemeAccentBrush4" Color="{DynamicResource ThemeAccentColor4}" />
  238. <SolidColorBrush x:Key="SplitButtonBackgroundChecked" Color="#00E81123" />
  239. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedPointerOver" Color="#00E81123" />
  240. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedPressed" Color="#00E81123" />
  241. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedDisabled" Color="#00E81123" />
  242. <Thickness x:Key="PageMargin">40 0 40 0</Thickness>
  243. <Thickness x:Key="Margin">0 5 0 5</Thickness>
  244. <Thickness x:Key="MenuItemPadding">5 0 5 0</Thickness>
  245. <Color x:Key="MenuFlyoutPresenterBorderColor">#00000000</Color>
  246. <Color x:Key="SystemAccentColor">#FF00C3E3</Color>
  247. <Color x:Key="SystemAccentColorDark1">#FF00C3E3</Color>
  248. <Color x:Key="SystemAccentColorDark2">#FF00C3E3</Color>
  249. <Color x:Key="SystemAccentColorDark3">#FF00C3E3</Color>
  250. <Color x:Key="SystemAccentColorLight1">#FF00C3E3</Color>
  251. <Color x:Key="SystemAccentColorLight2">#FF00C3E3</Color>
  252. <Color x:Key="SystemAccentColorLight3">#FF00C3E3</Color>
  253. <Color x:Key="DataGridSelectionColor">#FF00FABB</Color>
  254. <Color x:Key="ThemeContentBackgroundColor">#FF2D2D2D</Color>
  255. <Color x:Key="ThemeControlBorderColor">#FF505050</Color>
  256. <sys:Double x:Key="ScrollBarThickness">15</sys:Double>
  257. <sys:Double x:Key="FontSizeSmall">8</sys:Double>
  258. <sys:Double x:Key="FontSizeNormal">10</sys:Double>
  259. <sys:Double x:Key="FontSize">12</sys:Double>
  260. <sys:Double x:Key="FontSizeLarge">15</sys:Double>
  261. <sys:Double x:Key="ControlContentThemeFontSize">13</sys:Double>
  262. <x:Double x:Key="MenuItemHeight">26</x:Double>
  263. <x:Double x:Key="TabItemMinHeight">28</x:Double>
  264. </Styles.Resources>
  265. </Styles>