Commit da4abf19 authored by shrabbit's avatar shrabbit
Browse files

添加 Seek.Theme.Demo 项目

- 添加 `Seek.Theme.Demo` 项目,包含主窗口和应用程序配置
- 更新 `Seek.slnx` 解决方案文件,添加 `Seek.Theme.Demo` 项目
- 更新 `Seek.Theme/Seek.Theme.csproj` 项目文件,更新依赖项版本
- 添加 `Program.cs` 文件,配置 Avalonia 应用程序启动
- 添加 `App.axaml` 和 `App.axaml.cs` 文件,定义应用程序入口点
- 添加 `MainWindow.axaml` 和 `MainWindow.axaml.cs` 文件,定义主窗口界面
- 添加 `Seek.Theme.Demo.csproj` 项目文件,配置项目设置和依赖项
parent a20dad30
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="Seek.Theme.Demo.App"
             RequestedThemeVariant="Default">

    <Application.Styles>
        <StyleInclude Source="avares://Seek.Theme/SeekTheme.axaml" />
    </Application.Styles>
</Application>
+23 −0
Original line number Diff line number Diff line
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;

namespace Seek.Theme.Demo;

public partial class App : Application
{
    public override void Initialize()
    {
        AvaloniaXamlLoader.Load(this);
    }

    public override void OnFrameworkInitializationCompleted()
    {
        if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
        {
            desktop.MainWindow = new MainWindow();
        }

        base.OnFrameworkInitializationCompleted();
    }
}
 No newline at end of file
