Styles.xaml 15 KB

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