Styles.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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="1" />
  60. <Setter Property="CornerRadius" Value="5" />
  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="ProgressBar /template/ Border#ProgressBarTrack">
  182. <Setter Property="IsVisible" Value="False" />
  183. </Style>
  184. <Style Selector="ToggleButton">
  185. <Setter Property="Padding" Value="0,-5,0,0" />
  186. </Style>
  187. <Style Selector="TabItem">
  188. <Setter Property="FontSize" Value="14" />
  189. <Setter Property="BorderThickness" Value="0,0,1,0" />
  190. <Setter Property="BorderBrush" Value="{DynamicResource ThemeButtonForegroundColor}" />
  191. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  192. </Style>
  193. <Style Selector="TabItem:pointerover">
  194. <Setter Property="Foreground" Value="{DynamicResource ThemeButtonForegroundColor}" />
  195. </Style>
  196. <Style Selector="TabItem:selected">
  197. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  198. <Setter Property="Foreground" Value="{DynamicResource ThemeBackgroundColor}" />
  199. </Style>
  200. <Style Selector="TextBlock">
  201. <Setter Property="Margin" Value="{DynamicResource TextMargin}" />
  202. <Setter Property="FontSize" Value="{DynamicResource FontSize}" />
  203. <Setter Property="VerticalAlignment" Value="Center" />
  204. <Setter Property="TextWrapping" Value="WrapWithOverflow" />
  205. </Style>
  206. <Style Selector="TextBlock.h1">
  207. <Setter Property="Margin" Value="{DynamicResource TextMargin}" />
  208. <Setter Property="VerticalAlignment" Value="Center" />
  209. <Setter Property="FontWeight" Value="Bold" />
  210. <Setter Property="FontSize" Value="16" />
  211. <Setter Property="TextWrapping" Value="WrapWithOverflow" />
  212. </Style>
  213. <Style Selector="Separator">
  214. <Setter Property="Background" Value="{DynamicResource ThemeControlBorderColor}" />
  215. <Setter Property="Foreground" Value="{DynamicResource ThemeControlBorderColor}" />
  216. <Setter Property="MinHeight" Value="1" />
  217. </Style>
  218. <Style Selector=":is(Button).DateTimeFlyoutButtonStyle">
  219. <Setter Property="Background" Value="{DynamicResource HighlightColor}" />
  220. <Setter Property="Foreground" Value="{DynamicResource ThemeBackgroundColor}" />
  221. </Style>
  222. <Style Selector="DatePickerPresenter">
  223. <Setter Property="BorderThickness" Value="1" />
  224. <Setter Property="BorderBrush" Value="{DynamicResource ThemeButtonForegroundColor}" />
  225. </Style>
  226. <Style Selector="DataGridCell">
  227. <Setter Property="FontSize" Value="14" />
  228. </Style>
  229. <Style Selector="CheckBox TextBlock">
  230. <Setter Property="Margin" Value="0,5,0,0" />
  231. </Style>
  232. <Style Selector="ContextMenu">
  233. <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" />
  234. <Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
  235. </Style>
  236. <Style Selector="TextBox">
  237. <Setter Property="VerticalContentAlignment" Value="Center" />
  238. </Style>
  239. <Style Selector="TextBox.NumberBoxTextBoxStyle">
  240. <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
  241. </Style>
  242. <Style Selector="ListBox ListBoxItem">
  243. <Setter Property="Padding" Value="0" />
  244. <Setter Property="Margin" Value="0" />
  245. <Setter Property="CornerRadius" Value="5" />
  246. <Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
  247. <Setter Property="BorderThickness" Value="2"/>
  248. <Style.Animations>
  249. <Animation Duration="0:0:0.7">
  250. <KeyFrame Cue="0%">
  251. <Setter Property="MaxHeight" Value="0" />
  252. <Setter Property="Opacity" Value="0.0" />
  253. </KeyFrame>
  254. <KeyFrame Cue="50%">
  255. <Setter Property="MaxHeight" Value="1000" />
  256. <Setter Property="Opacity" Value="0.3" />
  257. </KeyFrame>
  258. <KeyFrame Cue="100%">
  259. <Setter Property="MaxHeight" Value="1000" />
  260. <Setter Property="Opacity" Value="1.0" />
  261. </KeyFrame>
  262. </Animation>
  263. </Style.Animations>
  264. </Style>
  265. <Style Selector="ListBox ListBoxItem:selected /template/ ContentPresenter">
  266. <Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
  267. </Style>
  268. <Style Selector="ListBox ListBoxItem:pointerover /template/ ContentPresenter">
  269. <Setter Property="Background" Value="{DynamicResource AppListHoverBackgroundColor}" />
  270. </Style>
  271. <Styles.Resources>
  272. <SolidColorBrush x:Key="ThemeAccentColorBrush" Color="{DynamicResource SystemAccentColor}" />
  273. <StaticResource x:Key="ListViewItemBackgroundSelected" ResourceKey="ThemeAccentColorBrush" />
  274. <StaticResource x:Key="ListViewItemBackgroundPressed" ResourceKey="SystemAccentColorDark1" />
  275. <StaticResource x:Key="ListViewItemBackgroundPointerOver" ResourceKey="SystemAccentColorDark2" />
  276. <StaticResource x:Key="ListViewItemBackgroundSelectedPressed" ResourceKey="ThemeAccentColorBrush" />
  277. <StaticResource x:Key="ListViewItemBackgroundSelectedPointerOver" ResourceKey="SystemAccentColorDark2" />
  278. <SolidColorBrush
  279. x:Key="DataGridGridLinesBrush"
  280. Opacity="0.4"
  281. Color="{DynamicResource SystemBaseMediumLowColor}" />
  282. <SolidColorBrush x:Key="DataGridSelectionBackgroundBrush" Color="{DynamicResource DataGridSelectionColor}" />
  283. <SolidColorBrush x:Key="MenuFlyoutPresenterBorderBrush" Color="{DynamicResource MenuFlyoutPresenterBorderColor}" />
  284. <SolidColorBrush x:Key="FlyoutBorderThemeBrush" Color="{DynamicResource MenuFlyoutPresenterBorderColor}" />
  285. <SolidColorBrush x:Key="ListBoxBackground" Color="{DynamicResource ThemeContentBackgroundColor}" />
  286. <SolidColorBrush x:Key="ThemeForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" />
  287. <SolidColorBrush x:Key="ThemeAccentBrush4" Color="{DynamicResource ThemeAccentColor4}" />
  288. <SolidColorBrush x:Key="SplitButtonBackgroundChecked" Color="#00E81123" />
  289. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedPointerOver" Color="#00E81123" />
  290. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedPressed" Color="#00E81123" />
  291. <SolidColorBrush x:Key="SplitButtonBackgroundCheckedDisabled" Color="#00E81123" />
  292. <Thickness x:Key="PageMargin">40 0 40 0</Thickness>
  293. <Thickness x:Key="Margin">0 5 0 5</Thickness>
  294. <Thickness x:Key="MenuItemPadding">5 0 5 0</Thickness>
  295. <Color x:Key="MenuFlyoutPresenterBorderColor">#00000000</Color>
  296. <Color x:Key="SystemAccentColor">#FF00C3E3</Color>
  297. <Color x:Key="SystemAccentColorDark1">#FF00C3E3</Color>
  298. <Color x:Key="SystemAccentColorDark2">#FF00C3E3</Color>
  299. <Color x:Key="SystemAccentColorDark3">#FF00C3E3</Color>
  300. <Color x:Key="SystemAccentColorLight1">#FF00C3E3</Color>
  301. <Color x:Key="SystemAccentColorLight2">#FF00C3E3</Color>
  302. <Color x:Key="SystemAccentColorLight3">#FF00C3E3</Color>
  303. <Color x:Key="DataGridSelectionColor">#FF00FABB</Color>
  304. <Color x:Key="ThemeContentBackgroundColor">#FF2D2D2D</Color>
  305. <Color x:Key="ThemeControlBorderColor">#FF505050</Color>
  306. <Color x:Key="VsyncEnabled">#FF2EEAC9</Color>
  307. <Color x:Key="VsyncDisabled">#FFFF4554</Color>
  308. <Color x:Key="AppListBackgroundColor">#0FFFFFFF</Color>
  309. <Color x:Key="AppListHoverBackgroundColor">#1EFFFFFF</Color>
  310. <Color x:Key="SecondaryTextColor">#A0FFFFFF</Color>
  311. <x:Double x:Key="ScrollBarThickness">15</x:Double>
  312. <x:Double x:Key="FontSizeSmall">8</x:Double>
  313. <x:Double x:Key="FontSizeNormal">10</x:Double>
  314. <x:Double x:Key="FontSize">12</x:Double>
  315. <x:Double x:Key="FontSizeLarge">15</x:Double>
  316. <x:Double x:Key="ControlContentThemeFontSize">13</x:Double>
  317. <x:Double x:Key="MenuItemHeight">26</x:Double>
  318. <x:Double x:Key="TabItemMinHeight">28</x:Double>
  319. <x:Double x:Key="ContentDialogMaxWidth">600</x:Double>
  320. <x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
  321. </Styles.Resources>
  322. </Styles>