+285 −0
Original line number Diff line number Diff line
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="700"
        x:Class="Seek.Theme.Demo.MainWindow"
        Title="Seek Theme Demo"
        Width="900" Height="700"
        WindowStartupLocation="CenterScreen">

    <TabControl Margin="16" TabStripPlacement="Left">

        <TabItem Header="Buttons">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Button Variants" Classes="h3" />
                    <StackPanel Orientation="Horizontal" Spacing="12">
                        <Button Content="Default" />
                        <Button Content="Primary" Classes="btn-primary" />
                        <Button Content="Success" Classes="btn-success" />
                        <Button Content="Danger" Classes="btn-danger" />
                        <Button Content="Disabled" IsEnabled="False" />
                    </StackPanel>

                    <TextBlock Text="Button Sizes" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
                        <Button Content="Small" Padding="8,4" FontSize="12" />
                        <Button Content="Medium" Classes="btn-primary" />
                        <Button Content="Large" Classes="btn-success" Padding="16,12" FontSize="16" />
                    </StackPanel>

                    <TextBlock Text="Button States" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Orientation="Horizontal" Spacing="12">
                        <Button Content="Normal" />
                        <Button Content="Hover (try it)" Classes="btn-primary" />
                        <Button Content="Pressed (try it)" Classes="btn-success" />
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Inputs">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="TextBox" Classes="h3" />
                    <TextBox Watermark="Enter text here..." />
                    <TextBox Text="Pre-filled text" />
                    <TextBox Watermark="Disabled" IsEnabled="False" />

                    <TextBlock Text="NumericUpDown" Classes="h3" Margin="0,8,0,0" />
                    <NumericUpDown Value="42" />

                    <TextBlock Text="ComboBox" Classes="h3" Margin="0,8,0,0" />
                    <ComboBox SelectedIndex="0">
                        <ComboBoxItem Content="Option One" />
                        <ComboBoxItem Content="Option Two" />
                        <ComboBoxItem Content="Option Three" />
                    </ComboBox>

                    <TextBlock Text="AutoCompleteBox" Classes="h3" Margin="0,8,0,0" />
                    <AutoCompleteBox Watermark="Type to search..." />
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Selection">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="CheckBox" Classes="h3" />
                    <CheckBox Content="Unchecked" />
                    <CheckBox Content="Checked" IsChecked="True" />
                    <CheckBox Content="Three-state (null)" IsThreeState="True" />
                    <CheckBox Content="Disabled" IsEnabled="False" />

                    <TextBlock Text="RadioButton" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Spacing="8">
                        <RadioButton Content="Option A" GroupName="radio1" IsChecked="True" />
                        <RadioButton Content="Option B" GroupName="radio1" />
                        <RadioButton Content="Option C" GroupName="radio1" />
                    </StackPanel>

                    <TextBlock Text="ToggleSwitch" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Spacing="8">
                        <ToggleSwitch IsChecked="True" />
                        <ToggleSwitch IsChecked="False" />
                        <ToggleSwitch IsChecked="True" IsEnabled="False" />
                    </StackPanel>

                    <TextBlock Text="ListBox" Classes="h3" Margin="0,8,0,0" />
                    <ListBox SelectedIndex="0" Height="120">
                        <ListBoxItem Content="Item One" />
                        <ListBoxItem Content="Item Two" />
                        <ListBoxItem Content="Item Three" />
                        <ListBoxItem Content="Item Four" />
                        <ListBoxItem Content="Item Five" />
                    </ListBox>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Progress">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="ProgressBar" Classes="h3" />
                    <ProgressBar Value="70" Maximum="100" />
                    <ProgressBar Value="30" Maximum="100" ShowProgressText="True" />
                    <ProgressBar IsIndeterminate="True" />

                    <TextBlock Text="ProgressBar Colors" Classes="h3" Margin="0,8,0,0" />
                    <ProgressBar Value="100" Maximum="100" Background="{DynamicResource SeekSuccessBrush}" />
                    <ProgressBar Value="100" Maximum="100" Background="{DynamicResource SeekWarningBrush}" />
                    <ProgressBar Value="100" Maximum="100" Background="{DynamicResource SeekDangerBrush}" />

                    <TextBlock Text="Loading Indicator" Classes="h3" Margin="0,8,0,0" />
                    <ProgressBar IsIndeterminate="True" Height="4" />
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Sliders">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Slider" Classes="h3" />
                    <Slider Minimum="0" Maximum="100" Value="50" />
                    <Slider Minimum="0" Maximum="100" Value="25" />
                    <Slider Minimum="0" Maximum="100" Value="75" IsEnabled="False" />

                    <TextBlock Text="ScrollBar" Classes="h3" Margin="0,8,0,0" />
                    <Border Height="150" BorderBrush="{DynamicResource SeekBorderBrush}" BorderThickness="1" CornerRadius="8">
                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                            <StackPanel Spacing="8" Margin="8">
                                <TextBlock Text="This is a scrollable area with custom scrollbar styling from the Seek theme." TextWrapping="Wrap" />
                                <TextBlock Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." TextWrapping="Wrap" />
                                <TextBlock Text="Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris." TextWrapping="Wrap" />
                                <TextBlock Text="Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore." TextWrapping="Wrap" />
                                <TextBlock Text="Excepteur sint occaecat cupidatat non proident." TextWrapping="Wrap" />
                            </StackPanel>
                        </ScrollViewer>
                    </Border>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Text &amp; Typography">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Typography Scale" Classes="h3" />
                    <TextBlock Text="Heading 1 - Large Display" Classes="h1" />
                    <TextBlock Text="Heading 2 - Section Title" Classes="h2" />
                    <TextBlock Text="Heading 3 - Subsection" Classes="h3" />
                    <TextBlock Text="Body text - This is the standard body text style used for most content. It should be comfortable to read at typical sizes." TextWrapping="Wrap" />
                    <TextBlock Text="Caption text - Smaller supplementary text" Classes="caption" />

                    <TextBlock Text="Text Colors" Classes="h3" Margin="0,8,0,0" />
                    <TextBlock Text="Primary text color - High emphasis" Foreground="{DynamicResource SeekTextPrimaryBrush}" />
                    <TextBlock Text="Secondary text color - Medium emphasis" Foreground="{DynamicResource SeekTextSecondaryBrush}" />
                    <TextBlock Text="Primary brand color" Foreground="{DynamicResource SeekPrimaryBrush}" />
                    <TextBlock Text="Success state" Foreground="{DynamicResource SeekSuccessBrush}" />
                    <TextBlock Text="Warning state" Foreground="{DynamicResource SeekWarningBrush}" />
                    <TextBlock Text="Danger state" Foreground="{DynamicResource SeekDangerBrush}" />
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Cards &amp; Borders">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Card Style" Classes="h3" />
                    <Border Classes="card">
                        <StackPanel Spacing="8">
                            <TextBlock Text="Card Title" Classes="h3" />
                            <TextBlock Text="This is a card component with custom styling from Seek.Theme. It has rounded corners, border, and padding." TextWrapping="Wrap" />
                        </StackPanel>
                    </Border>

                    <TextBlock Text="Surface Colors" Classes="h3" Margin="0,8,0,0" />
                    <Border Classes="card">
                        <TextBlock Text="Surface (Card Background)" />
                    </Border>
                    <Border Classes="card surface-alt">
                        <TextBlock Text="Surface Alt (Alternate Background)" />
                    </Border>

                    <TextBlock Text="Border Radius" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Orientation="Horizontal" Spacing="12">
                        <Border Width="80" Height="80" CornerRadius="0" Background="{DynamicResource SeekPrimaryBrush}" />
                        <Border Width="80" Height="80" CornerRadius="4" Background="{DynamicResource SeekPrimaryBrush}" />
                        <Border Width="80" Height="80" CornerRadius="8" Background="{DynamicResource SeekPrimaryBrush}" />
                        <Border Width="80" Height="80" CornerRadius="16" Background="{DynamicResource SeekPrimaryBrush}" />
                        <Border Width="80" Height="80" CornerRadius="40" Background="{DynamicResource SeekPrimaryBrush}" />
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Colors">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Brand Colors" Classes="h3" />
                    <StackPanel Spacing="8">
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekPrimaryBrush}" />
                            <TextBlock Text="Primary" VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekPrimaryHoverBrush}" />
                            <TextBlock Text="Primary Hover" VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekPrimaryPressedBrush}" />
                            <TextBlock Text="Primary Pressed" VerticalAlignment="Center" />
                        </StackPanel>
                    </StackPanel>

                    <TextBlock Text="Semantic Colors" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Spacing="8">
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekSuccessBrush}" />
                            <TextBlock Text="Success" VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekWarningBrush}" />
                            <TextBlock Text="Warning" VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekDangerBrush}" />
                            <TextBlock Text="Danger" VerticalAlignment="Center" />
                        </StackPanel>
                    </StackPanel>

                    <TextBlock Text="Surface &amp; Border" Classes="h3" Margin="0,8,0,0" />
                    <StackPanel Spacing="8">
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekSurfaceBrush}" BorderBrush="{DynamicResource SeekBorderBrush}" BorderThickness="1" />
                            <TextBlock Text="Surface" VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
                            <Border Width="40" Height="40" CornerRadius="8" Background="{DynamicResource SeekSurfaceAltBrush}" BorderBrush="{DynamicResource SeekBorderBrush}" BorderThickness="1" />
                            <TextBlock Text="Surface Alt" VerticalAlignment="Center" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="TabControl">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Nested TabControl" Classes="h3" />
                    <TabControl>
                        <TabItem Header="Tab A">
                            <TextBlock Text="Content for Tab A" Margin="16" />
                        </TabItem>
                        <TabItem Header="Tab B">
                            <TextBlock Text="Content for Tab B" Margin="16" />
                        </TabItem>
                        <TabItem Header="Tab C">
                            <TextBlock Text="Content for Tab C" Margin="16" />
                        </TabItem>
                    </TabControl>
                </StackPanel>
            </ScrollViewer>
        </TabItem>

        <TabItem Header="Expander">
            <ScrollViewer>
                <StackPanel Spacing="16" Margin="16">
                    <TextBlock Text="Expander" Classes="h3" />
                    <Expander Header="Click to expand">
                        <TextBlock Text="This is the expanded content. It can contain any controls or content you need." TextWrapping="Wrap" Margin="0,8,0,0" />
                    </Expander>
                    <Expander Header="Another expander" IsExpanded="True">
                        <StackPanel Spacing="8" Margin="0,8,0,0">
                            <TextBlock Text="This one starts expanded." />
                            <TextBox Watermark="You can put inputs here..." />
                            <Button Content="Action" Classes="btn-primary" />
                        </StackPanel>
                    </Expander>
                    <Expander Header="Disabled expander" IsEnabled="False" />
                </StackPanel>
            </ScrollViewer>
        </TabItem>

    </TabControl>
</Window>
+11 −0
Original line number Diff line number Diff line
using Avalonia.Controls;

namespace Seek.Theme.Demo;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
}
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
using Avalonia;
using System;

namespace Seek.Theme.Demo;

class Program
{
    // Initialization code. Don't use any Avalonia, third-party APIs or any
    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    // yet and stuff might break.
    [STAThread]
    public static void Main(string[] args) => BuildAvaloniaApp()
        .StartWithClassicDesktopLifetime(args);

    // Avalonia configuration, don't remove; also used by visual designer.
    public static AppBuilder BuildAvaloniaApp()
        => AppBuilder.Configure<App>()
            .UsePlatformDetect()
            .WithInterFont()
            .LogToTrace();
}
 No newline at end of file
Loading