first commit
This commit is contained in:
183
Nitrox.Launcher/Models/Styles/Nitrox.axaml
Normal file
183
Nitrox.Launcher/Models/Styles/Nitrox.axaml
Normal file
@@ -0,0 +1,183 @@
|
||||
<Styles
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Nitrox.Launcher.Models.Controls"
|
||||
xmlns:converters="clr-namespace:Nitrox.Launcher.Models.Converters">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="Cornflowerblue">
|
||||
<StackPanel Margin="10" Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<ContentControl Padding="10" Background="#FFFFFF">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10">
|
||||
<TextBlock>Light</TextBlock>
|
||||
<TextBox Watermark="Enter something here.." />
|
||||
</StackPanel>
|
||||
</ContentControl>
|
||||
</ThemeVariantScope>
|
||||
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<ContentControl Padding="10" Background="#000000">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10">
|
||||
<TextBlock>Dark</TextBlock>
|
||||
<TextBox Watermark="Enter something here.." />
|
||||
</StackPanel>
|
||||
</ContentControl>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="Window">
|
||||
<Setter Property="Icon" Value="/Assets/Images/nitrox-icon.ico" />
|
||||
<Setter Property="Focusable" Value="True" />
|
||||
<Setter Property="WindowStartupLocation" Value="CenterOwner" />
|
||||
<Setter Property="FontFamily" Value="/Assets/Fonts/Inter-Black.ttf" />
|
||||
<!-- Disables window border but allow resizing -->
|
||||
<Setter Property="Background" Value="{DynamicResource BrandWhite}" />
|
||||
<Setter Property="SystemDecorations">
|
||||
<Setter.Value>
|
||||
<OnPlatform>
|
||||
<OnPlatform.Default>
|
||||
<SystemDecorations>None</SystemDecorations>
|
||||
</OnPlatform.Default>
|
||||
<On Options="Windows">
|
||||
<SystemDecorations>Full</SystemDecorations>
|
||||
</On>
|
||||
</OnPlatform>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
|
||||
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="-99" />
|
||||
<Setter Property="Padding" Value="{Binding $self.OffScreenMargin}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Border">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BrandBorderBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="SelectableTextBlock">
|
||||
<!-- Background should be transparent so text and be selected anywhere inside of control. -->
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="controls|CustomTitlebar">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandWhite}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Svg.theme">
|
||||
<Setter Property="Css" Value="{DynamicResource BrandSvgStyle}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector=":is(Border).footer">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandControlBackground}" />
|
||||
<Setter Property="Padding" Value="24 20" />
|
||||
<Setter Property="BorderThickness" Value="0 2 0 0" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BrandWhite}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector=":is(Control)">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter">
|
||||
<Setter Property="Opacity" Value="{TemplateBinding Opacity}" />
|
||||
</Style>
|
||||
|
||||
<!-- TODO: a good-looking focus overlay, compatible with all controls -->
|
||||
<Setter Property="FocusAdorner">
|
||||
<Setter.Value>
|
||||
<FocusAdornerTemplate>
|
||||
<Border
|
||||
Name="FocusBorder"
|
||||
BorderBrush="{DynamicResource BrandFocusBorder}"
|
||||
BorderThickness="2" />
|
||||
</FocusAdornerTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity" Value=".85" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector=".form">
|
||||
<Style Selector="^ > :is(Layoutable):not(:nth-last-child(1))">
|
||||
<Setter Property="Margin" Value="0 0 0 26" />
|
||||
</Style>
|
||||
<Style Selector="^ StackPanel.form > TextBlock:nth-child(1)">
|
||||
<Setter Property="FontSize" Value="10" />
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
<Setter Property="Margin" Value="0 0 0 11" />
|
||||
</Style>
|
||||
<Style Selector="^ StackPanel.form > TextBlock:nth-child(2)">
|
||||
<Setter Property="FontSize" Value="10" />
|
||||
<Setter Property="FontWeight" Value="500" />
|
||||
<Setter Property="Margin" Value="0 -11 0 11" />
|
||||
<Setter Property="IsVisible" Value="{Binding !$self.Text, Converter={converters:EqualityConverter}}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Image.header">
|
||||
<Setter Property="Width" Value="108" />
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
</Style>
|
||||
|
||||
<Style Selector=":is(ContentControl).content">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandWhite}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
|
||||
<Style Selector=":is(Layoutable).viewPadding">
|
||||
<Setter Property="Margin" Value="34 45" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Border.serverEntry">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandPanelBackground}" />
|
||||
<Setter Property="CornerRadius" Value="12" />
|
||||
<Setter Property="Padding" Value="22 20" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Height" Value="96" />
|
||||
|
||||
<Style Selector="^ StackPanel.description">
|
||||
<Style Selector="^ > :is(Control)">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="6 0" />
|
||||
</Style>
|
||||
<Style Selector="^ > :is(Control):nth-child(1)">
|
||||
<Setter Property="Margin" Value="0 0 6 0" />
|
||||
</Style>
|
||||
<Style Selector="^ > :is(Control):nth-last-child(1)">
|
||||
<Setter Property="Margin" Value="6 0 0 0" />
|
||||
</Style>
|
||||
<Style Selector="^ Ellipse">
|
||||
<Setter Property="Height" Value="6" />
|
||||
<Setter Property="Width" Value="6" />
|
||||
</Style>
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="Opacity" Value="0.5" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<StyleInclude Source="/Models/Styles/Theme/ValidationErrorsStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/TextBoxStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/TextBlockStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/ToolTipStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/ButtonStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/ComboBoxStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/CheckBoxStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/RadioButtonGroupStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/RadioButtonStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/ScrollViewerStyle.axaml" />
|
||||
<StyleInclude Source="/Models/Styles/Theme/ExpanderStyle.axaml" />
|
||||
</Styles>
|
51
Nitrox.Launcher/Models/Styles/Palette/Nitrox.axaml
Normal file
51
Nitrox.Launcher/Models/Styles/Palette/Nitrox.axaml
Normal file
@@ -0,0 +1,51 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<!-- Default/Light theme -->
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<!-- Main colors -->
|
||||
<Color x:Key="BrandPrimary">#007BFF</Color>
|
||||
<Color x:Key="BrandWhite">#FFFFFF</Color>
|
||||
<Color x:Key="BrandBlack">#000000</Color>
|
||||
<Color x:Key="BrandBorder">#D1D1D1</Color>
|
||||
<Color x:Key="BrandControlBackground">#ECECEC</Color>
|
||||
<Color x:Key="BrandCheckboxBackground">#D9D9D9</Color>
|
||||
<Color x:Key="BrandPanelBackground">#EAEAE9</Color>
|
||||
<Color x:Key="BrandBorderBackground">#b8b8b8</Color>
|
||||
<Color x:Key="BrandCaret">#000000</Color>
|
||||
<Color x:Key="BrandFocusBorder">#40000000</Color>
|
||||
<Color x:Key="BrandSubText">#7F000000</Color>
|
||||
<Color x:Key="BrandScrollThumb">#CCCCCC</Color>
|
||||
<Color x:Key="BrandScrollThumbPointerOver">#8F8F8F</Color>
|
||||
<Color x:Key="BrandScrollThumbPressed">#3F3F3F</Color>
|
||||
<Color x:Key="BrandOnColor">#38C149</Color>
|
||||
<Color x:Key="BrandOffColor">#FF5E57</Color>
|
||||
|
||||
<!-- Notification colors -->
|
||||
<Color x:Key="BrandAbort">#FF005C</Color>
|
||||
<Color x:Key="BrandAbortBackground">#FFB3B3</Color>
|
||||
<Color x:Key="BrandError">#E60914</Color>
|
||||
<Color x:Key="BrandSuccess">#11AD45</Color>
|
||||
<Color x:Key="BrandInformation">#007BFF</Color>
|
||||
<Color x:Key="BrandWarning">#F5A300</Color>
|
||||
|
||||
<!-- Misc -->
|
||||
<x:String x:Key="BrandSvgStyle">* { fill: #000; stroke: #000; }</x:String>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Color x:Key="BrandWhite">#000000</Color>
|
||||
<Color x:Key="BrandBlack">#FFFFFF</Color>
|
||||
<Color x:Key="BrandBorder">#323232</Color>
|
||||
<Color x:Key="BrandControlBackground">#1D1D1D</Color>
|
||||
<Color x:Key="BrandCheckboxBackground">#333333</Color>
|
||||
<Color x:Key="BrandPanelBackground">#151516</Color>
|
||||
<Color x:Key="BrandBorderBackground">#474747</Color>
|
||||
<Color x:Key="BrandCaret">#FFFFFF</Color>
|
||||
<Color x:Key="BrandFocusBorder">#40FFFFFF</Color>
|
||||
<Color x:Key="BrandSubText">#7FFFFFFF</Color>
|
||||
<Color x:Key="BrandScrollThumb">#262626</Color>
|
||||
<Color x:Key="BrandScrollThumbPointerOver">#3F3F3F</Color>
|
||||
<Color x:Key="BrandScrollThumbPressed">#8F8F8F</Color>
|
||||
<x:String x:Key="BrandSvgStyle">* { fill: #fff; stroke: #fff; }</x:String>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
191
Nitrox.Launcher/Models/Styles/Theme/ButtonStyle.axaml
Normal file
191
Nitrox.Launcher/Models/Styles/Theme/ButtonStyle.axaml
Normal file
@@ -0,0 +1,191 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue" Width="250">
|
||||
<StackPanel Margin="10" Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<Button Content="Normal button" HorizontalAlignment="Stretch" />
|
||||
<Button
|
||||
Classes="primary"
|
||||
Content="Primary button"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</StackPanel>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<Button Content="Normal button" HorizontalAlignment="Stretch" />
|
||||
<Button
|
||||
Classes="primary"
|
||||
Content="Primary button"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<Button
|
||||
Classes="abort"
|
||||
Content="Abort button"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<Button
|
||||
Classes="primary big"
|
||||
Content="Primary text"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<Button Classes="primary big" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Primary Button Big" />
|
||||
<TextBlock Text="Some sub text" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ThemeVariantScope>
|
||||
<StackPanel HorizontalAlignment="Center" Spacing="5">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Button
|
||||
Background="White"
|
||||
Classes="icon"
|
||||
HorizontalAlignment="Center">
|
||||
<StackPanel>
|
||||
<Image Source="/Assets/Images/world-manager/cog.png" />
|
||||
<TextBlock Text="Icon button" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Button
|
||||
Background="Black"
|
||||
Classes="icon"
|
||||
HorizontalAlignment="Center">
|
||||
<StackPanel>
|
||||
<Image Source="/Assets/Images/world-manager/cog.png" />
|
||||
<TextBlock Text="Icon button" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandBorderBackground}" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
<Setter Property="Padding" Value="16 8.73" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition Duration="0:0:0.075" Property="Opacity" />
|
||||
<BrushTransition Duration="0:0:0.075" Property="Background" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value="0.7" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ TextBlock:nth-child(1)">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ StackPanel">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
|
||||
<!-- TODO: Pretty animations -->
|
||||
<Style Selector="^.busy">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
<Style.Animations>
|
||||
<Animation
|
||||
Duration="0:0:.75"
|
||||
Easing="SineEaseInOut"
|
||||
IterationCount="INFINITE"
|
||||
PlaybackDirection="Alternate">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="Opacity" Value="0.3" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.primary">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandPrimary}" />
|
||||
<Setter Property="Foreground" Value="#ffffff" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.abort">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandAbort}" />
|
||||
<Setter Property="Foreground" Value="#ffffff" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.big">
|
||||
<Setter Property="CornerRadius" Value="8" />
|
||||
<Setter Property="Padding" Value="10" />
|
||||
<Setter Property="MinHeight" Value="62" />
|
||||
<Style Selector="^ StackPanel">
|
||||
<Setter Property="Orientation" Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^ ContentPresenter /template/ TextBlock">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
</Style>
|
||||
<Style Selector="^ TextBlock:not(:nth-child(1))">
|
||||
<Setter Property="FontSize" Value="10" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.anycontent">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.icon">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
|
||||
<Style Selector="^ StackPanel">
|
||||
<Setter Property="Spacing" Value="10" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ Image">
|
||||
<Setter Property="Width" Value="18" />
|
||||
<Setter Property="Height" Value="18" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
<Setter Property="TextBlock.TextDecorations" Value="Underline" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Override button template to use properties from parent Button. DO NOT HARD CODE VALUES HERE. -->
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Opacity" Value="{Binding $parent[Button].Opacity}" />
|
||||
<Setter Property="TextBlock.Foreground" Value="{Binding $parent[Button].Foreground}" />
|
||||
<Setter Property="Background" Value="{Binding $parent[Button].Background}" />
|
||||
<Setter Property="CornerRadius" Value="{Binding $parent[Button].CornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Opacity" Value="{Binding $parent[Button].Opacity}" />
|
||||
<Setter Property="TextBlock.Foreground" Value="{Binding $parent[Button].Foreground}" />
|
||||
<Setter Property="Background" Value="{Binding $parent[Button].Background}" />
|
||||
<Setter Property="Cursor" Value="{Binding $parent[Button].Cursor}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity" Value="0.25" />
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="TextBlock.Foreground" Value="{Binding $parent[Button].Foreground}" />
|
||||
<Setter Property="Background" Value="{Binding $parent[Button].Background}" />
|
||||
<Setter Property="Cursor" Value="{Binding $parent[Button].Cursor}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</Styles>
|
148
Nitrox.Launcher/Models/Styles/Theme/CheckBoxStyle.axaml
Normal file
148
Nitrox.Launcher/Models/Styles/Theme/CheckBoxStyle.axaml
Normal file
@@ -0,0 +1,148 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel Margin="10" Spacing="15">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="5">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="White" Padding="5">
|
||||
<CheckBox>Light</CheckBox>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="Black" Padding="5">
|
||||
<CheckBox Foreground="White" IsChecked="True">Dark</CheckBox>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="5">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<StackPanel Background="White" Spacing="5">
|
||||
<Border>
|
||||
<CheckBox Classes="switch" />
|
||||
</Border>
|
||||
<Border>
|
||||
<CheckBox Classes="switch" IsChecked="True" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<StackPanel Background="Black" Spacing="5">
|
||||
<Border>
|
||||
<CheckBox Classes="switch" />
|
||||
</Border>
|
||||
<Border>
|
||||
<CheckBox Classes="switch" IsChecked="True" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="CheckBox.switch">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandCheckboxBackground}" />
|
||||
<Setter Property="CornerRadius" Value="15" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Width" Value="54" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Duration="0:0:.075" Property="RenderTransform" />
|
||||
<DoubleTransition Duration="0:0:0.15" Property="Opacity" />
|
||||
<ThicknessTransition Duration="0:0:0.1" Property="Margin" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid x:Name="RootGrid">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="4"
|
||||
x:Name="PART_Border">
|
||||
<Viewbox HorizontalAlignment="Left" x:Name="SlidingIconViewbox">
|
||||
<Border
|
||||
Background="{TemplateBinding Foreground}"
|
||||
CornerRadius="15"
|
||||
Height="24"
|
||||
Width="24"
|
||||
x:Name="SlidingIcon">
|
||||
<Border.Styles>
|
||||
<Style Selector="Border">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Duration="0:0:.075" Property="RenderTransform" />
|
||||
<ThicknessTransition Duration="0:0:0.1" Property="Margin" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Border.Styles>
|
||||
</Border>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Unchecked PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Opacity" Value=".75" />
|
||||
|
||||
<Style Selector="^ /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Unchecked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.95)" />
|
||||
|
||||
<Style Selector="^ /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Disabled State -->
|
||||
<Style Selector="^:disabled /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:checked">
|
||||
<!-- Checked Normal State -->
|
||||
<Setter Property="Background" Value="{DynamicResource BrandCheckboxBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandControlBackground}" />
|
||||
|
||||
<Style Selector="^ /template/ Border#SlidingIcon">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandPrimary}" />
|
||||
<Setter Property="Margin" Value="22 0 0 0" />
|
||||
</Style>
|
||||
|
||||
<!-- Checked PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Opacity" Value=".75" />
|
||||
|
||||
<Style Selector="^ /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Checked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.95)" />
|
||||
|
||||
<Style Selector="^ /template/ Border#PART_Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</Styles>
|
186
Nitrox.Launcher/Models/Styles/Theme/ComboBoxStyle.axaml
Normal file
186
Nitrox.Launcher/Models/Styles/Theme/ComboBoxStyle.axaml
Normal file
@@ -0,0 +1,186 @@
|
||||
<Styles
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:design="clr-namespace:Nitrox.Launcher.Models.Design"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel
|
||||
Margin="10"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<StackPanel Spacing="10">
|
||||
<Border
|
||||
Background="White"
|
||||
HorizontalAlignment="Center"
|
||||
Padding="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Margin="0,0,0,110">
|
||||
<ComboBox
|
||||
HorizontalAlignment="Stretch"
|
||||
PlaceholderText="Light"
|
||||
Width="200">
|
||||
<ComboBoxItem Content="Item 1" />
|
||||
<ComboBoxItem Content="Item 2" />
|
||||
<ComboBoxItem Content="Item 3" />
|
||||
</ComboBox>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</Border>
|
||||
<Border
|
||||
Background="Black"
|
||||
HorizontalAlignment="Center"
|
||||
Padding="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Margin="0,0,0,110">
|
||||
<ComboBox
|
||||
HorizontalAlignment="Stretch"
|
||||
PlaceholderText="Dark"
|
||||
Width="200">
|
||||
<ComboBoxItem Content="Item 1" />
|
||||
<ComboBoxItem Content="Item 2" />
|
||||
<ComboBoxItem Content="Item 3" />
|
||||
</ComboBox>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="14" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.IsScrollInertiaEnabled" Value="true" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="CornerRadius" Value="8" />
|
||||
<Setter Property="MinWidth" Value="100" />
|
||||
<Setter Property="MinHeight" Value="30" />
|
||||
<Setter Property="Background" Value="{DynamicResource BrandControlBackground}" />
|
||||
<Style Selector="^ /template/ ContentPresenter">
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
</Style>
|
||||
<Style Selector="^ TextBlock#PlaceholderTextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandSubText}" />
|
||||
</Style>
|
||||
<Style Selector="^ PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Border#Background">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Background" Value="{DynamicResource BrandControlBackground}" />
|
||||
</Style>
|
||||
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Duration="0:0:.075" Property="RenderTransform" />
|
||||
<DoubleTransition Duration="0:0:0.15" Property="Opacity" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DataValidationErrors>
|
||||
<Grid>
|
||||
<Grid ColumnDefinitions="*,32" IsHitTestVisible="True">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Grid.ColumnSpan="2"
|
||||
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
|
||||
x:Name="Background" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,
|
||||
Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="PlaceholderTextBlock" />
|
||||
<ContentControl
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding ItemTemplate}"
|
||||
Grid.Column="0"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="ContentPresenter" />
|
||||
<Border
|
||||
Background="Transparent"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
IsVisible="False"
|
||||
Margin="0,1,1,1"
|
||||
Width="30"
|
||||
x:Name="DropDownOverlay" />
|
||||
<PathIcon
|
||||
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Grid.Column="1"
|
||||
Height="12"
|
||||
HorizontalAlignment="Right"
|
||||
IsHitTestVisible="False"
|
||||
Margin="0,0,10,0"
|
||||
UseLayoutRounding="False"
|
||||
VerticalAlignment="Center"
|
||||
Width="12"
|
||||
x:Name="DropDownGlyph" />
|
||||
</Grid>
|
||||
|
||||
<Popup
|
||||
Grid.Column="0"
|
||||
InheritsTransform="True"
|
||||
IsLightDismissEnabled="True"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen,
|
||||
Mode=TwoWay}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Name="PART_Popup"
|
||||
PlacementTarget="Background"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{DynamicResource BrandWhite}"
|
||||
BorderThickness="1,0,2,2"
|
||||
CornerRadius="{DynamicResource OverlayCornerRadius}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Padding="{DynamicResource ComboBoxDropdownBorderPadding}"
|
||||
x:Name="PopupBorder">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
<ItemsPresenter
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
|
||||
Name="PART_ItemsPresenter" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
|
||||
</Grid>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".75" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Styles>
|
152
Nitrox.Launcher/Models/Styles/Theme/ExpanderStyle.axaml
Normal file
152
Nitrox.Launcher/Models/Styles/Theme/ExpanderStyle.axaml
Normal file
@@ -0,0 +1,152 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel Margin="10" Spacing="20">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="White" Padding="10">
|
||||
<StackPanel Spacing="10">
|
||||
<Expander
|
||||
ExpandDirection="Up"
|
||||
Header="Expand Up"
|
||||
HorizontalAlignment="Center">
|
||||
<StackPanel>
|
||||
<TextBlock>Expanded content</TextBlock>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander
|
||||
Classes="changelog"
|
||||
Header="Changelog Expander"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock>Expanded content</TextBlock>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="Black" Padding="10">
|
||||
<StackPanel Spacing="10">
|
||||
<Expander
|
||||
ExpandDirection="Up"
|
||||
Header="Expand Up"
|
||||
HorizontalAlignment="Center">
|
||||
<StackPanel>
|
||||
<TextBlock>Expanded content</TextBlock>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander
|
||||
Classes="changelog"
|
||||
Header="Changelog Expander"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock>Expanded content</TextBlock>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<!-- TODO: Create a clean Nitrox Expander+ToggleButton style -->
|
||||
|
||||
<Style Selector="ToggleButton.changelog">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" />
|
||||
<Path
|
||||
Data="M0.530273 1.46973L5.53027 6.46973M4.46961 6.46973L9.46961 1.46973"
|
||||
HorizontalAlignment="Center"
|
||||
RenderTransformOrigin="50%,50%"
|
||||
Stretch="None"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="1.5"
|
||||
VerticalAlignment="Center">
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform />
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Style Selector="^ /template/ TextBlock">
|
||||
<Setter Property="Background" Value="{Binding $parent[ToggleButton].Background}" />
|
||||
<Setter Property="TextDecorations" Value="Underline" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Arrow Animation -->
|
||||
<Style Selector="^[Tag=expanded] /template/ Path">
|
||||
<Style.Animations>
|
||||
<Animation Duration="0:0:0.0625" FillMode="Both">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="0" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="180" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^[Tag=collapsed] /template/ Path">
|
||||
<Style.Animations>
|
||||
<Animation Duration="0:0:0.0625" FillMode="Both">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="180" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="0" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Expander.changelog">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
Background="{TemplateBinding Background}"
|
||||
Classes="changelog"
|
||||
Content="{TemplateBinding Header}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsChecked="{TemplateBinding IsExpanded,
|
||||
Mode=TwoWay}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}" />
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{TemplateBinding IsExpanded,
|
||||
Mode=TwoWay}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Stretch">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:expanded /template/ ToggleButton">
|
||||
<Setter Property="Tag" Value="expanded" />
|
||||
</Style>
|
||||
<Style Selector="^:not(:expanded) /template/ ToggleButton">
|
||||
<Setter Property="Tag" Value="collapsed" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Styles>
|
@@ -0,0 +1,83 @@
|
||||
<Styles
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:controls="clr-namespace:Nitrox.Launcher.Models.Controls"
|
||||
xmlns:converters="clr-namespace:Nitrox.Launcher.Models.Converters"
|
||||
xmlns:design="clr-namespace:Nitrox.Launcher.Models.Design"
|
||||
xmlns:server="clr-namespace:NitroxModel.Server;assembly=NitroxModel"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="Cornflowerblue">
|
||||
<StackPanel Margin="10" Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="#000000" Padding="10">
|
||||
<controls:RadioButtonGroup Classes="radioGroup" Enum="{x:Type server:NitroxGameMode}" />
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="#FFFFFF" Padding="10">
|
||||
<controls:RadioButtonGroup Classes="radioGroup" Enum="{x:Type server:NitroxGameMode}" />
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<!-- Base style without palette -->
|
||||
<Style Selector="ItemsControl.radioGroup">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandWhite}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Button
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource BrandBorder}"
|
||||
BorderThickness="2"
|
||||
Command="{Binding $parent[controls:RadioButtonGroup].ItemClickCommand}"
|
||||
CommandParameter="{Binding $self}"
|
||||
CornerRadius="8"
|
||||
Name="ItemContainer"
|
||||
Padding="14,16"
|
||||
Tag="{Binding}">
|
||||
<design:NitroxAttached.Selected>
|
||||
<MultiBinding Converter="{converters:EqualityConverter}">
|
||||
<Binding />
|
||||
<Binding Path="$parent[controls:RadioButtonGroup].SelectedItem" />
|
||||
</MultiBinding>
|
||||
</design:NitroxAttached.Selected>
|
||||
<TextBlock Name="Text" Text="{Binding Converter={converters:ToStringConverter}}" />
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ItemsControl.radioGroup Button#ItemContainer:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{Binding $parent[Button].BorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="ItemsControl.radioGroup Button#ItemContainer">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<BrushTransition Duration="0:0:0.15" Property="BorderBrush" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ItemsControl.radioGroup:disabled">
|
||||
<Setter Property="Background" Value="{Binding $parent[Button].Background}" />
|
||||
<Style Selector="^ Button#ItemContainer /template/ ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{Binding $parent[Button].BorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Events -->
|
||||
<Style Selector="ItemsControl.radioGroup Button#ItemContainer:pointerover">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BrandPrimary}" />
|
||||
</Style>
|
||||
<Style Selector="ItemsControl.radioGroup Button#ItemContainer[(design|NitroxAttached.Selected)=true]">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BrandPrimary}" />
|
||||
</Style>
|
||||
</Styles>
|
221
Nitrox.Launcher/Models/Styles/Theme/RadioButtonStyle.axaml
Normal file
221
Nitrox.Launcher/Models/Styles/Theme/RadioButtonStyle.axaml
Normal file
@@ -0,0 +1,221 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel Margin="10" Spacing="15">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="5">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="White" Padding="5">
|
||||
<StackPanel Spacing="10">
|
||||
<RadioButton Content="Option 1" IsChecked="True" />
|
||||
<RadioButton Content="Option 2" />
|
||||
<RadioButton Content="Option 3" />
|
||||
<RadioButton Content="Option 4" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="Black" Padding="5">
|
||||
<StackPanel Spacing="10">
|
||||
<RadioButton Content="Option 1" />
|
||||
<RadioButton Content="Option 2" IsChecked="True" />
|
||||
<RadioButton Content="Option 3" />
|
||||
<RadioButton Content="Option 4" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="Padding" Value="8,0,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Duration="0:0:.075" Property="RenderTransform" />
|
||||
<DoubleTransition Duration="0:0:0.15" Property="Opacity" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Name="RootBorder">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Grid Height="32" VerticalAlignment="Top">
|
||||
<Ellipse
|
||||
Fill="White"
|
||||
Height="20"
|
||||
Name="OuterEllipse"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}"
|
||||
UseLayoutRounding="False"
|
||||
Width="20" />
|
||||
<Ellipse
|
||||
Fill="{DynamicResource RadioButtonOuterEllipseCheckedFill}"
|
||||
Height="20"
|
||||
Name="CheckOuterEllipse"
|
||||
Opacity="0"
|
||||
Stroke="{DynamicResource RadioButtonOuterEllipseCheckedStroke}"
|
||||
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}"
|
||||
UseLayoutRounding="False"
|
||||
Width="20" />
|
||||
<Ellipse
|
||||
Fill="{DynamicResource RadioButtonCheckGlyphFill}"
|
||||
Height="8"
|
||||
Name="CheckGlyph"
|
||||
Opacity="0"
|
||||
Stroke="{DynamicResource RadioButtonCheckGlyphStroke}"
|
||||
UseLayoutRounding="False"
|
||||
Width="8" />
|
||||
</Grid>
|
||||
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Name="PART_ContentPresenter"
|
||||
RecognizesAccessKey="True"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
||||
<!-- PointerOver State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".75" />
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||
<Setter Property="Stroke" Value="{Binding $parent[RadioButton].Foreground}" />
|
||||
<Setter Property="Fill" Value="White" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckOuterEllipse">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFill}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStroke}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
|
||||
<!-- Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPressed}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPressed}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||
<Setter Property="Stroke" Value="{Binding $parent[RadioButton].Foreground}" />
|
||||
<Setter Property="Fill" Value="White" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckOuterEllipse">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePressed}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPressed}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokePressed}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillPressed}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
|
||||
<!-- Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{Binding $parent[RadioButton].Foreground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Setter Property="Background" Value="{Binding $parent[RadioButton].Background}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||
<Setter Property="Stroke" Value="{Binding $parent[RadioButton].Foreground}" />
|
||||
<Setter Property="Fill" Value="White" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckOuterEllipse">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFill}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStroke}" />
|
||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFill}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:unchecked">
|
||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckOuterEllipse">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
|
||||
<!-- Checked State -->
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Ellipse#CheckOuterEllipse">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
</Style>
|
||||
</Styles>
|
301
Nitrox.Launcher/Models/Styles/Theme/ScrollViewerStyle.axaml
Normal file
301
Nitrox.Launcher/Models/Styles/Theme/ScrollViewerStyle.axaml
Normal file
@@ -0,0 +1,301 @@
|
||||
<Styles
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:behaviors="clr-namespace:Nitrox.Launcher.Models.Behaviors"
|
||||
xmlns:design="clr-namespace:Nitrox.Launcher.Models.Design"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel Margin="10" Spacing="20">
|
||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="White" Padding="10,10,0,10">
|
||||
<ScrollViewer Height="200" Width="200">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Foreground="Black">Item 1</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 2</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 3</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 4</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 5</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 6</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 7</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 8</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 9</TextBlock>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="Black" Padding="10,10,0,10">
|
||||
<ScrollViewer Height="200" Width="200">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock>Item 1</TextBlock>
|
||||
<TextBlock>Item 2</TextBlock>
|
||||
<TextBlock>Item 3</TextBlock>
|
||||
<TextBlock>Item 4</TextBlock>
|
||||
<TextBlock>Item 5</TextBlock>
|
||||
<TextBlock>Item 6</TextBlock>
|
||||
<TextBlock>Item 7</TextBlock>
|
||||
<TextBlock>Item 8</TextBlock>
|
||||
<TextBlock>Item 9</TextBlock>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border Background="White" Padding="10,10,10,0">
|
||||
<ScrollViewer
|
||||
HorizontalAlignment="Left"
|
||||
HorizontalContentAlignment="Left"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
Width="410">
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<TextBlock Foreground="Black">Item 1</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 2</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 3</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 4</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 5</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 6</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 7</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 8</TextBlock>
|
||||
<TextBlock Foreground="Black">Item 9</TextBlock>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border Background="Black" Padding="10,10,10,0">
|
||||
<ScrollViewer
|
||||
HorizontalAlignment="Left"
|
||||
HorizontalContentAlignment="Left"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
Width="410">
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<TextBlock>Item 1</TextBlock>
|
||||
<TextBlock>Item 2</TextBlock>
|
||||
<TextBlock>Item 3</TextBlock>
|
||||
<TextBlock>Item 4</TextBlock>
|
||||
<TextBlock>Item 5</TextBlock>
|
||||
<TextBlock>Item 6</TextBlock>
|
||||
<TextBlock>Item 7</TextBlock>
|
||||
<TextBlock>Item 8</TextBlock>
|
||||
<TextBlock>Item 9</TextBlock>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="ScrollViewer">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="AllowAutoHide" Value="False" />
|
||||
<Setter Property="behaviors:SmoothScrollBehavior.SmoothScroll" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid ColumnDefinitions="*,Auto" RowDefinitions="*,Auto">
|
||||
<ScrollContentPresenter
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
|
||||
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
|
||||
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
|
||||
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
|
||||
<ScrollContentPresenter.GestureRecognizers>
|
||||
<ScrollGestureRecognizer
|
||||
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
|
||||
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
|
||||
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
|
||||
</ScrollContentPresenter.GestureRecognizers>
|
||||
</ScrollContentPresenter>
|
||||
<ScrollBar
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Name="PART_HorizontalScrollBar"
|
||||
Orientation="Horizontal" />
|
||||
<ScrollBar
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Margin="5,0,0,0"
|
||||
Name="PART_VerticalScrollBar"
|
||||
Orientation="Vertical" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.main">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid>
|
||||
<ScrollContentPresenter
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
|
||||
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
|
||||
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
|
||||
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
|
||||
<ScrollContentPresenter.GestureRecognizers>
|
||||
<ScrollGestureRecognizer
|
||||
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
|
||||
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
|
||||
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
|
||||
</ScrollContentPresenter.GestureRecognizers>
|
||||
</ScrollContentPresenter>
|
||||
<ScrollBar
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,6"
|
||||
Name="PART_VerticalScrollBar"
|
||||
Orientation="Vertical" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Window[(design|NitroxAttached.UseCustomTitleBar)=True] ScrollViewer.main /template/ ScrollBar#PART_VerticalScrollBar">
|
||||
<Setter Property="Margin" Value="0 30 0 6" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ScrollBar">
|
||||
<Setter Property="MinWidth" Value="{DynamicResource ScrollBarSize}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource ScrollBarSize}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="AllowAutoHide" Value="False" />
|
||||
|
||||
<Style Selector="^:vertical">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid x:Name="Root">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
x:Name="VerticalRoot">
|
||||
<Track
|
||||
IsDirectionReversed="True"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}"
|
||||
ViewportSize="{TemplateBinding ViewportSize}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton Focusable="False" Name="PART_PageUpButton" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton Focusable="False" Name="PART_PageDownButton" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb
|
||||
MinHeight="8"
|
||||
RenderTransform="{DynamicResource VerticalSmallScrollThumbScaleTransform}"
|
||||
RenderTransformOrigin="100%,50%"
|
||||
Width="8" />
|
||||
</Track>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:horizontal">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid x:Name="Root">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
x:Name="HorizontalRoot">
|
||||
<Track
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}"
|
||||
ViewportSize="{TemplateBinding ViewportSize}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton Focusable="False" Name="PART_PageUpButton" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton Focusable="False" Name="PART_PageDownButton" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb
|
||||
Height="8"
|
||||
MinWidth="8"
|
||||
RenderTransform="{DynamicResource HorizontalSmallScrollThumbScaleTransform}"
|
||||
RenderTransformOrigin="50%,100%" />
|
||||
</Track>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Thumb">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border Background="{DynamicResource BrandScrollThumb}" CornerRadius="4" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ Border">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<BrushTransition Duration="0:0:0.10" Property="Background" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandScrollThumbPointerOver}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandScrollThumbPressed}" />
|
||||
</Style>
|
||||
|
||||
<!--<Style Selector="^[(design|NitroxAttached.Theme)=LIGHT]">
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[(design|NitroxAttached.Theme)=DARK]">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border Background="#262626"
|
||||
CornerRadius="4"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ Border">
|
||||
<Setter Property="Background" Value="#3f3f3f" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border">
|
||||
<Setter Property="Background" Value="#8f8f8f" />
|
||||
</Style>
|
||||
</Style>-->
|
||||
</Style>
|
||||
|
||||
<Style Selector="RepeatButton">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Styles>
|
38
Nitrox.Launcher/Models/Styles/Theme/TextBlockStyle.axaml
Normal file
38
Nitrox.Launcher/Models/Styles/Theme/TextBlockStyle.axaml
Normal file
@@ -0,0 +1,38 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="I'm a textblock ! 0123456789" />
|
||||
<TextBlock Classes="link" Text="I'm a textblock ! 0123456789" />
|
||||
<TextBlock Classes="header" Text="I'm a textblock ! 0123456789" />
|
||||
<TextBlock Classes="modalHeader" Text="I'm a textblock ! 0123456789" />
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="SelectableTextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBlock.link">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandPrimary}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="TextDecorations" Value="Underline" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBlock.header">
|
||||
<Setter Property="FontSize" Value="32" />
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBlock.modalHeader">
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
</Style>
|
||||
</Styles>
|
167
Nitrox.Launcher/Models/Styles/Theme/TextBoxStyle.axaml
Normal file
167
Nitrox.Launcher/Models/Styles/Theme/TextBoxStyle.axaml
Normal file
@@ -0,0 +1,167 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Nitrox.Launcher.Models.Converters">
|
||||
<Design.PreviewWith>
|
||||
<Panel Background="CornflowerBlue">
|
||||
<StackPanel
|
||||
Margin="10"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<StackPanel Spacing="10">
|
||||
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||
<Border
|
||||
Background="White"
|
||||
HorizontalAlignment="Center"
|
||||
Padding="10">
|
||||
<StackPanel Spacing="10" Width="200">
|
||||
<TextBox HorizontalAlignment="Stretch" Watermark="Watermark" />
|
||||
<TextBox HorizontalAlignment="Stretch" Text="Light" />
|
||||
<TextBox
|
||||
Classes="revealPasswordButton"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="Light" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<Border
|
||||
Background="Black"
|
||||
HorizontalAlignment="Center"
|
||||
Padding="10">
|
||||
<StackPanel Spacing="10" Width="200">
|
||||
<TextBox HorizontalAlignment="Stretch" Watermark="Watermark" />
|
||||
<TextBox HorizontalAlignment="Stretch" Text="Dark" />
|
||||
<TextBox
|
||||
Classes="revealPasswordButton"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="Dark" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
<Setter Property="CornerRadius" Value="8" />
|
||||
<Setter Property="Padding" Value="14" />
|
||||
<Setter Property="Background" Value="{DynamicResource BrandControlBackground}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="CaretBrush" Value="{DynamicResource BrandCaret}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
|
||||
<Style Selector="^ /template/ Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius}" />
|
||||
<Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness}" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition Duration="0:0:0.15" Property="Opacity" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
<Setter Property="Opacity" Value=".75" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Remove base border (which removes default Avalonia border brush styles) -->
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
|
||||
<!-- Fix cursor selection of textbox (weird issue with DockPanel#PART_InnerDockPanel still keeping margin) -->
|
||||
<Style Selector="^ /template/ Panel > Border > Grid"> <!-- Most senior grid with negative margin to counteract InnerDockPanel -->
|
||||
<Setter Property="Margin" Value="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={converters:TextBoxPaddingToMarginConverter}, ConverterParameter=True}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Watermark"> <!-- Watermark text -->
|
||||
<Setter Property="Margin" Value="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={converters:TextBoxPaddingToMarginConverter}}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextPresenter#PART_TextPresenter"> <!-- Text -->
|
||||
<Setter Property="Margin" Value="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={converters:TextBoxPaddingToMarginConverter}}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border > Grid > ContentPresenter:nth-child(3)"> <!-- Reveal Password Button -->
|
||||
<Setter Property="Margin" Value="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={converters:TextBoxPaddingToMarginConverter}}" />
|
||||
</Style>
|
||||
|
||||
<!-- Watermark foreground dimming -->
|
||||
<Style Selector="^ /template/ TextBlock#PART_Watermark">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<BrushTransition Duration="0:0:0.15" Property="Foreground" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Disabled Style -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ Border">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
<Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Reveal Password Button syle -->
|
||||
<Style Selector="^.revealPasswordButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty)">
|
||||
<Setter Property="PasswordChar" Value="●" />
|
||||
<Setter Property="InnerRightContent">
|
||||
<Template>
|
||||
<ToggleButton
|
||||
Focusable="True"
|
||||
IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}"
|
||||
Width="35">
|
||||
<Grid>
|
||||
<!-- TODO: Replace these with image icons -->
|
||||
<PathIcon
|
||||
Data="m10.051 7.0032c2.215 0 4.0105 1.7901 4.0105 3.9984s-1.7956 3.9984-4.0105 3.9984c-2.215 0-4.0105-1.7901-4.0105-3.9984s1.7956-3.9984 4.0105-3.9984zm0 1.4994c-1.3844 0-2.5066 1.1188-2.5066 2.499s1.1222 2.499 2.5066 2.499 2.5066-1.1188 2.5066-2.499-1.1222-2.499-2.5066-2.499zm0-5.0026c4.6257 0 8.6188 3.1487 9.7267 7.5613 0.10085 0.40165-0.14399 0.80877-0.54686 0.90931-0.40288 0.10054-0.81122-0.14355-0.91208-0.54521-0.94136-3.7492-4.3361-6.4261-8.2678-6.4261-3.9334 0-7.3292 2.6792-8.2689 6.4306-0.10063 0.40171-0.50884 0.64603-0.91177 0.54571s-0.648-0.5073-0.54737-0.90901c1.106-4.4152 5.1003-7.5667 9.728-7.5667z"
|
||||
Height="8"
|
||||
IsVisible="{Binding !$parent[ToggleButton].IsChecked}"
|
||||
Width="12" />
|
||||
<PathIcon
|
||||
Data="m0.21967 0.21965c-0.26627 0.26627-0.29047 0.68293-0.07262 0.97654l0.07262 0.08412 4.0346 4.0346c-1.922 1.3495-3.3585 3.365-3.9554 5.7495-0.10058 0.4018 0.14362 0.8091 0.54543 0.9097 0.40182 0.1005 0.80909-0.1436 0.90968-0.5455 0.52947-2.1151 1.8371-3.8891 3.5802-5.0341l1.8096 1.8098c-0.70751 0.7215-1.1438 1.71-1.1438 2.8003 0 2.2092 1.7909 4 4 4 1.0904 0 2.0788-0.4363 2.8004-1.1438l5.9193 5.9195c0.2929 0.2929 0.7677 0.2929 1.0606 0 0.2663-0.2662 0.2905-0.6829 0.0726-0.9765l-0.0726-0.0841-6.1135-6.1142 0.0012-0.0015-1.2001-1.1979-2.8699-2.8693 2e-3 -8e-4 -2.8812-2.8782 0.0012-0.0018-1.1333-1.1305-4.3064-4.3058c-0.29289-0.29289-0.76777-0.29289-1.0607 0zm7.9844 9.0458 3.5351 3.5351c-0.45 0.4358-1.0633 0.704-1.7392 0.704-1.3807 0-2.5-1.1193-2.5-2.5 0-0.6759 0.26824-1.2892 0.7041-1.7391zm1.7959-5.7655c-1.0003 0-1.9709 0.14807-2.8889 0.425l1.237 1.2362c0.5358-0.10587 1.0883-0.16119 1.6519-0.16119 3.9231 0 7.3099 2.6803 8.2471 6.4332 0.1004 0.4018 0.5075 0.6462 0.9094 0.5459 0.4019-0.1004 0.6463-0.5075 0.5459-0.9094-1.103-4.417-5.0869-7.5697-9.7024-7.5697zm0.1947 3.5093 3.8013 3.8007c-0.1018-2.0569-1.7488-3.7024-3.8013-3.8007z"
|
||||
Height="12"
|
||||
IsVisible="{Binding $parent[ToggleButton].IsChecked}"
|
||||
Width="12" />
|
||||
</Grid>
|
||||
|
||||
<ToggleButton.Styles>
|
||||
<Style Selector="ToggleButton">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition Duration="0:0:0.15" Property="Opacity" />
|
||||
<TransformOperationsTransition Duration="0:0:.075" Property="RenderTransform" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Opacity" Value=".5" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="RenderTransform" Value="scale(0.95)" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ ContentPresenter">
|
||||
<Setter Property="TextBlock.Foreground" Value="{Binding $parent[Button].Foreground}" />
|
||||
<Setter Property="Background" Value="{Binding $parent[Button].Background}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ToggleButton.Styles>
|
||||
</ToggleButton>
|
||||
</Template>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Style>
|
||||
</Styles>
|
29
Nitrox.Launcher/Models/Styles/Theme/ToolTipStyle.axaml
Normal file
29
Nitrox.Launcher/Models/Styles/Theme/ToolTipStyle.axaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.PreviewWith>
|
||||
<Border Padding="20">
|
||||
<StackPanel Spacing="20">
|
||||
<ToolTip Opacity="1">Text Content</ToolTip>
|
||||
<ToolTip Opacity="1">Very long text content which should exceed the maximum with of the tooltip and wrap.</ToolTip>
|
||||
<ToolTip Opacity="1">
|
||||
<StackPanel>
|
||||
<TextBlock>Multi-line</TextBlock>
|
||||
<TextBlock>Control Content</TextBlock>
|
||||
</StackPanel>
|
||||
</ToolTip>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<Style Selector="ToolTip">
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
<Style Selector="^ Border">
|
||||
<Setter Property="Opacity" Value="0.9" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="FontWeight" Value="600" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandBlack}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Styles>
|
@@ -0,0 +1,63 @@
|
||||
<Styles
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:design="clr-namespace:Nitrox.Launcher.Models.Design"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Code from: https://docs.avaloniaui.net/docs/data-binding/data-validation (except for colors) -->
|
||||
<Style Selector="DataValidationErrors">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DockPanel LastChildFill="True">
|
||||
<ContentControl
|
||||
Content="{Binding (DataValidationErrors.Errors)}"
|
||||
ContentTemplate="{TemplateBinding ErrorTemplate}"
|
||||
DataContext="{TemplateBinding Owner}"
|
||||
DockPanel.Dock="Right">
|
||||
<!-- Don't show error on fields immediately on load, wait for user input (e.g. user is trying to skip a field with invalid value) -->
|
||||
<ContentControl.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="(DataValidationErrors.HasErrors)" />
|
||||
<Binding Path="(design:NitroxAttached.HasUserInteracted)" />
|
||||
</MultiBinding>
|
||||
</ContentControl.IsVisible>
|
||||
</ContentControl>
|
||||
<ContentPresenter
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}" />
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Setter Property="ErrorTemplate">
|
||||
<DataTemplate x:DataType="{x:Type x:Object}">
|
||||
<Canvas
|
||||
Background="Transparent"
|
||||
Height="14"
|
||||
Margin="4,0"
|
||||
Width="14">
|
||||
<Canvas.Styles>
|
||||
<Style Selector="ToolTip">
|
||||
<Setter Property="Background" Value="{DynamicResource BrandAbortBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BrandAbort}" />
|
||||
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource BrandWhite}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Canvas.Styles>
|
||||
<ToolTip.Tip>
|
||||
<ItemsControl ItemsSource="{Binding}" />
|
||||
</ToolTip.Tip>
|
||||
<Path
|
||||
Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2"
|
||||
Stroke="{DynamicResource BrandAbort}"
|
||||
StrokeThickness="2" />
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Styles>
|
Reference in New Issue
Block a user