Mesen2/UI/Styles/MesenStyles.xaml

559 lines
21 KiB
XML

<Styles
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard"
xmlns:c="using:Mesen.Controls"
xmlns:du="using:Mesen.Debugger.Utilities"
>
<StyleInclude Source="/Styles/MesenStyles.Light.xaml" />
<StyleInclude Source="/Styles/MesenStyles.Dark.xaml" />
<StyleInclude Source="avares://Dock.Avalonia/Themes/DockFluentTheme.axaml" />
<StyleInclude Source="/ThirdParty/DataBox/Themes/Fluent.axaml" />
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
<StyleInclude Source="/Styles/DockStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaComboBoxStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaContextMenuStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaMenuItemStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaNumericUpDownStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaScrollViewerStyles.xaml" />
<StyleInclude Source="avares://Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml" />
<Design.PreviewWith>
<Window Width="440" Height="620" Padding="5">
<StackPanel>
<Menu VerticalAlignment="Top">
<MenuItem Header="File">
<MenuItem Header="Open">
<MenuItem.Icon>
<Image Source="/Assets/Folder.png" />
</MenuItem.Icon>
<MenuItem Header="Abcd" />
<Separator />
<MenuItem Header="Abcd" />
</MenuItem>
<Separator />
<MenuItem Header="Video Size" />
<MenuItem Header="-"/>
<MenuItem Header="Abcd" />
</MenuItem>
<MenuItem Header="Test">
<MenuItem Header="Abcd" />
</MenuItem>
</Menu>
<CheckBox Content="Test" ToolTip.Tip="Test tooltip" />
<CheckBox Content="Test" IsChecked="True" />
<TabControl>
<TabItem Header="Test" />
</TabControl>
<NumericUpDown Value="1" />
<NumericUpDown Value="100" IsEnabled="False" />
<ComboBox SelectedIndex="0">
<ComboBoxItem>0Test</ComboBoxItem>
<ComboBoxItem>0Test</ComboBoxItem>
<ComboBoxItem>0Test</ComboBoxItem>
<ComboBoxItem>0Test</ComboBoxItem>
<ComboBoxItem>0Test</ComboBoxItem>
</ComboBox>
<TextBox Text="00bc" />
<TextBox Text="test&#13;test&#13;test&#13;test&#13;test" AcceptsReturn="True" />
<Button Content="Testgpq" />
<Button Content="Disabled" IsEnabled="False" />
<RepeatButton Content="Repeat" />
<RepeatButton Content="Disabled" IsEnabled="False" />
<c:ButtonWithIcon Icon="Assets/MediaPlay.png" Text="Testgpq" />
<RadioButton Content="Test"/>
<RadioButton Content="Test" IsChecked="True"/>
<DatePicker />
<TimePicker />
<Slider />
<Slider Orientation="Vertical" Height="50" />
<TextBox IsEnabled="False" Text="Test disabled" />
<CheckBox IsEnabled="False" Content="Test" />
<CheckBox IsChecked="True" IsEnabled="False" Content="Test" />
</StackPanel>
</Window>
</Design.PreviewWith>
<Styles.Resources>
<Color x:Key="MesenGrayBorderColor">#80808080</Color>
<Color x:Key="MesenGrayBackgroundColor">#40A0A0A0</Color>
<!-- Misc fluent overrides -->
<x:Double x:Key="DatePickerThemeMinWidth">150</x:Double>
<x:Double x:Key="TimePickerThemeMinWidth">150</x:Double>
<Thickness x:Key="DatePickerTopHeaderMargin">0</Thickness>
<Thickness x:Key="DatePickerHostPadding">0</Thickness>
<Thickness x:Key="DatePickerHostMonthPadding">0</Thickness>
<Thickness x:Key="TimePickerTopHeaderMargin">0</Thickness>
<Thickness x:Key="TextControlBorderThemeThicknessFocused">1</Thickness>
<GridLength x:Key="SliderPreContentMargin">0</GridLength>
<CornerRadius x:Key="ControlCornerRadius">0</CornerRadius>
<CornerRadius x:Key="OverlayCornerRadius">0</CornerRadius>
<x:Double x:Key="ToolTipContentMaxWidth">800</x:Double>
<Thickness x:Key="ToolTipBorderThemePadding">3,3,3,3</Thickness>
<Thickness x:Key="ComboBoxItemThemePadding">3,3,3,3</Thickness>
<Thickness x:Key="ComboBoxDropdownContentMargin">0,0,0,0</Thickness>
<!-- Menu items -->
<Thickness x:Key="MenuFlyoutPresenterThemePadding">0</Thickness>
<Thickness x:Key="MenuFlyoutScrollerMargin">0</Thickness>
<Thickness x:Key="MenuIconPresenterMargin">0,0,10,0</Thickness>
<Thickness x:Key="MenuFlyoutSeparatorThemePadding">30,2,0,2</Thickness>
<Thickness x:Key="MenuInputGestureTextMargin">27,2,0,0</Thickness>
<x:Double x:Key="MenuFlyoutSubItemPopupHorizontalOffset">0</x:Double>
<x:Double x:Key="MenuFlyoutThemeMinHeight">0</x:Double>
<StreamGeometry x:Key="MenuItemChevronPathData">M0,0L4,3.5 0,7z</StreamGeometry>
</Styles.Resources>
<Style>
<Style.Resources>
<x:Double x:Key="ControlContentThemeFontSize">14</x:Double>
<x:Double x:Key="ContentControlFontSize">14</x:Double>
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double>
<Thickness x:Key="TextControlThemePadding">2,2,6,1</Thickness>
<x:Double x:Key="ListViewItemMinHeight">32</x:Double>
<x:Double x:Key="TreeViewItemMinHeight">24</x:Double>
<Thickness x:Key="TimePickerHostPadding">0,1,0,2</Thickness>
<Thickness x:Key="DatePickerHostPadding">0,1,0,2</Thickness>
<Thickness x:Key="DatePickerHostMonthPadding">9,0,0,1</Thickness>
<Thickness x:Key="ComboBoxEditableTextPadding">10,0,30,0</Thickness>
<x:Double x:Key="ComboBoxMinHeight">0</x:Double>
<Thickness x:Key="ComboBoxPadding">12,1,0,3</Thickness>
<x:Double x:Key="NavigationViewItemOnLeftMinHeight">32</x:Double>
</Style.Resources>
</Style>
<Style Selector="Window">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" />
<Setter Property="Icon" Value="/Assets/Icon.ico" />
<Setter Property="MinWidth" Value="200" />
<Setter Property="MinHeight" Value="55" />
</Style>
<Style Selector="ToolTip">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.075" />
</Transitions>
</Setter>
</Style>
<Style Selector="ComboBox">
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</Setter>
</Style>
<Style Selector="ItemsControl,ItemsPresenter">
<Setter Property="KeyboardNavigation.TabNavigation" Value="Continue" />
</Style>
<Style Selector="Menu#ActionMenu MenuItem MenuItem, ContextMenu#ActionMenu MenuItem">
<Setter Property="Header" Value="{Binding ActionName, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="Icon" Value="{Binding ActionIcon, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="IsVisible" Value="{Binding Visible, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="IsEnabled" Value="{Binding Enabled, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="Tag" Value="{Binding ShortcutText, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="ItemsSource" Value="{Binding SubActions, DataType={x:Type du:BaseMenuAction}}" />
<Setter Property="Command" Value="{Binding ClickCommand, DataType={x:Type du:BaseMenuAction}}" />
</Style>
<Style Selector="Button:pressed, RepeatButton:pressed, ToggleButton:pressed">
<Setter Property="RenderTransform" Value="scale(1)" />
</Style>
<Style Selector="Menu">
<Setter Property="Height" Value="25" />
<Setter Property="Background" Value="{DynamicResource MesenMenuBackground}" />
</Style>
<Style Selector="MenuItem">
<Setter Property="Height" Value="22" />
<Setter Property="Margin" Value="1" />
<Setter Property="Padding" Value="8 2" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="MenuItem[Header=-]">
<Setter Property="Height" Value="4" />
</Style>
<Style Selector="MenuItem > Separator, ContextMenu > Separator">
<Setter Property="Background" Value="{DynamicResource MesenMenuSeparatorBackground}" />
</Style>
<Style Selector="MenuItem > MenuItem">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="2 0" />
</Style>
<Style Selector="Menu > MenuItem:selected > Border">
<Setter Property="Background" Value="{DynamicResource MesenMenuBackgroundHighlight}" />
<Setter Property="BorderBrush" Value="{DynamicResource MesenMenuBorderHighlight}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="MenuItem > MenuItem:selected > Panel > Border">
<Setter Property="Background" Value="{DynamicResource MesenMenuBackgroundHighlight}" />
<Setter Property="BorderBrush" Value="{DynamicResource MesenMenuBorderHighlight}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="MenuItem > Panel > Border">
<Setter Property="CornerRadius" Value="0" />
</Style>
<Style Selector="ContextMenu > MenuItem">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="2 0" />
</Style>
<Style Selector="ContextMenu > MenuItem:selected > Panel > Border">
<Setter Property="Background" Value="{DynamicResource MesenMenuBackgroundHighlight}" />
<Setter Property="BorderBrush" Value="{DynamicResource MesenMenuBorderHighlight}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="Button, NumericUpDown RepeatButton">
<Setter Property="Height" Value="NaN" />
<Setter Property="Padding" Value="4 3" />
<Setter Property="Margin" Value="1" />
<Setter Property="MinWidth" Value="60" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style Selector="Button.ButtonWithIcon">
<Setter Property="Padding" Value="4 2" />
</Style>
<Style Selector="TimePicker Button">
<Setter Property="Height" Value="21" />
</Style>
<Style Selector="DatePicker, TimePicker, TextBox, NumericUpDown">
<Setter Property="FontSize" Value="{DynamicResource MesenFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource MesenFont}" />
</Style>
<Style Selector="TextBlock, AccessText">
<Setter Property="FontSize" Value="{DynamicResource MesenFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource MesenFont}" />
</Style>
<Style Selector="MenuItem AccessText">
<Setter Property="FontSize" Value="{DynamicResource MesenMenuFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource MesenMenuFont}" />
</Style>
<Style Selector="TextBox">
<Setter Property="MinWidth" Value="30" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="1" />
<Setter Property="Padding" Value="2 0" />
<Setter Property="MinHeight" Value="21" />
<Setter Property="Height" Value="21" />
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBrush}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
</Style>
<Style Selector="TextBox[AcceptsReturn=True]">
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="MinHeight" Value="44" />
<Setter Property="ScrollViewer.AllowAutoHide" Value="False" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
</Style>
<Style Selector="TextBox[AcceptsReturn=True] ScrollViewer ScrollContentPresenter">
<Setter Property="Margin" Value="2" />
</Style>
<Style Selector="ScrollBar">
<Setter Property="Cursor" Value="Arrow" />
</Style>
<Style Selector="ScrollContentPresenter ScrollBar">
<Setter Property="Cursor" Value="Arrow" />
</Style>
<Style Selector="ScrollViewer">
<Setter Property="AllowAutoHide" Value="False" />
</Style>
<Style Selector="ComboBox">
<Setter Property="Margin" Value="1" />
<Setter Property="Padding" Value="3 2" />
<Setter Property="MinHeight" Value="21" />
</Style>
<Style Selector="CheckBox">
<Setter Property="MinHeight" Value="20" />
<Setter Property="MinWidth" Value="20" />
<Setter Property="Padding" Value="2 0 0 0" />
</Style>
<Style Selector="CheckBox /template/ Grid">
<Setter Property="Height" Value="20" />
<Setter Property="MaxHeight" Value="20" />
</Style>
<Style Selector="CheckBox /template/ Grid > Grid">
<Setter Property="Height" Value="16" />
<Setter Property="MaxHeight" Value="20" />
</Style>
<Style Selector="CheckBox /template/ Border#NormalRectangle">
<Setter Property="MaxWidth" Value="14" />
<Setter Property="MaxHeight" Value="14" />
</Style>
<Style Selector="CheckBox /template/ Grid > Grid > Viewbox > Panel">
<Setter Property="Height" Value="14" />
<Setter Property="Width" Value="14" />
</Style>
<Style Selector="CheckBox:checked /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckGlyphForegroundChecked}" />
</Style>
<Style Selector="CheckBox:checked:pointerover /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPointerOver}" />
</Style>
<Style Selector="RadioButton /template/ Grid">
<Setter Property="Height" Value="20" />
<Setter Property="MaxHeight" Value="20" />
</Style>
<Style Selector="RadioButton /template/ Ellipse#OuterEllipse">
<Setter Property="MaxWidth" Value="14" />
<Setter Property="MaxHeight" Value="14" />
</Style>
<Style Selector="RadioButton /template/ Ellipse#CheckOuterEllipse">
<Setter Property="MaxWidth" Value="14" />
<Setter Property="MaxHeight" Value="14" />
</Style>
<Style Selector="RadioButton /template/ Ellipse#CheckGlyph">
<Setter Property="MaxWidth" Value="6" />
<Setter Property="MaxHeight" Value="6" />
</Style>
<Style Selector="NumericUpDown">
<Setter Property="FormatString" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="MinWidth" Value="50" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="MaxHeight" Value="21" />
<Setter Property="Margin" Value="1" />
<Setter Property="ClipValueToMinMax" Value="True" />
</Style>
<Style Selector="NumericUpDown RepeatButton">
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Height" Value="NaN" />
<Setter Property="Margin" Value="0" />
</Style>
<Style Selector="NumericUpDown TextBox /template/ Border#PART_BorderElement">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="Slider Thumb">
<Setter Property="MaxWidth" Value="15" />
<Setter Property="MaxHeight" Value="15" />
</Style>
<Style Selector="ButtonSpinner">
<Setter Property="MinHeight" Value="21" />
</Style>
<Style Selector="ButtonSpinner RepeatButton Path">
<Setter Property="MaxWidth" Value="10" />
<Setter Property="MaxHeight" Value="5" />
<Setter Property="Margin" Value="0 2 0 0" />
</Style>
<Style Selector="ButtonSpinner RepeatButton.ButtonSpinnerRepeatButton">
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
<Setter Property="MinWidth" Value="19" />
<Setter Property="MaxWidth" Value="20" />
</Style>
<Style Selector="TabControl">
<Setter Property="Padding" Value="3 0" />
</Style>
<Style Selector="TabItem, TabStripItem">
<Setter Property="MinHeight" Value="30" />
</Style>
<Style Selector="TimePicker Button, DatePicker Button">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
<Style Selector="TimePickerPresenter Button Path, DatePickerPresenter Button Path">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style Selector="DatePicker /template/ TextBlock, TimePicker /template/ TextBlock">
<Setter Property="Margin" Value="10 0" />
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style Selector="StackPanel > TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="Grid > TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="Grid > ComboBox">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="ScrollBar">
<Setter Property="AllowAutoHide" Value="False" />
</Style>
<Style Selector="StackPanel.Toolbar Line">
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="Stroke" Value="#BBB" />
<Setter Property="StartPoint" Value="0.5,0" />
<Setter Property="EndPoint" Value="0.5,20" />
<Setter Property="Margin" Value="2 3 3 3" />
</Style>
<Style Selector="StackPanel.Toolbar Button">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="23" />
<Setter Property="MinWidth" Value="22" />
<Setter Property="Padding" Value="0" />
<Setter Property="ToolTip.ShowDelay" Value="200" />
</Style>
<Style Selector="StackPanel.Toolbar Image">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
</Style>
<!-- Used by configuration dialogs -->
<Style Selector="TabControl[TabStripPlacement=Left]">
<Setter Property="Template">
<ControlTemplate>
<Border
Margin="{TemplateBinding Margin}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
>
<DockPanel>
<ScrollViewer
Name="PART_ScrollViewer"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
Background="{TemplateBinding Background}"
DockPanel.Dock="Left"
>
<ItemsPresenter
Name="PART_ItemsPresenter"
ItemsPanel="{TemplateBinding ItemsPanel}"/>
</ScrollViewer>
<Rectangle
DockPanel.Dock="{TemplateBinding TabStripPlacement}"
Fill="{DynamicResource MesenGrayBorderColor}"
Width="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
/>
<ContentPresenter
Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectedContent}"
ContentTemplate="{TemplateBinding SelectedContentTemplate}">
</ContentPresenter>
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
</Style>
<StyleInclude Source="/Styles/DataBoxStyles.xaml" />
<StyleInclude Source="/Styles/AvaloniaEditStyles.xaml" />
<!-- Make dock title and tabs smaller -->
<Style Selector="DockControl ToolTabStripItem">
<Setter Property="MinHeight" Value="0" />
</Style>
<Style Selector="DockControl ToolTabStripItem ContentPresenter#PART_ContentPresenter">
<Setter Property="Padding" Value="4 0 4 0" />
</Style>
<Style Selector="DockControl ToolTabStripItem StackPanel#DragTool">
<Setter Property="Margin" Value="-2 -2 -2 -2" />
</Style>
<Style Selector="ToolChromeControl Grid#PART_Grip TextBlock#PART_Title">
<Setter Property="Margin" Value="0 2 8 2" />
</Style>
<Style Selector="ToolChromeControl > Grid > Border Button">
<Setter Property="Height" Value="16" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="Margin" Value="0 0 -5 0" />
</Style>
<Style Selector="ToolChromeControl > Grid > Border Button Path">
<Setter Property="Fill" Value="{DynamicResource ThemeForegroundBrush}" />
</Style>
<Style Selector="TabControl[TabStripPlacement=Left] TabControl[TabStripPlacement=Top]">
<Setter Property="Template">
<ControlTemplate>
<Border Margin="{TemplateBinding Margin}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<DockPanel>
<Panel Background="#10888888" DockPanel.Dock="{TemplateBinding TabStripPlacement}">
<ItemsPresenter Name="PART_ItemsPresenter"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</Panel>
<Rectangle
DockPanel.Dock="{TemplateBinding TabStripPlacement}"
Fill="LightGray"
Height="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="0 0 0 3"
/>
<!--<ScrollViewer HorizontalScrollBarVisibility="Auto">-->
<ContentPresenter Name="PART_SelectedContentHost"
Margin="3 0 0 0"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectedContent}"
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
<!--</ScrollViewer>-->
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
</Style>
</Styles>