mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
Compare commits
37 Commits
v0.1.0-pre
...
v0.1.0-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e75d56845 | ||
|
|
1030fa47e7 | ||
|
|
5d31e05bfc | ||
|
|
1984771fcb | ||
|
|
500f6526b0 | ||
|
|
a7d0568526 | ||
|
|
d8109d9c54 | ||
|
|
626160493b | ||
|
|
be0d3d1aad | ||
|
|
cb9542ad25 | ||
|
|
4bb5303375 | ||
|
|
0887dd5e31 | ||
|
|
30af6dae40 | ||
|
|
1b1caa1a35 | ||
|
|
c973adb2df | ||
|
|
eccf82f706 | ||
|
|
dc010357ba | ||
|
|
d7574237ec | ||
|
|
8e584fe4eb | ||
|
|
c59bae2c03 | ||
|
|
aa52f874ca | ||
|
|
e4a5f09fed | ||
|
|
6674ca3715 | ||
|
|
b9a8bd3a2e | ||
|
|
c8074300a0 | ||
|
|
dcf557ad1a | ||
|
|
4811e4b848 | ||
|
|
7f1c962843 | ||
|
|
3bfac4d143 | ||
|
|
e5d1b744bd | ||
|
|
4e74d1ab90 | ||
|
|
9934ea791e | ||
|
|
c94dfb2948 | ||
|
|
22663a3769 | ||
|
|
79b9b67313 | ||
|
|
75a6f57f0f | ||
|
|
3b5cf24c98 |
@@ -27,5 +27,6 @@ class Program
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions(){ UseCompositor = false})
|
||||
.LogToTrace();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ButtonDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800" mc:Ignorable="d">
|
||||
<StackPanel Margin="20" HorizontalAlignment="Left" Spacing="20">
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ButtonDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel
|
||||
Margin="20"
|
||||
HorizontalAlignment="Left"
|
||||
Spacing="20">
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">Primary</Button>
|
||||
@@ -23,7 +27,12 @@
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidButton}">
|
||||
Danger
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
@@ -32,7 +41,75 @@
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
Danger
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>DropdownButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<DropDownButton Content="Submit">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource SolidDropdownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropdownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SplitButton Content="Submit">
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
<SplitButton Classes="Secondary" Content="Submit" />
|
||||
<SplitButton Classes="Tertiary" Content="Submit" />
|
||||
<SplitButton Classes="Warning" Content="Submit" />
|
||||
<SplitButton Classes="Danger" Content="Submit" />
|
||||
<SplitButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSplitButton Content="Submit">
|
||||
<ToggleSplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</ToggleSplitButton.Flyout>
|
||||
</ToggleSplitButton>
|
||||
<ToggleSplitButton Classes="Secondary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Submit" />
|
||||
<ToggleSplitButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
25
demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml
Normal file
25
demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.CalendarDatePickerDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<CalendarDatePicker />
|
||||
<CalendarDatePicker
|
||||
Name="DatePicker2"
|
||||
Margin="0,0,0,8"
|
||||
SelectedDateFormat="Long" />
|
||||
<CalendarDatePicker
|
||||
Name="DatePicker3"
|
||||
Margin="0,0,0,8"
|
||||
CustomDateFormatString="ddd, MMM d"
|
||||
SelectedDateFormat="Custom" />
|
||||
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
|
||||
|
||||
<CalendarDatePicker IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class CalendarDatePickerDemo : UserControl
|
||||
{
|
||||
public CalendarDatePickerDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
14
demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml
Normal file
14
demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.CalendarDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<Calendar />
|
||||
<Calendar SelectionMode="SingleRange" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class CalendarDemo : UserControl
|
||||
{
|
||||
public CalendarDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
37
demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml
Normal file
37
demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml
Normal file
@@ -0,0 +1,37 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.CarouselDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Classes="Strong" Text="This is still WIP" />
|
||||
<Grid
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *, Auto">
|
||||
<RepeatButton
|
||||
Name="Previous"
|
||||
Grid.Column="0"
|
||||
Content="Previous" />
|
||||
<Carousel Name="carousel" Grid.Column="1">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<TextBlock Text="Text 1" />
|
||||
<TextBlock Text="Text 2" />
|
||||
<TextBlock Text="Text 3" />
|
||||
<TextBlock Text="Text 4" />
|
||||
</Carousel>
|
||||
<RepeatButton
|
||||
Name="Next"
|
||||
Grid.Column="2"
|
||||
Content="Next" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock Text="{Binding #carousel.SelectedIndex}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
26
demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs
Normal file
26
demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class CarouselDemo : UserControl
|
||||
{
|
||||
public CarouselDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
Previous.Click += OnPreviousClick;
|
||||
Next.Click += OnNextClick;
|
||||
}
|
||||
|
||||
private void OnPreviousClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
carousel.Previous();
|
||||
}
|
||||
|
||||
private void OnNextClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
carousel.Next();
|
||||
}
|
||||
}
|
||||
15
demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml
Normal file
15
demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml
Normal file
@@ -0,0 +1,15 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.DatePickerDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<DatePicker />
|
||||
<DatePicker DayFormat="d (ddd)" YearVisible="False" />
|
||||
<DatePicker IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class DatePickerDemo : UserControl
|
||||
{
|
||||
public DatePickerDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
42
demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml
Normal file
42
demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml
Normal file
@@ -0,0 +1,42 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.GridSplitter"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<Grid
|
||||
Width="300"
|
||||
Height="300"
|
||||
RowDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Row="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
<Grid
|
||||
Width="300"
|
||||
Height="300"
|
||||
ColumnDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Column="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class GridSplitter : UserControl
|
||||
{
|
||||
public GridSplitter()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
16
demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml
Normal file
16
demo/Semi.Avalonia.Demo/Pages/ManagedFileChooserDemo.axaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ManagedFileChooserDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10">
|
||||
<Button Name="openFileDialog">Open File</Button>
|
||||
<Button Name="selectFolderDialog">Select Folder</Button>
|
||||
<Button Name="saveFileDialog">Save File</Button>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class ManagedFileChooserDemo : UserControl
|
||||
{
|
||||
public ManagedFileChooserDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
openFileDialog.Click += OpenFileDialog;
|
||||
selectFolderDialog.Click += SelectFolderDialog;
|
||||
saveFileDialog.Click += SaveFileDialog;
|
||||
}
|
||||
|
||||
private async void OpenFileDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
FileTypeFilter = GetFileTypes(),
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SelectFolderDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
|
||||
{
|
||||
Title = "Select Folder",
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SaveFileDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
});
|
||||
}
|
||||
|
||||
private IStorageProvider GetStorageProvider()
|
||||
{
|
||||
return new ManagedStorageProvider<Window>(GetWindow(), null);
|
||||
}
|
||||
|
||||
private static string FullPathOrName(IStorageItem? item)
|
||||
{
|
||||
if (item is null) return "(null)";
|
||||
return item.TryGetUri(out var uri) ? uri.ToString() : item.Name;
|
||||
}
|
||||
|
||||
Window GetWindow() => this.VisualRoot as Window ?? throw new NullReferenceException("Invalid Owner");
|
||||
TopLevel GetTopLevel() => this.VisualRoot as TopLevel ?? throw new NullReferenceException("Invalid Owner");
|
||||
|
||||
List<FilePickerFileType>? GetFileTypes()
|
||||
{
|
||||
return new List<FilePickerFileType>
|
||||
{
|
||||
FilePickerFileTypes.All,
|
||||
FilePickerFileTypes.TextPlain
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -15,14 +15,6 @@
|
||||
Text="Welcome to Semi Avalonia"
|
||||
Theme="{StaticResource TitleTextBlock}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">主要按钮</Button>
|
||||
<Button Classes="Secondary">次要按钮</Button>
|
||||
<Button Classes="Tertiary">第三按钮</Button>
|
||||
<Button Classes="Warning">警告按钮</Button>
|
||||
<Button Classes="Danger">危险按钮</Button>
|
||||
<Button Classes="Primary" IsEnabled="False">禁用按钮</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
|
||||
@@ -61,8 +53,6 @@
|
||||
<RadioButton Theme="{StaticResource ButtonRadioButton}">选项 2</RadioButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Margin="4" Theme="{StaticResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 1</TextBlock>
|
||||
@@ -79,6 +69,7 @@
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Margin="0,0,8,0">Avalonia</CheckBox>
|
||||
<CheckBox Margin="0,0,8,0" IsChecked="True">WPF</CheckBox>
|
||||
@@ -89,6 +80,15 @@
|
||||
Content="Content"
|
||||
OffContent="No"
|
||||
OnContent="Yes" />
|
||||
<ProgressBar
|
||||
Classes="Right"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<Slider
|
||||
Width="200"
|
||||
Margin="30,0"
|
||||
Orientation="Horizontal"
|
||||
Value="30" />
|
||||
</StackPanel>
|
||||
<TabControl>
|
||||
<TabItem Header="Tab 1">
|
||||
@@ -103,7 +103,9 @@
|
||||
</TabControl>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<ComboBox Width="200" PlaceholderText="Please Select" />
|
||||
|
||||
<DatePicker />
|
||||
<TimePicker />
|
||||
<CalendarDatePicker />
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="* * *">
|
||||
<Border Theme="{StaticResource CardBorder}">
|
||||
@@ -132,6 +134,7 @@
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="*"
|
||||
Text="Avalonia" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
@@ -152,6 +155,7 @@
|
||||
<TextBlock>List Item 4</TextBlock>
|
||||
<TextBlock>List Item 5</TextBlock>
|
||||
</ListBox>
|
||||
<Calendar />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
79
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml
Normal file
79
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.SliderDemo"
|
||||
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"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel
|
||||
Margin="20"
|
||||
HorizontalAlignment="Left"
|
||||
Spacing="20">
|
||||
<Slider
|
||||
Width="300"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
TickPlacement="Outside"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
Classes="ToolTip"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
TickPlacement="Outside"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
IsDirectionReversed="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
IsEnabled="False"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
Value="30" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Slider
|
||||
Height="300"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
TickFrequency="10"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Height="300"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
TickFrequency="10"
|
||||
TickPlacement="TopLeft"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Height="300"
|
||||
Classes="ToolTip"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
TickFrequency="10"
|
||||
TickPlacement="TopLeft"
|
||||
Value="0" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class SliderDemo : UserControl
|
||||
{
|
||||
public SliderDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
152
demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
Normal file
152
demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
Normal file
@@ -0,0 +1,152 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.SplitViewDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<Border>
|
||||
<Grid ColumnDefinitions="*,400">
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5"
|
||||
Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<ToggleButton
|
||||
Name="PaneOpenButton"
|
||||
Content="IsPaneOpen"
|
||||
IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" />
|
||||
|
||||
<ToggleButton
|
||||
Name="UseLightDismissOverlayModeButton"
|
||||
Content="UseLightDismissOverlayMode"
|
||||
IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" />
|
||||
|
||||
<ToggleSwitch
|
||||
Content="Placement"
|
||||
IsChecked="{Binding !IsLeft}"
|
||||
OffContent="Left"
|
||||
OnContent="Right" />
|
||||
|
||||
<TextBlock Text="DisplayMode" />
|
||||
<ComboBox
|
||||
Name="DisplayModeSelector"
|
||||
Width="170"
|
||||
Margin="10"
|
||||
SelectedIndex="{Binding DisplayMode}">
|
||||
<ComboBoxItem>Inline</ComboBoxItem>
|
||||
<ComboBoxItem>CompactInline</ComboBoxItem>
|
||||
<ComboBoxItem>Overlay</ComboBoxItem>
|
||||
<ComboBoxItem>CompactOverlay</ComboBoxItem>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Text="PaneBackground" />
|
||||
<ComboBox
|
||||
Name="PaneBackgroundSelector"
|
||||
Width="170"
|
||||
Margin="10"
|
||||
SelectedIndex="0">
|
||||
<ComboBoxItem Tag="White">White</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Red">Red</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Blue">Blue</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Green">Green</ComboBoxItem>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" />
|
||||
<Slider
|
||||
Name="OpenPaneLengthSlider"
|
||||
Width="150"
|
||||
Maximum="500"
|
||||
Minimum="128"
|
||||
Value="256" />
|
||||
|
||||
<TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" />
|
||||
<Slider
|
||||
Name="CompactPaneLengthSlider"
|
||||
Width="150"
|
||||
Maximum="128"
|
||||
Minimum="24"
|
||||
Value="48" />
|
||||
</StackPanel>
|
||||
<Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}" BorderThickness="1">
|
||||
<!-- {Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector} -->
|
||||
<SplitView
|
||||
Name="SplitView"
|
||||
CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
|
||||
DisplayMode="CompactOverlay"
|
||||
OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}"
|
||||
PaneBackground="{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}"
|
||||
PanePlacement="{Binding PanePlacement}">
|
||||
<SplitView.Pane>
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||
<TextBlock
|
||||
Name="PaneHeader"
|
||||
Margin="5,12,0,0"
|
||||
FontWeight="Bold"
|
||||
Text="PANE CONTENT" />
|
||||
<ComboBox Grid.Row="1" Width="150">
|
||||
<ComboBoxItem Content="Item1" />
|
||||
<ComboBoxItem Content="Item2" />
|
||||
<ComboBoxItem Content="Item3" />
|
||||
</ComboBox>
|
||||
<ListBoxItem
|
||||
Grid.Row="2"
|
||||
Margin="0,10"
|
||||
VerticalAlignment="Top">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!-- Path glyph from materialdesignicons.com -->
|
||||
<Border Width="48">
|
||||
<Viewbox
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Left">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<TextBlock VerticalAlignment="Center" Text="People" />
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Margin="60,12"
|
||||
Text="Item at bottom" />
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
|
||||
<Grid>
|
||||
<Grid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="SplitViewContent" />
|
||||
<TextBlock Text="SplitViewContent" TextAlignment="Left" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Bottom"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
</Grid>
|
||||
|
||||
</SplitView>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class SplitViewDemo : UserControl
|
||||
{
|
||||
public SplitViewDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.TabControlDemo" 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" d:DesignHeight="450"
|
||||
d:DesignWidth="800" mc:Ignorable="d">
|
||||
x:Class="Semi.Avalonia.Demo.Pages.TabControlDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<Border Theme="{StaticResource CardBorder}">
|
||||
<TabControl TabStripPlacement="Top">
|
||||
@@ -11,7 +15,8 @@
|
||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
||||
<TabItem Content="中文内容" Header="中文中文" />
|
||||
<TabItem
|
||||
Content="Hello 4" Header="Tab 4"
|
||||
Content="Hello 4"
|
||||
Header="Tab 4"
|
||||
IsEnabled="False" />
|
||||
</TabControl>
|
||||
</Border>
|
||||
@@ -22,7 +27,8 @@
|
||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
||||
<TabItem Content="中文内容" Header="中文中文" />
|
||||
<TabItem
|
||||
Content="Hello 4" Header="Tab 4"
|
||||
Content="Hello 4"
|
||||
Header="Tab 4"
|
||||
IsEnabled="False" />
|
||||
</TabControl>
|
||||
</Border>
|
||||
@@ -33,7 +39,8 @@
|
||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
||||
<TabItem Content="中文内容" Header="中文中文" />
|
||||
<TabItem
|
||||
Content="Hello 4" Header="Tab 4"
|
||||
Content="Hello 4"
|
||||
Header="Tab 4"
|
||||
IsEnabled="False" />
|
||||
</TabControl>
|
||||
</Border>
|
||||
@@ -44,9 +51,16 @@
|
||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
||||
<TabItem Content="中文内容" Header="中文中文" />
|
||||
<TabItem
|
||||
Content="Hello 4" Header="Tab 4"
|
||||
Content="Hello 4"
|
||||
Header="Tab 4"
|
||||
IsEnabled="False" />
|
||||
</TabControl>
|
||||
</Border>
|
||||
<Border Theme="{StaticResource CardBorder}">
|
||||
<TabStrip>
|
||||
<TabStripItem>Tab 1</TabStripItem>
|
||||
<TabStripItem>Tab 2</TabStripItem>
|
||||
</TabStrip>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
16
demo/Semi.Avalonia.Demo/Pages/TimePickerDemo.axaml
Normal file
16
demo/Semi.Avalonia.Demo/Pages/TimePickerDemo.axaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.TimePickerDemo"
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="20" Spacing="20">
|
||||
<TimePicker />
|
||||
<TimePicker MinuteIncrement="15" />
|
||||
<TimePicker ClockIdentifier="24HourClock" />
|
||||
<TimePicker ClockIdentifier="12HourClock" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/TimePickerDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/TimePickerDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class TimePickerDemo : UserControl
|
||||
{
|
||||
public TimePickerDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -27,24 +27,42 @@
|
||||
<TabItem Header="ButtonSpinner">
|
||||
<pages:ButtonSpinnerDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Calendar">
|
||||
<pages:CalendarDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="CalendarDatePicker">
|
||||
<pages:CalendarDatePickerDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Carousel">
|
||||
<pages:CarouselDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="CheckBox">
|
||||
<pages:CheckBoxDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="ComboBox">
|
||||
<pages:ComboBoxDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="DatePicker">
|
||||
<pages:DatePickerDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Expander">
|
||||
<pages:ExpanderDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Flyout">
|
||||
<pages:FlyoutDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="GridSplitter">
|
||||
<pages:GridSplitter />
|
||||
</TabItem>
|
||||
<TabItem Header="Label">
|
||||
<pages:LabelDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="ListBox">
|
||||
<pages:ListBoxDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="ManagedFileChooser">
|
||||
<pages:ManagedFileChooserDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Menu">
|
||||
<pages:MenuDemo />
|
||||
</TabItem>
|
||||
@@ -63,6 +81,12 @@
|
||||
<TabItem Header="RepeatButton">
|
||||
<pages:RepeatButtonDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Slider">
|
||||
<pages:SliderDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="SplitView">
|
||||
<pages:SplitViewDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="TabControl">
|
||||
<pages:TabControlDemo />
|
||||
</TabItem>
|
||||
@@ -72,6 +96,9 @@
|
||||
<TabItem Header="TextBox">
|
||||
<pages:TextBoxDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="TimePicker">
|
||||
<pages:TimePickerDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="ToggleButton">
|
||||
<pages:ToggleButtonDemo />
|
||||
</TabItem>
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource AutoCompleteBoxDefaultBorderBrush}" />
|
||||
<Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="600" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Padding" Value="4" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="AutoCompleteBox">
|
||||
<Panel>
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
|
||||
@@ -89,6 +89,15 @@
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
|
||||
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
|
||||
272
src/Semi.Avalonia/Controls/Calendar.axaml
Normal file
272
src/Semi.Avalonia/Controls/Calendar.axaml
Normal file
@@ -0,0 +1,272 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
|
||||
<ControlTheme x:Key="{x:Type Calendar}" TargetType="Calendar">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CalendarBorderThickness}" />
|
||||
<Setter Property="Calendar.CornerRadius" Value="{DynamicResource CalendarCornerRadius}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Calendar">
|
||||
<StackPanel
|
||||
Name="PART_Root"
|
||||
HorizontalAlignment="Center"
|
||||
ClipToBounds="True">
|
||||
<CalendarItem
|
||||
Name="PART_CalendarItem"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
HeaderBackground="{TemplateBinding HeaderBackground}" />
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CalendarItem}" TargetType="CalendarItem">
|
||||
<Setter Property="CalendarItem.DayTitleTemplate">
|
||||
<Template>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource CalendarItemWeekDayNameForeground}"
|
||||
Text="{Binding}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="CalendarItem.Template">
|
||||
<ControlTemplate TargetType="CalendarItem">
|
||||
<Border
|
||||
Padding="16"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<!--
|
||||
To keep calendar from resizing when switching DisplayMode
|
||||
In WinUI Min-Width from TemplateSettings
|
||||
basically...MinWidth of DayItem = 40, 40 * 7 = 280 + margins/padding = ~294
|
||||
Viewport height is set from # of rows displayed (2-8) in Month mode, = ~290 for 6 weeks (+ day names)
|
||||
-->
|
||||
<Grid
|
||||
MinWidth="{DynamicResource CalendarMinWidth}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
RowDefinitions="Auto,*">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Button
|
||||
Name="PART_PreviousButton"
|
||||
Grid.Column="0"
|
||||
HorizontalContentAlignment="Left"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
<!-- Path mimics Segoe MDL2 Assets font glyph used in WinUI -->
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource CalendarItemPreviousIconGlyph}"
|
||||
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
Name="PART_HeaderButton"
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Center"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Theme="{DynamicResource BorderlessButton}" />
|
||||
|
||||
<Button
|
||||
Name="PART_NextButton"
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Left"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
<!-- Path mimics Segoe MDL2 Assets font glyph used in WinUI -->
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource CalendarItemNextIconGlyph}"
|
||||
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<!-- Border below is used only for MonthView but it can't be moved inside of Grid because CalendarItem expects it to be empty and it will cause side-effects -->
|
||||
<Grid
|
||||
Name="PART_MonthView"
|
||||
Grid.Row="1"
|
||||
MinHeight="200"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="False">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- This should always be the week day names?? -->
|
||||
<RowDefinition Height="{DynamicResource CalendarItemWeekDayNameHeight}" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
<Grid
|
||||
Name="PART_YearView"
|
||||
Grid.Row="1"
|
||||
MinHeight="200"
|
||||
Background="{TemplateBinding Background}"
|
||||
IsVisible="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CalendarButton}" TargetType="CalendarButton">
|
||||
<Setter Property="ClickMode" Value="Release" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<!-- These are actually set on the CalendarView in WinUI -->
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarItemCalendarButtonBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarItemCalendarButtonBorderBrush}" />
|
||||
<Setter Property="CalendarButton.CornerRadius" Value="{DynamicResource CalendarItemCalendarButtonCornerRadius}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ClipToBounds" Value="False" />
|
||||
<Setter Property="CalendarButton.HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="CalendarButton.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="CalendarButton.HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="CalendarButton.VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CalendarButton">
|
||||
<ContentControl
|
||||
Name="Content"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
FontSize="{TemplateBinding FontSize}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Adjusted :selected to look like :today from DayItem -->
|
||||
<Style Selector="^:selected">
|
||||
<Style Selector="^ /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarButtonSelectedBackground}" />
|
||||
<Setter Property="ContentControl.Foreground" Value="{DynamicResource CalendarItemCalendarButtonSelectedForeground}" />
|
||||
<Setter Property="ContentControl.FontWeight" Value="{DynamicResource CalendarItemCalendarButtonSelectedFontWeight}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:blackout /template/ ContentControl">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonBlackoutForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ ContentControl">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:inactive /template/ ContentControl">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonInactiveForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CalendarDayButton}" TargetType="CalendarDayButton">
|
||||
<Setter Property="ClickMode" Value="Release" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="Padding" Value="4" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarItemCalendarDayButtonBackground}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CalendarItemCalendarDayButtonCornerRadius}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarItemCalendarDayButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ClipToBounds" Value="False" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CalendarDayButton">
|
||||
<ContentControl
|
||||
Name="Content"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
FontSize="{TemplateBinding FontSize}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarDayButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarDayButtonPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:today /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarDayButtonTodayBackground}" />
|
||||
<Setter Property="ContentControl.Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonTodayForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Background" Value="{DynamicResource CalendarItemCalendarDayButtonSelectedBackground}" />
|
||||
<Setter Property="ContentControl.Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonSelectedForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:inactive /template/ ContentControl">
|
||||
<Setter Property="ContentControl.Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonInactiveForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:blackout /template/ ContentControl">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonBlackoutForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ ContentControl">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarDayButtonDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
135
src/Semi.Avalonia/Controls/CalendarDatePicker.axaml
Normal file
135
src/Semi.Avalonia/Controls/CalendarDatePicker.axaml
Normal file
@@ -0,0 +1,135 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="CalendarDatePickerButton" TargetType="Button">
|
||||
<Setter Property="Button.Foreground" Value="{DynamicResource CalendarDatePickerIconForeground}" />
|
||||
<Setter Property="Button.Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid Margin="{TemplateBinding Padding}" Background="Transparent">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource CalendarDatePickerIconGlyph}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerIconPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerIconPointeroverForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker">
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
|
||||
<Setter Property="CalendarDatePicker.IsTodayHighlighted" Value="True" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="4 0" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CalendarDatePicker">
|
||||
<Panel
|
||||
x:Name="LayoutRoot"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
ColumnDefinitions="*,Auto">
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
|
||||
Watermark="{TemplateBinding Watermark}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_BorderElement">
|
||||
<!-- By default the TextBox has its own focused state, override this to disable it here -->
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="TextBox#PART_TextBox:disabled">
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Watermark, ^ TextBlock#PART_FloatingWatermark">
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerTextForegroundDisabled}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
</TextBox>
|
||||
<Button
|
||||
Name="PART_Button"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,8,0"
|
||||
Cursor="Hand"
|
||||
Focusable="False"
|
||||
Theme="{DynamicResource CalendarDatePickerButton}" />
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
IsLightDismissEnabled="True"
|
||||
PlacementTarget="{TemplateBinding}">
|
||||
<Border Margin="8" BoxShadow="0 0 8 0 #1A000000">
|
||||
<Calendar
|
||||
Name="PART_Calendar"
|
||||
DisplayDate="{TemplateBinding DisplayDate}"
|
||||
DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
|
||||
DisplayDateStart="{TemplateBinding DisplayDateStart}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
|
||||
SelectedDate="{TemplateBinding SelectedDate,
|
||||
Mode=TwoWay}" />
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ Border#Background">
|
||||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerDisabledBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerDisabledBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Button#PART_Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerDisabledIconForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Focused State -->
|
||||
<Style Selector="^:focus-within /template/ Border#Background">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerFocusBorderBrush}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
101
src/Semi.Avalonia/Controls/CaptionButtons.axaml
Normal file
101
src/Semi.Avalonia/Controls/CaptionButtons.axaml
Normal file
@@ -0,0 +1,101 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
|
||||
<ControlTheme x:Key="CaptionButton" TargetType="Button">
|
||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||
<Setter Property="CornerRadius" Value="6" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="Padding" Value="4" />
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="Width" Value="28" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="Transparent"
|
||||
Content="{TemplateBinding Content}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{TemplateBinding Background}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{TemplateBinding BorderBrush}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="CaptionButtons">
|
||||
<StackPanel
|
||||
VerticalAlignment="Stretch"
|
||||
Orientation="Horizontal"
|
||||
Spacing="2"
|
||||
TextElement.FontSize="10">
|
||||
<Button x:Name="PART_FullScreenButton" Theme="{StaticResource CaptionButton}">
|
||||
<PathIcon
|
||||
Name="PART_FullScreenButtonIcon"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource WindowExpandGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button x:Name="PART_MinimiseButton" Theme="{StaticResource CaptionButton}">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource WindowMinimizeGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button x:Name="PART_RestoreButton" Theme="{StaticResource CaptionButton}">
|
||||
<PathIcon
|
||||
Name="PART_RestoreButtonIcon"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource WindowMaximizeGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="PART_CloseButton"
|
||||
Background="{DynamicResource CaptionButtonClosePointeroverBackground}"
|
||||
BorderBrush="{DynamicResource CaptionButtonClosePressedBackground}"
|
||||
Theme="{StaticResource CaptionButton}">
|
||||
<Button.Styles>
|
||||
<Style Selector="Button:pointerover">
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</Style>
|
||||
<Style Selector="Button:pressed">
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</Style>
|
||||
</Button.Styles>
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource WindowCloseIconGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:maximized /template/ PathIcon#PART_RestoreButtonIcon">
|
||||
<Setter Property="Data" Value="{DynamicResource WindowRestoreGlyph}" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ PathIcon#PART_FullScreenButtonIcon">
|
||||
<Setter Property="Data" Value="{DynamicResource WindowCollapseGlyph}" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ Button#PART_RestoreButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:fullscreen /template/ Button#PART_MinimiseButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
22
src/Semi.Avalonia/Controls/Carousel.axaml
Normal file
22
src/Semi.Avalonia/Controls/Carousel.axaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type Carousel}" TargetType="Carousel">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<CarouselPresenter
|
||||
Margin="{TemplateBinding Padding}"
|
||||
IsVirtualized="{TemplateBinding IsVirtualized}"
|
||||
Items="{TemplateBinding Items}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||
PageTransition="{TemplateBinding PageTransition}"
|
||||
SelectedIndex="{TemplateBinding SelectedIndex}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -5,15 +5,24 @@
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Border.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Button.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Calendar.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/CaptionButtons.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Carousel.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/CheckBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContentControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DropdownButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/GridSplitter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ItemsControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Label.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ListBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ManagedFileChooser.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Menu.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/NotificationCard.axaml" />
|
||||
@@ -25,13 +34,20 @@
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/RepeatButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/SelectableTextBlock.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ScrollViewer.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Slider.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/SplitButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/SplitView.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TabControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TabItem.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TabStrip.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TextBlock.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TextBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TimePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TitleBar.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ToggleButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ToggleSwitch.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Tooltip.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TransitioningContentControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TreeView.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/UserControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Window.axaml" />
|
||||
|
||||
235
src/Semi.Avalonia/Controls/DatePicker.axaml
Normal file
235
src/Semi.Avalonia/Controls/DatePicker.axaml
Normal file
@@ -0,0 +1,235 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type DatePickerPresenter}" TargetType="DatePickerPresenter">
|
||||
<Setter Property="Width" Value="296" />
|
||||
<Setter Property="MinWidth" Value="296" />
|
||||
<Setter Property="MaxHeight" Value="300" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="CornerRadius" Value="6" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DatePickerPresenter">
|
||||
<Border
|
||||
Name="Background"
|
||||
Margin="{DynamicResource DateTimePickerFlyoutBorderMargin}"
|
||||
Padding="{DynamicResource DateTimePickerFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource DateTimePickerFlyoutBoxShadow}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid Name="ContentPanel" RowDefinitions="*,Auto">
|
||||
<Grid Name="PART_PickerContainer">
|
||||
<Grid.Styles>
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Setter Property="Theme" Value="{StaticResource DateTimePickerItem}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<!-- Column Definitions set in code, ignore here -->
|
||||
<Panel Name="PART_MonthHost">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_MonthSelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="Month"
|
||||
ShouldLoop="True" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_MonthUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_MonthDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
<Panel Name="PART_DayHost">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_DaySelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="Day"
|
||||
ShouldLoop="True" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_DayUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_DayDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
<Panel Name="PART_YearHost">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_YearSelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="Year"
|
||||
ShouldLoop="False" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_YearUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_YearDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
<Rectangle
|
||||
Name="PART_FirstSpacer"
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
<Rectangle
|
||||
Name="PART_SecondSpacer"
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
Name="AcceptDismissGrid"
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="*,*">
|
||||
<Button
|
||||
Name="PART_AcceptButton"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Theme="{StaticResource DateTimePickerButton}">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_DismissButton"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
FontSize="16"
|
||||
Theme="{StaticResource DateTimePickerButton}">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.ColumnSpan="2"
|
||||
Height="1"
|
||||
VerticalAlignment="Top"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ Panel">
|
||||
<Style Selector="^:pointerover RepeatButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type DatePicker}" TargetType="DatePicker">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DatePicker">
|
||||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
|
||||
<Button
|
||||
Name="PART_FlyoutButton"
|
||||
Width="298"
|
||||
MinWidth="298"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Cursor="Hand"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}"
|
||||
Theme="{StaticResource DateTimePickerFlyoutButton}">
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Grid
|
||||
Name="PART_ButtonContentGrid"
|
||||
Grid.Column="0"
|
||||
ColumnDefinitions="78*,Auto,132*,Auto,78*">
|
||||
<TextBlock
|
||||
Name="PART_DayTextBlock"
|
||||
Padding="12,4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="day" />
|
||||
<TextBlock
|
||||
Name="PART_MonthTextBlock"
|
||||
Padding="12,4"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="month"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
Name="PART_YearTextBlock"
|
||||
Padding="12,4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="year" />
|
||||
<Rectangle
|
||||
x:Name="PART_FirstSpacer"
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
<Rectangle
|
||||
x:Name="PART_SecondSpacer"
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
</Grid>
|
||||
<PathIcon
|
||||
Name="PART_Icon"
|
||||
Grid.Column="1"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="0,0,8,0"
|
||||
Data="{DynamicResource DatePickerIconGlyph}"
|
||||
Foreground="{DynamicResource DateTimePickerIconForeground}" />
|
||||
</Grid>
|
||||
</Button>
|
||||
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
IsLightDismissEnabled="True"
|
||||
PlacementMode="Bottom"
|
||||
PlacementTarget="{TemplateBinding}"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<DatePickerPresenter Name="PART_PickerPresenter" />
|
||||
</Popup>
|
||||
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:disabled /template/ PathIcon#PART_Icon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonDisabledIconForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Changes foreground for watermark text when SelectedDate is null -->
|
||||
<Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
129
src/Semi.Avalonia/Controls/DateTimePickerShared.axaml
Normal file
129
src/Semi.Avalonia/Controls/DateTimePickerShared.axaml
Normal file
@@ -0,0 +1,129 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
|
||||
<ControlTheme x:Key="DateTimePickerFlyoutButton" TargetType="Button">
|
||||
<Setter Property="RenderTransform" Value="none" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonDisabledBackground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- Theme for the items displayed in the selectors -->
|
||||
<ControlTheme
|
||||
x:Key="DateTimePickerItem"
|
||||
BasedOn="{StaticResource {x:Type ListBoxItem}}"
|
||||
TargetType="ListBoxItem">
|
||||
<Setter Property="ListBoxItem.CornerRadius" Value="0" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerListItemBackground}" />
|
||||
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^.MonthItem">
|
||||
<Setter Property="Padding" Value="{DynamicResource DatePickerFlyoutPresenterMonthPadding}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- This is used for both the accept/dismiss & buttons in the presenter -->
|
||||
<ControlTheme x:Key="DateTimePickerButton" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackground}" />
|
||||
<Setter Property="Padding" Value="0 8" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonPointeroverForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed /template/ ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonPressedForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonPressedBackground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
x:Key="DateTimePickerUpButton"
|
||||
BasedOn="{StaticResource DateTimePickerButton}"
|
||||
TargetType="RepeatButton">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
<Setter Property="Padding" Value="0 4" />
|
||||
<Setter Property="Content">
|
||||
<Template>
|
||||
<PathIcon
|
||||
Width="8"
|
||||
Height="8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DateTimePickerButtonUpGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
x:Key="DateTimePickerDownButton"
|
||||
BasedOn="{StaticResource DateTimePickerButton}"
|
||||
TargetType="RepeatButton">
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
<Setter Property="Padding" Value="0 4" />
|
||||
<Setter Property="Content">
|
||||
<Template>
|
||||
<PathIcon
|
||||
Width="8"
|
||||
Height="8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DateTimePickerButtonDownGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
234
src/Semi.Avalonia/Controls/DropdownButton.axaml
Normal file
234
src/Semi.Avalonia/Controls/DropdownButton.axaml
Normal file
@@ -0,0 +1,234 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultBackground}" />
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
|
||||
<Setter Property="DropDownButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
|
||||
<Setter Property="DropDownButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
|
||||
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
|
||||
<Setter Property="DropDownButton.RenderTransform" Value="none" />
|
||||
<Setter Property="DropDownButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
|
||||
<Setter Property="DropDownButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
|
||||
<Setter Property="DropDownButton.HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="DropDownButton.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="DropDownButton.MinHeight" Value="12" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DropDownButton">
|
||||
<Border
|
||||
x:Name="RootBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid x:Name="InnerGrid" ColumnDefinitions="*,Auto">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Grid.Column="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
<PathIcon
|
||||
x:Name="DropDownGlyph"
|
||||
Grid.Column="1"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Margin="0,0,8,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DropdownButtonIconGlyph}"
|
||||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
||||
IsHitTestVisible="False"
|
||||
UseLayoutRounding="False" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Secondary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Warning">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Danger">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Large">
|
||||
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonLargePadding}" />
|
||||
</Style>
|
||||
<Style Selector="^.Small">
|
||||
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonSmallPadding}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="SolidDropdownButton" TargetType="DropDownButton">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
|
||||
<Setter Property="DropDownButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
|
||||
<Setter Property="DropDownButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
|
||||
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
|
||||
<Setter Property="DropDownButton.RenderTransform" Value="none" />
|
||||
<Setter Property="DropDownButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
|
||||
<Setter Property="DropDownButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
|
||||
<Setter Property="DropDownButton.HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="DropDownButton.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="DropDownButton.MinHeight" Value="12" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DropDownButton">
|
||||
<Border
|
||||
x:Name="RootBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid x:Name="InnerGrid" ColumnDefinitions="*,Auto">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Grid.Column="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
<PathIcon
|
||||
x:Name="DropDownGlyph"
|
||||
Grid.Column="1"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Margin="0,0,8,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DropdownButtonIconGlyph}"
|
||||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
||||
IsHitTestVisible="False"
|
||||
UseLayoutRounding="False" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Secondary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Warning">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Danger">
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
x:Key="BorderlessDropdownButton"
|
||||
BasedOn="{StaticResource {x:Type DropDownButton}}"
|
||||
TargetType="DropDownButton">
|
||||
<Setter Property="DropDownButton.Background" Value="Transparent" />
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="Transparent" />
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="DropDownButton.BorderBrush" Value="Transparent" />
|
||||
<Setter Property="DropDownButton.Background" Value="Transparent" />
|
||||
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
25
src/Semi.Avalonia/Controls/GridSplitter.axaml
Normal file
25
src/Semi.Avalonia/Controls/GridSplitter.axaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type GridSplitter}" TargetType="GridSplitter">
|
||||
<Setter Property="Focusable" Value="True" />
|
||||
<Setter Property="MinWidth" Value="6" />
|
||||
<Setter Property="MinHeight" Value="6" />
|
||||
<Setter Property="GridSplitter.Padding" Value="2" />
|
||||
<Setter Property="Background" Value="{DynamicResource GridSplitterBackground}" />
|
||||
<Setter Property="PreviewContent">
|
||||
<Template>
|
||||
<Rectangle Fill="{DynamicResource GridSplitterPreviewBackground}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="GridSplitter">
|
||||
<Border Padding="{TemplateBinding Padding}" Background="Transparent">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
187
src/Semi.Avalonia/Controls/ManagedFileChooser.axaml
Normal file
187
src/Semi.Avalonia/Controls/ManagedFileChooser.axaml
Normal file
@@ -0,0 +1,187 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs">
|
||||
<!-- Add Resources Here -->
|
||||
<Design.PreviewWith>
|
||||
<Border
|
||||
Width="800"
|
||||
Height="500"
|
||||
Padding="20">
|
||||
<dialogs:ManagedFileChooser />
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<dialogs:ResourceSelectorConverter x:Key="Icons">
|
||||
<PathGeometry x:Key="Icon_Folder">M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z</PathGeometry>
|
||||
<PathGeometry x:Key="Icon_File">M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z</PathGeometry>
|
||||
<PathGeometry x:Key="Icon_Volume">M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z</PathGeometry>
|
||||
</dialogs:ResourceSelectorConverter>
|
||||
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooser}" TargetType="dialogs:ManagedFileChooser">
|
||||
<Setter Property="dialogs:ManagedFileChooser.Template">
|
||||
<ControlTemplate TargetType="dialogs:ManagedFileChooser">
|
||||
<DockPanel>
|
||||
<Border
|
||||
Padding="4"
|
||||
DockPanel.Dock="Left"
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<ListBox
|
||||
x:Name="PART_QuickLinks"
|
||||
Focusable="False"
|
||||
Items="{Binding QuickLinks}"
|
||||
SelectedIndex="{Binding QuickLinksSelectedIndex}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{Binding IconKey, Converter={StaticResource Icons}}"
|
||||
Foreground="{DynamicResource ManagedFileChooserIconForeground}" />
|
||||
<TextBlock Foreground="{DynamicResource ManagedFileChooserTextForeground}" Text="{Binding DisplayName}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<DockPanel
|
||||
x:Name="NavBar"
|
||||
Margin="8,5,8,0"
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Top">
|
||||
<Button
|
||||
Command="{Binding GoUp}"
|
||||
DockPanel.Dock="Left"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource ManagedFileChooserUpButtonGlyph}"
|
||||
Foreground="{DynamicResource ManagedFileChooserIconForeground}" />
|
||||
</Button>
|
||||
<TextBox x:Name="Location" Text="{Binding Location}">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Command="{Binding EnterPressed}" Gesture="Enter" />
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
</DockPanel>
|
||||
<DockPanel Margin="8,0,8,8" DockPanel.Dock="Bottom">
|
||||
<DockPanel Margin="0,0,0,8" DockPanel.Dock="Top">
|
||||
<ComboBox
|
||||
DockPanel.Dock="Right"
|
||||
IsVisible="{Binding ShowFilters}"
|
||||
Items="{Binding Filters}"
|
||||
SelectedItem="{Binding SelectedFilter}" />
|
||||
<TextBox
|
||||
Margin="0,0,8,0"
|
||||
IsVisible="{Binding !SelectingFolder}"
|
||||
Text="{Binding FileName}"
|
||||
Watermark="File name" />
|
||||
</DockPanel>
|
||||
<CheckBox
|
||||
VerticalAlignment="Center"
|
||||
Content="Show hidden files"
|
||||
DockPanel.Dock="Left"
|
||||
IsChecked="{Binding ShowHiddenFiles}" />
|
||||
<UniformGrid
|
||||
x:Name="Finalize"
|
||||
HorizontalAlignment="Right"
|
||||
Rows="1">
|
||||
<Button
|
||||
Margin="8,0"
|
||||
Classes="Primary"
|
||||
Command="{Binding Ok}">
|
||||
OK
|
||||
</Button>
|
||||
<Button
|
||||
Margin="8,0"
|
||||
Classes="Danger"
|
||||
Command="{Binding Cancel}">
|
||||
Cancel
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
</DockPanel>
|
||||
<Border Padding="8" Theme="{DynamicResource CardBorder}">
|
||||
<DockPanel Grid.IsSharedSizeScope="True">
|
||||
<Grid
|
||||
Margin="0,0,0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
ClipToBounds="True"
|
||||
DockPanel.Dock="Top">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="Margin" Value="8 0 0 0 " />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="20" SharedSizeGroup="Icon" />
|
||||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition Width="275" SharedSizeGroup="Name" />
|
||||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition Width="200" SharedSizeGroup="Modified" />
|
||||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition Width="150" SharedSizeGroup="Type" />
|
||||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition Width="200" SharedSizeGroup="Size" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<GridSplitter Grid.Column="1" Width="1" />
|
||||
<TextBlock Grid.Column="2" Text="Name" />
|
||||
<GridSplitter Grid.Column="3" Width="1" />
|
||||
<TextBlock Grid.Column="4" Text="Date Modified" />
|
||||
<GridSplitter Grid.Column="5" Width="1" />
|
||||
<TextBlock Grid.Column="6" Text="Type" />
|
||||
<GridSplitter Grid.Column="7" Width="1" />
|
||||
<TextBlock Grid.Column="8" Text="Size" />
|
||||
</Grid>
|
||||
<ListBox Name="PART_Files" Items="{Binding Items}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Icon" />
|
||||
<ColumnDefinition SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition SharedSizeGroup="Name" />
|
||||
<ColumnDefinition SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition SharedSizeGroup="Modified" />
|
||||
<ColumnDefinition SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition SharedSizeGroup="Type" />
|
||||
<ColumnDefinition SharedSizeGroup="Splitter" />
|
||||
<ColumnDefinition SharedSizeGroup="Size" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{Binding IconKey, Converter={StaticResource Icons}}"
|
||||
Foreground="{DynamicResource ManagedFileChooserIconForeground}" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Foreground="{DynamicResource ManagedFileChooserTextForeground}"
|
||||
Text="{Binding DisplayName}" />
|
||||
<TextBlock
|
||||
Grid.Column="4"
|
||||
Foreground="{DynamicResource ManagedFileChooserTextForeground}"
|
||||
Text="{Binding Modified}" />
|
||||
<TextBlock
|
||||
Grid.Column="6"
|
||||
Foreground="{DynamicResource ManagedFileChooserTextForeground}"
|
||||
Text="{Binding Type}" />
|
||||
<TextBlock Grid.Column="8" Foreground="{DynamicResource ManagedFileChooserTextForeground}">
|
||||
<TextBlock.Text>
|
||||
<Binding Path="Size">
|
||||
<Binding.Converter>
|
||||
<dialogs:FileSizeStringConverter />
|
||||
</Binding.Converter>
|
||||
</Binding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -172,18 +172,19 @@
|
||||
</Border>
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
HorizontalOffset="{DynamicResource MenuFlyoutSubItemPopupHorizontalOffset}"
|
||||
HorizontalOffset="-8"
|
||||
IsLightDismissEnabled="False"
|
||||
IsOpen="{TemplateBinding IsSubMenuOpen,
|
||||
Mode=TwoWay}"
|
||||
PlacementMode="Right"
|
||||
VerticalOffset="-4"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
MinWidth="{DynamicResource MenuFlyoutMinWidth}"
|
||||
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
|
||||
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
|
||||
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
|
||||
Margin="0,4"
|
||||
Margin="8"
|
||||
Padding="{DynamicResource MenuFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource MenuFlyoutBackground}"
|
||||
@@ -274,24 +275,27 @@
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
HorizontalOffset="-8"
|
||||
IsLightDismissEnabled="True"
|
||||
IsOpen="{TemplateBinding IsSubMenuOpen,
|
||||
Mode=TwoWay}"
|
||||
OverlayInputPassThroughElement="{Binding $parent[Menu]}"
|
||||
VerticalOffset="-4"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<Border
|
||||
MinWidth="{DynamicResource MenuFlyoutMinWidth}"
|
||||
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
|
||||
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
|
||||
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
|
||||
Margin="0,4"
|
||||
Margin="8"
|
||||
Padding="{DynamicResource MenuFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource MenuFlyoutBackground}"
|
||||
BorderBrush="{DynamicResource MenuFlyoutBorderBrush}"
|
||||
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
|
||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||
<ScrollViewer Padding="{DynamicResource MenuFlyoutPadding}" Theme="{StaticResource MenuScrollViewer}">
|
||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<Setter Property="MenuFlyoutPresenter.BorderBrush" Value="{DynamicResource MenuFlyoutBorderBrush}" />
|
||||
<Setter Property="MenuFlyoutPresenter.BorderThickness" Value="{DynamicResource MenuFlyoutBorderThickness}" />
|
||||
<Setter Property="MenuFlyoutPresenter.Padding" Value="{DynamicResource MenuFlyoutPadding}" />
|
||||
<Setter Property="MenuFlyoutPresenter.FontSize" Value="{DynamicResource TextBlockFontSize}" />
|
||||
<Setter Property="MenuFlyoutPresenter.FontWeight" Value="{DynamicResource TextBlockFontWeight}" />
|
||||
<Setter Property="MenuFlyoutPresenter.Foreground" Value="{DynamicResource TextBlockDefaultForeground}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="MenuFlyoutPresenter.Margin" Value="4" />
|
||||
@@ -17,7 +20,7 @@
|
||||
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
|
||||
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
|
||||
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
|
||||
Margin="0,4"
|
||||
Margin="8"
|
||||
Padding="{DynamicResource MenuFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource MenuFlyoutBackground}"
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<ControlTemplate TargetType="NotificationCard">
|
||||
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
|
||||
<Border
|
||||
Margin="4"
|
||||
BoxShadow="0 0 14 #1A000000"
|
||||
Margin="8"
|
||||
BoxShadow="0 0 8 0 #1A000000"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
|
||||
@@ -20,4 +20,21 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</VisualLayerManager>
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
||||
xmlns:dialog="using:Avalonia.Dialogs">
|
||||
<Design.PreviewWith>
|
||||
<StackPanel>
|
||||
<ScrollBar Width="200" Orientation="Horizontal" />
|
||||
<ScrollBar Height="200" Orientation="Vertical" />
|
||||
<ScrollViewer
|
||||
Width="200" Height="200"
|
||||
HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">
|
||||
Width="200"
|
||||
Height="200"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
VerticalScrollBarVisibility="Visible">
|
||||
<Border
|
||||
Width="400" Height="400"
|
||||
Width="400"
|
||||
Height="400"
|
||||
Background="aqua" />
|
||||
</ScrollViewer>
|
||||
<dialog:ManagedFileChooser />
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
<ControlTheme x:Key="{x:Type ScrollBar}" TargetType="ScrollBar">
|
||||
@@ -23,11 +29,14 @@
|
||||
<Border Background="{DynamicResource ScrollBarBackground}" UseLayoutRounding="False">
|
||||
<Grid Name="PART_RootGrid" ColumnDefinitions="Auto,*,Auto">
|
||||
<RepeatButton
|
||||
Name="PART_LineUpButton" Grid.Row="0"
|
||||
Name="PART_LineUpButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
MinWidth="{DynamicResource ScrollBarThickness}"
|
||||
VerticalAlignment="Center" Classes="repeat"
|
||||
CornerRadius="0" Focusable="False">
|
||||
VerticalAlignment="Center"
|
||||
Classes="repeat"
|
||||
CornerRadius="0"
|
||||
Focusable="False">
|
||||
<Path Data="M 4 0 L 4 8 L 0 4 Z" />
|
||||
</RepeatButton>
|
||||
<Track
|
||||
@@ -40,25 +49,34 @@
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_PageUpButton" MinWidth="0"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Classes="repeattrack" CornerRadius="0"
|
||||
Name="PART_PageUpButton"
|
||||
MinWidth="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Classes="repeattrack"
|
||||
CornerRadius="0"
|
||||
Focusable="False" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_PageDownButton" MinWidth="0"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Classes="repeattrack" CornerRadius="0"
|
||||
Name="PART_PageDownButton"
|
||||
MinWidth="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Classes="repeattrack"
|
||||
CornerRadius="0"
|
||||
Focusable="False" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb Name="thumb" />
|
||||
</Track>
|
||||
<RepeatButton
|
||||
Name="PART_LineDownButton" Grid.Column="2"
|
||||
Name="PART_LineDownButton"
|
||||
Grid.Column="2"
|
||||
MinWidth="{DynamicResource ScrollBarThickness}"
|
||||
VerticalAlignment="Center" Classes="repeat"
|
||||
CornerRadius="0" Focusable="False">
|
||||
VerticalAlignment="Center"
|
||||
Classes="repeat"
|
||||
CornerRadius="0"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 0 L 4 4 L 0 8 Z" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
@@ -73,14 +91,18 @@
|
||||
<Border Background="{DynamicResource ScrollBarBackground}" UseLayoutRounding="False">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<RepeatButton
|
||||
Name="PART_LineUpButton" Grid.Row="0"
|
||||
Name="PART_LineUpButton"
|
||||
Grid.Row="0"
|
||||
MinHeight="{DynamicResource ScrollBarThickness}"
|
||||
HorizontalAlignment="Center" Classes="repeat"
|
||||
CornerRadius="0" Focusable="False">
|
||||
HorizontalAlignment="Center"
|
||||
Classes="repeat"
|
||||
CornerRadius="0"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 4 L 8 4 L 4 0 Z" />
|
||||
</RepeatButton>
|
||||
<Track
|
||||
Grid.Row="1" IsDirectionReversed="True"
|
||||
Grid.Row="1"
|
||||
IsDirectionReversed="True"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
@@ -89,25 +111,34 @@
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_PageUpButton" MinHeight="0"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Classes="repeattrack" CornerRadius="0"
|
||||
Name="PART_PageUpButton"
|
||||
MinHeight="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Classes="repeattrack"
|
||||
CornerRadius="0"
|
||||
Focusable="False" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_PageDownButton" MinHeight="0"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Classes="repeattrack" CornerRadius="0"
|
||||
Name="PART_PageDownButton"
|
||||
MinHeight="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Classes="repeattrack"
|
||||
CornerRadius="0"
|
||||
Focusable="False" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb Name="thumb" />
|
||||
</Track>
|
||||
<RepeatButton
|
||||
Name="PART_LineDownButton" Grid.Row="2"
|
||||
Name="PART_LineDownButton"
|
||||
Grid.Row="2"
|
||||
MinHeight="{DynamicResource ScrollBarThickness}"
|
||||
HorizontalAlignment="Center" Classes="repeat"
|
||||
CornerRadius="0" Focusable="False">
|
||||
HorizontalAlignment="Center"
|
||||
Classes="repeat"
|
||||
CornerRadius="0"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 0 L 4 4 L 8 0 Z" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
@@ -122,7 +153,8 @@
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="24" UseLayoutRounding="False" />
|
||||
CornerRadius="24"
|
||||
UseLayoutRounding="False" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@@ -185,8 +217,10 @@
|
||||
</ScrollContentPresenter.GestureRecognizers>
|
||||
</ScrollContentPresenter>
|
||||
<ScrollBar
|
||||
Name="horizontalScrollBar" Grid.Row="1"
|
||||
Grid.Column="0" Focusable="False"
|
||||
Name="horizontalScrollBar"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Focusable="False"
|
||||
LargeChange="{Binding LargeChange.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Maximum="{TemplateBinding HorizontalScrollBarMaximum}"
|
||||
Orientation="Horizontal"
|
||||
@@ -196,8 +230,10 @@
|
||||
Value="{TemplateBinding HorizontalScrollBarValue,
|
||||
Mode=TwoWay}" />
|
||||
<ScrollBar
|
||||
Name="verticalScrollBar" Grid.Row="0"
|
||||
Grid.Column="1" Focusable="False"
|
||||
Name="verticalScrollBar"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Focusable="False"
|
||||
LargeChange="{Binding LargeChange.Height, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Maximum="{TemplateBinding VerticalScrollBarMaximum}"
|
||||
Orientation="Vertical"
|
||||
@@ -207,7 +243,8 @@
|
||||
Value="{TemplateBinding VerticalScrollBarValue,
|
||||
Mode=TwoWay}" />
|
||||
<Panel
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource ColorScrollBarBackground}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -228,7 +265,8 @@
|
||||
<ControlTemplate TargetType="ScrollViewer">
|
||||
<DockPanel>
|
||||
<RepeatButton
|
||||
Background="Transparent" BorderThickness="0"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
DockPanel.Dock="Top">
|
||||
<RepeatButton.IsVisible>
|
||||
@@ -242,7 +280,8 @@
|
||||
<Path Data="M 0 4 L 8 4 L 4 0 Z" />
|
||||
</RepeatButton>
|
||||
<RepeatButton
|
||||
Background="Transparent" BorderThickness="0"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
DockPanel.Dock="Bottom">
|
||||
<RepeatButton.IsVisible>
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<MenuFlyout x:Key="SelectableTextBlockContextFlyout" Placement="Bottom">
|
||||
<MenuItem
|
||||
x:Name="SelectableTextBlockContextFlyoutCopyItem"
|
||||
Command="{Binding $parent[SelectableTextBlock].Copy}"
|
||||
Header="Copy"
|
||||
InputGesture="{x:Static TextBox.CopyGesture}"
|
||||
IsEnabled="{Binding $parent[SelectableTextBlock].CanCopy}" />
|
||||
</MenuFlyout>
|
||||
|
||||
<ControlTheme x:Key="{x:Type SelectableTextBlock}" TargetType="SelectableTextBlock">
|
||||
<Setter Property="SelectableTextBlock.Foreground" Value="{DynamicResource TextBlockDefaultForeground}" />
|
||||
<Setter Property="SelectableTextBlock.FontSize" Value="{DynamicResource TextBlockFontSize}" />
|
||||
@@ -34,6 +44,10 @@
|
||||
<Style Selector="^.Delete">
|
||||
<Setter Property="SelectableTextBlock.TextDecorations" Value="StrikeThrough" />
|
||||
</Style>
|
||||
<Style Selector="^[IsEnabled=True]">
|
||||
<Setter Property="Cursor" Value="IBeam" />
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource SelectableTextBlockContextFlyout}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
<ControlTheme
|
||||
x:Key="TitleSelectableTextBlock"
|
||||
|
||||
293
src/Semi.Avalonia/Controls/Slider.axaml
Normal file
293
src/Semi.Avalonia/Controls/Slider.axaml
Normal file
@@ -0,0 +1,293 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="SliderHorizontalRepeatButton" TargetType="RepeatButton">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="RepeatButton">
|
||||
<Grid>
|
||||
<Border
|
||||
Name="FocusTarget"
|
||||
Margin="0,-10"
|
||||
Background="Transparent" />
|
||||
<Border
|
||||
Name="TrackBackground"
|
||||
Height="{DynamicResource SliderTrackWidth}"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
VerticalAlignment="Center"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{DynamicResource SliderTrackCornerRadius}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="SliderVerticalRepeatButton" TargetType="RepeatButton">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="RepeatButton">
|
||||
<Grid>
|
||||
<Border
|
||||
Name="FocusTarget"
|
||||
Margin="0,-10"
|
||||
Background="Transparent" />
|
||||
<Border
|
||||
Name="TrackBackground"
|
||||
Width="{DynamicResource SliderTrackWidth}"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
HorizontalAlignment="Center"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{DynamicResource SliderTrackCornerRadius}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="SliderThumbTheme" TargetType="Thumb">
|
||||
<Setter Property="Thumb.CornerRadius" Value="{DynamicResource SliderThumbCornerRadius}" />
|
||||
<Setter Property="Thumb.Cursor" Value="Hand" />
|
||||
<Setter Property="Thumb.Background" Value="{DynamicResource SliderThumbBackground}" />
|
||||
<Setter Property="Thumb.BorderBrush" Value="{DynamicResource SliderThumbBorderBrush}" />
|
||||
<Setter Property="Thumb.BorderThickness" Value="{DynamicResource SliderThumbBorderThickness}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Border
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ Border">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbPressedBorderBrush}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type Slider}" TargetType="Slider">
|
||||
<Setter Property="Background" Value="{DynamicResource SliderTrackBackground}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource SliderBorderThickness}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SliderTrackForeground}" />
|
||||
<Style Selector="^:horizontal">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Slider">
|
||||
<Border
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid
|
||||
x:Name="SliderContainer"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Background="Transparent">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<Grid x:Name="HorizontalTemplate" MinHeight="50">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="15" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="15" />
|
||||
</Grid.RowDefinitions>
|
||||
<TickBar
|
||||
Name="TopTickBar"
|
||||
Grid.Row="0"
|
||||
Height="{DynamicResource SliderTickHorizontalHeight}"
|
||||
Margin="0,0,0,4"
|
||||
VerticalAlignment="Bottom"
|
||||
Fill="{DynamicResource SliderTickForeground}"
|
||||
IsVisible="False"
|
||||
Maximum="{TemplateBinding Slider.Maximum}"
|
||||
Minimum="{TemplateBinding Slider.Minimum}"
|
||||
Orientation="{TemplateBinding Slider.Orientation}"
|
||||
Placement="Top"
|
||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<TickBar
|
||||
Name="BottomTickBar"
|
||||
Grid.Row="2"
|
||||
Height="{DynamicResource SliderTickHorizontalHeight}"
|
||||
Margin="0,4,0,0"
|
||||
VerticalAlignment="Top"
|
||||
Fill="{DynamicResource SliderTickForeground}"
|
||||
IsVisible="False"
|
||||
Maximum="{TemplateBinding Slider.Maximum}"
|
||||
Minimum="{TemplateBinding Slider.Minimum}"
|
||||
Orientation="{TemplateBinding Slider.Orientation}"
|
||||
Placement="Bottom"
|
||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<Track
|
||||
Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="Horizontal"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_DecreaseButton"
|
||||
Background="{TemplateBinding Foreground}"
|
||||
Focusable="False"
|
||||
Theme="{StaticResource SliderHorizontalRepeatButton}" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_IncreaseButton"
|
||||
Background="{TemplateBinding Background}"
|
||||
Focusable="False"
|
||||
Theme="{StaticResource SliderHorizontalRepeatButton}" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb
|
||||
Name="thumb"
|
||||
Width="{DynamicResource SliderThumbWidth}"
|
||||
Height="{DynamicResource SliderThumbHeight}"
|
||||
DataContext="{TemplateBinding Value}"
|
||||
Theme="{StaticResource SliderThumbTheme}" />
|
||||
</Track>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^:vertical">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid
|
||||
x:Name="SliderContainer"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Background="{DynamicResource SliderContainerBackground}">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<Grid
|
||||
x:Name="VerticalTemplate"
|
||||
MinWidth="{DynamicResource SliderVerticalWidth}"
|
||||
RowDefinitions="*,Auto,Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{DynamicResource SliderPreContentMargin}" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="{DynamicResource SliderPostContentMargin}" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TickBar
|
||||
Name="LeftTickBar"
|
||||
Grid.RowSpan="3"
|
||||
Width="{DynamicResource SliderTickVerticalWidth}"
|
||||
Margin="0,0,4,0"
|
||||
HorizontalAlignment="Right"
|
||||
Fill="{DynamicResource SliderTickForeground}"
|
||||
IsVisible="False"
|
||||
Maximum="{TemplateBinding Slider.Maximum}"
|
||||
Minimum="{TemplateBinding Slider.Minimum}"
|
||||
Orientation="{TemplateBinding Slider.Orientation}"
|
||||
Placement="Left"
|
||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<TickBar
|
||||
Name="RightTickBar"
|
||||
Grid.RowSpan="3"
|
||||
Grid.Column="2"
|
||||
Width="{DynamicResource SliderTickVerticalWidth}"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Fill="{DynamicResource SliderTickForeground}"
|
||||
IsVisible="False"
|
||||
Maximum="{TemplateBinding Slider.Maximum}"
|
||||
Minimum="{TemplateBinding Slider.Minimum}"
|
||||
Orientation="{TemplateBinding Slider.Orientation}"
|
||||
Placement="Right"
|
||||
TickFrequency="{TemplateBinding Slider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<Track
|
||||
Name="PART_Track"
|
||||
Grid.RowSpan="3"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="1"
|
||||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="Vertical"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_DecreaseButton"
|
||||
Background="{TemplateBinding Foreground}"
|
||||
Focusable="False"
|
||||
Theme="{StaticResource SliderVerticalRepeatButton}" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton
|
||||
Name="PART_IncreaseButton"
|
||||
Background="{TemplateBinding Background}"
|
||||
Focusable="False"
|
||||
Theme="{StaticResource SliderVerticalRepeatButton}" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb
|
||||
Name="thumb"
|
||||
Width="{DynamicResource SliderThumbWidth}"
|
||||
Height="{DynamicResource SliderThumbHeight}"
|
||||
DataContext="{TemplateBinding Value}"
|
||||
Theme="{StaticResource SliderThumbTheme}" />
|
||||
</Track>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.ToolTip /template/ Thumb">
|
||||
<Setter Property="ToolTip.Tip" Value="{Binding $parent[Slider].Value, Mode=OneWay, StringFormat='\{0:f\}'}" />
|
||||
<Setter Property="ToolTip.Placement" Value="Top" />
|
||||
<Setter Property="ToolTip.VerticalOffset" Value="-10" />
|
||||
<Setter Property="ToolTip.HorizontalOffset" Value="-15" />
|
||||
</Style>
|
||||
|
||||
<!-- TickBar Placement States -->
|
||||
|
||||
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#LeftTickBar, ^[TickPlacement=Outside] /template/ TickBar#LeftTickBar">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#TopTickBar, ^[TickPlacement=Outside] /template/ TickBar#TopTickBar">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#BottomTickBar, ^[TickPlacement=Outside] /template/ TickBar#BottomTickBar">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#RightTickBar, ^[TickPlacement=Outside] /template/ TickBar#RightTickBar">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled State -->
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ RepeatButton#PART_DecreaseButton">
|
||||
<Setter Property="Background" Value="{DynamicResource SliderTrackDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ RepeatButton#PART_IncreaseButton">
|
||||
<Setter Property="Background" Value="{DynamicResource SliderTrackDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Thumb">
|
||||
<Setter Property="Thumb.BorderBrush" Value="{DynamicResource SliderThumbDisabledBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
119
src/Semi.Avalonia/Controls/SplitButton.axaml
Normal file
119
src/Semi.Avalonia/Controls/SplitButton.axaml
Normal file
@@ -0,0 +1,119 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||
|
||||
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton">
|
||||
<Setter Property="SplitButton.Background" Value="{DynamicResource ButtonDefaultBackground}" />
|
||||
<Setter Property="SplitButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
<Setter Property="SplitButton.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
|
||||
<Setter Property="SplitButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
|
||||
<Setter Property="SplitButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
|
||||
<Setter Property="SplitButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
|
||||
<Setter Property="SplitButton.RenderTransform" Value="none" />
|
||||
<Setter Property="SplitButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
|
||||
<Setter Property="SplitButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
|
||||
<Setter Property="SplitButton.HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="SplitButton.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="SplitButton.MinHeight" Value="12" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="SplitButton">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
<Button
|
||||
x:Name="PART_PrimaryButton"
|
||||
Grid.Column="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Command="{TemplateBinding Command}"
|
||||
CommandParameter="{TemplateBinding CommandParameter}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="3 0 0 3"
|
||||
Focusable="False"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
KeyboardNavigation.IsTabStop="False" />
|
||||
|
||||
<Border
|
||||
x:Name="SeparatorBorder"
|
||||
Grid.Column="1"
|
||||
Width="{DynamicResource SplitButtonSeparatorWidth}"
|
||||
Background="White"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0.5" />
|
||||
|
||||
<Button
|
||||
x:Name="PART_SecondaryButton"
|
||||
Grid.Column="2"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="0 3 3 0"
|
||||
Focusable="False"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
KeyboardNavigation.IsTabStop="False">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource SplitButtonIconGlyph}"
|
||||
Foreground="{Binding $parent[Button].Foreground}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
||||
<Style Selector="^.Secondary /template/ Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary /template/ Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Warning /template/ Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Danger /template/ Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Secondary /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Tertiary /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Warning /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Danger /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
251
src/Semi.Avalonia/Controls/SplitView.axaml
Normal file
251
src/Semi.Avalonia/Controls/SplitView.axaml
Normal file
@@ -0,0 +1,251 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="using:System">
|
||||
<!-- Add Resources Here -->
|
||||
|
||||
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView">
|
||||
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
|
||||
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
|
||||
<Setter Property="PaneBackground" Value="{DynamicResource SplitViewPaneBackground}" />
|
||||
|
||||
<Style Selector="^:left">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="SplitView">
|
||||
<Grid Name="Container" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!-- why is this throwing a binding error? -->
|
||||
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Panel
|
||||
Name="PART_PaneRoot"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{TemplateBinding PaneBackground}"
|
||||
ClipToBounds="True"
|
||||
ZIndex="100">
|
||||
<ContentPresenter
|
||||
x:Name="PART_PanePresenter"
|
||||
Content="{TemplateBinding Pane}"
|
||||
ContentTemplate="{TemplateBinding PaneTemplate}" />
|
||||
<Rectangle
|
||||
Name="HCPaneBorder"
|
||||
Width="1"
|
||||
HorizontalAlignment="Right"
|
||||
Fill="{DynamicResource SplitViewSeparatorBackground}" />
|
||||
</Panel>
|
||||
|
||||
<Panel Name="ContentRoot">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
<Rectangle
|
||||
Name="LightDismissLayer"
|
||||
Fill="Transparent"
|
||||
IsVisible="False" />
|
||||
</Panel>
|
||||
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:overlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:compactinline">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:compactoverlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<!-- ColumnSpan should be 2 -->
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:inline">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:right">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid Name="Container" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Panel
|
||||
Name="PART_PaneRoot"
|
||||
HorizontalAlignment="Right"
|
||||
Background="{TemplateBinding PaneBackground}"
|
||||
ClipToBounds="True"
|
||||
ZIndex="100">
|
||||
<ContentPresenter
|
||||
x:Name="PART_PanePresenter"
|
||||
Content="{TemplateBinding Pane}"
|
||||
ContentTemplate="{TemplateBinding PaneTemplate}" />
|
||||
<Rectangle
|
||||
Name="HCPaneBorder"
|
||||
Width="1"
|
||||
HorizontalAlignment="Left"
|
||||
Fill="{DynamicResource SplitViewSeparatorBackground}" />
|
||||
</Panel>
|
||||
|
||||
<Panel Name="ContentRoot">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
<Rectangle Name="LightDismissLayer" />
|
||||
</Panel>
|
||||
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:overlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:compactinline">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:compactoverlay">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:inline">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:open">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition
|
||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
||||
Property="Width"
|
||||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition
|
||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
||||
Property="Opacity"
|
||||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Opacity" Value="1.0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:closed">
|
||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition
|
||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
||||
Property="Width"
|
||||
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<DoubleTransition
|
||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
||||
Property="Opacity"
|
||||
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
<Setter Property="Opacity" Value="0.0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:lightdismiss /template/ Rectangle#LightDismissLayer">
|
||||
<Setter Property="Fill" Value="#99000000" />
|
||||
</Style>
|
||||
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^:compactoverlay:open /template/ Rectangle#LightDismissLayer">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -24,7 +24,7 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Panel>
|
||||
<Label
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
@@ -37,24 +37,23 @@
|
||||
<Border
|
||||
Name="PART_SelectedPipe"
|
||||
Background="{DynamicResource TabItemLinePipeBackground}"
|
||||
CornerRadius="{DynamicResource ControlCornerRadius}"
|
||||
IsVisible="True" UseLayoutRounding="False" />
|
||||
IsVisible="True"
|
||||
UseLayoutRounding="False" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Selected state -->
|
||||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background -->
|
||||
<Style Selector="^:selected /template/ Label#PART_ContentPresenter">
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||
<Setter Property="Label.FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||
<Setter Property="ContentPresenter.FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Style Selector="^:pointerover /template/ Label#PART_ContentPresenter">
|
||||
<Setter Property="Label.Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="ContentPresenter.Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Border.Background" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||
@@ -88,7 +87,7 @@
|
||||
<Setter Property="Border.HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Border.VerticalAlignment" Value="Bottom" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Label#PART_ContentPresenter">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Margin" Value="0,0,0,4" />
|
||||
</Style>
|
||||
</Style>
|
||||
@@ -99,7 +98,7 @@
|
||||
<Setter Property="Border.HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Border.VerticalAlignment" Value="Top" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Label#PART_ContentPresenter">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Margin" Value="0,4,0,0" />
|
||||
</Style>
|
||||
</Style>
|
||||
@@ -122,7 +121,7 @@
|
||||
<Setter Property="Border.HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="Border.VerticalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Label#PART_ContentPresenter">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
111
src/Semi.Avalonia/Controls/TabStrip.axaml
Normal file
111
src/Semi.Avalonia/Controls/TabStrip.axaml
Normal file
@@ -0,0 +1,111 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type TabStrip}" TargetType="TabStrip">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Panel>
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
||||
Items="{TemplateBinding Items}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
<Border
|
||||
Name="PART_BorderSeparator"
|
||||
Height="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Setter Property="ItemsPanel">
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TabStripItem}" TargetType="TabStripItem">
|
||||
<Setter Property="TabStripItem.Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
||||
<Setter Property="TabStripItem.Foreground" Value="{DynamicResource TabItemLineHeaderForeground}" />
|
||||
<Setter Property="TabStripItem.Margin" Value="0" />
|
||||
<Setter Property="TabStripItem.Padding" Value="8 4" />
|
||||
<Setter Property="TabStripItem.MinHeight" Value="5" />
|
||||
<Setter Property="TabStripItem.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="TabStripItem.Template">
|
||||
<ControlTemplate TargetType="TabStripItem">
|
||||
<Border
|
||||
Name="PART_LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Margin="0,0,0,4"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
<Border
|
||||
Name="PART_SelectedPipe"
|
||||
Height="2"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{DynamicResource TabItemLinePipeBackground}"
|
||||
IsVisible="True"
|
||||
UseLayoutRounding="False" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Selected state -->
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||
<Setter Property="ContentPresenter.FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:selected)">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Style Selector="^:pointerover /template/ Label#PART_ContentPresenter">
|
||||
<Setter Property="Label.Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Border.Background" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Border.Background" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected /template/ Border#PART_SelectedPipe">
|
||||
<Setter Property="Border.Background" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Selected Pressed state -->
|
||||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled state -->
|
||||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -18,6 +18,28 @@
|
||||
Theme="{StaticResource BorderlessTextBox}" />
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<MenuFlyout x:Key="DefaultTextBoxContextFlyout" Placement="Bottom">
|
||||
<MenuItem
|
||||
x:Name="TextBoxContextFlyoutCutItem"
|
||||
Command="{Binding $parent[TextBox].Cut}"
|
||||
Header="Cut"
|
||||
InputGesture="{x:Static TextBox.CutGesture}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanCut}" />
|
||||
<MenuItem
|
||||
x:Name="TextBoxContextFlyoutCopyItem"
|
||||
Command="{Binding $parent[TextBox].Copy}"
|
||||
Header="Copy"
|
||||
InputGesture="{x:Static TextBox.CopyGesture}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanCopy}" />
|
||||
<MenuItem
|
||||
x:Name="TextBoxContextFlyoutPasteItem"
|
||||
Command="{Binding $parent[TextBox].Paste}"
|
||||
Header="Paste"
|
||||
InputGesture="{x:Static TextBox.PasteGesture}"
|
||||
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
||||
</MenuFlyout>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
||||
<ControlTheme.Resources>
|
||||
<ControlTheme x:Key="InputClearButton" TargetType="Button">
|
||||
@@ -77,6 +99,7 @@
|
||||
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
|
||||
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
|
||||
<Setter Property="TextBox.ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
|
||||
<Setter Property="TextBox.Template">
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Border
|
||||
@@ -85,7 +108,7 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{DynamicResource TextBoxDefaultCornerRadius}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto, Auto, Auto">
|
||||
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto,*,Auto, Auto, Auto">
|
||||
<ContentPresenter
|
||||
Grid.Column="0"
|
||||
Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
|
||||
@@ -95,7 +118,6 @@
|
||||
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<ScrollViewer
|
||||
Grid.Column="1"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
|
||||
|
||||
249
src/Semi.Avalonia/Controls/TimePicker.axaml
Normal file
249
src/Semi.Avalonia/Controls/TimePicker.axaml
Normal file
@@ -0,0 +1,249 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
|
||||
<ControlTheme x:Key="{x:Type TimePickerPresenter}" TargetType="TimePickerPresenter">
|
||||
<Setter Property="MinWidth" Value="242" />
|
||||
<Setter Property="MaxHeight" Value="300" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="CornerRadius" Value="6" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TimePickerPresenter">
|
||||
<Border
|
||||
Name="Background"
|
||||
Margin="{DynamicResource DateTimePickerFlyoutBorderMargin}"
|
||||
Padding="{DynamicResource DateTimePickerFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource DateTimePickerFlyoutBoxShadow}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid Name="ContentPanel" RowDefinitions="*,Auto">
|
||||
<Grid Name="PART_PickerContainer">
|
||||
<Grid.Styles>
|
||||
<Style Selector="DateTimePickerPanel > ListBoxItem">
|
||||
<Setter Property="Theme" Value="{StaticResource DateTimePickerItem}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<!-- Ignore col defs here, set in code -->
|
||||
<Panel Name="PART_HourHost" Grid.Column="0">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_HourSelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="Hour"
|
||||
ShouldLoop="True" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_HourUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_HourDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
|
||||
<Panel Name="PART_MinuteHost" Grid.Column="2">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_MinuteSelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="Minute"
|
||||
ShouldLoop="True" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_MinuteUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_MinuteDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
|
||||
<Panel Name="PART_PeriodHost" Grid.Column="4">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
||||
<DateTimePickerPanel
|
||||
Name="PART_PeriodSelector"
|
||||
ItemHeight="{DynamicResource DateTimePickerListBoxItemHeight}"
|
||||
PanelType="TimePeriod"
|
||||
ShouldLoop="False" />
|
||||
</ScrollViewer>
|
||||
<RepeatButton Name="PART_PeriodUpButton" Theme="{StaticResource DateTimePickerUpButton}" />
|
||||
<RepeatButton Name="PART_PeriodDownButton" Theme="{StaticResource DateTimePickerDownButton}" />
|
||||
</Panel>
|
||||
|
||||
<Rectangle
|
||||
Name="PART_FirstSpacer"
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
<Rectangle
|
||||
Name="PART_SecondSpacer"
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
Name="AcceptDismissGrid"
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="*,*">
|
||||
<Button
|
||||
Name="PART_AcceptButton"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Theme="{StaticResource DateTimePickerButton}">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_DismissButton"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
FontSize="16"
|
||||
Theme="{StaticResource DateTimePickerButton}">
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.ColumnSpan="2"
|
||||
Height="1"
|
||||
VerticalAlignment="Top"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^ /template/ Panel">
|
||||
<Style Selector="^:pointerover RepeatButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TimePicker}" TargetType="TimePicker">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
|
||||
<Button
|
||||
x:Name="PART_FlyoutButton"
|
||||
Width="242"
|
||||
MinWidth="242"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Cursor="Hand"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}"
|
||||
Theme="{StaticResource DateTimePickerFlyoutButton}">
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Grid Name="PART_FlyoutButtonContentGrid" Grid.Column="0">
|
||||
<!-- Ignore col defs here, set in code -->
|
||||
<Border
|
||||
x:Name="PART_FirstPickerHost"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TextBlock
|
||||
x:Name="PART_HourTextBlock"
|
||||
Padding="12,4"
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
</Border>
|
||||
|
||||
<Rectangle
|
||||
Name="PART_FirstColumnDivider"
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
|
||||
<Border
|
||||
x:Name="PART_SecondPickerHost"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TextBlock
|
||||
x:Name="PART_MinuteTextBlock"
|
||||
Padding="12,4"
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
</Border>
|
||||
|
||||
<Rectangle
|
||||
Name="PART_SecondColumnDivider"
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
|
||||
|
||||
<Border
|
||||
x:Name="PART_ThirdPickerHost"
|
||||
Grid.Column="4"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TextBlock
|
||||
x:Name="PART_PeriodTextBlock"
|
||||
Padding="12,4"
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<PathIcon
|
||||
Name="PART_Icon"
|
||||
Grid.Column="1"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="0,0,8,0"
|
||||
Data="{DynamicResource TimePickerIconGlyph}"
|
||||
Foreground="{DynamicResource DateTimePickerIconForeground}" />
|
||||
</Grid>
|
||||
|
||||
</Button>
|
||||
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
IsLightDismissEnabled="True"
|
||||
PlacementMode="Bottom"
|
||||
PlacementTarget="{TemplateBinding}"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<TimePickerPresenter Name="PART_PickerPresenter" Width="{Binding $parent[TimePicker].Bounds.Width}" />
|
||||
</Popup>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:disabled /template/ PathIcon#PART_Icon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonDisabledIconForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:hasnotime /template/ Button#PART_FlyoutButton TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
50
src/Semi.Avalonia/Controls/TitleBar.axaml
Normal file
50
src/Semi.Avalonia/Controls/TitleBar.axaml
Normal file
@@ -0,0 +1,50 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type TitleBar}" TargetType="TitleBar">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Stretch">
|
||||
<Panel
|
||||
x:Name="PART_MouseTracker"
|
||||
Height="1"
|
||||
VerticalAlignment="Top" />
|
||||
<Panel x:Name="PART_Container">
|
||||
<Border
|
||||
x:Name="PART_Background"
|
||||
Background="{TemplateBinding Background}"
|
||||
IsHitTestVisible="False" />
|
||||
<CaptionButtons
|
||||
x:Name="PART_CaptionButtons"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</Panel>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Border#PART_Background">
|
||||
<Setter Property="IsHitTestVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Panel#PART_MouseTracker">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen /template/ Panel#PART_Container">
|
||||
<Setter Property="RenderTransform" Value="translateY(-50px)" />
|
||||
<Setter Property="Transitions">
|
||||
<Transitions>
|
||||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.1" />
|
||||
</Transitions>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:fullscreen:pointerover /template/ Panel#PART_Container">
|
||||
<Setter Property="RenderTransform" Value="none" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
19
src/Semi.Avalonia/Controls/TransitioningContentControl.axaml
Normal file
19
src/Semi.Avalonia/Controls/TransitioningContentControl.axaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type TransitioningContentControl}" TargetType="TransitioningContentControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding CurrentContent}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -3,12 +3,36 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Version>0.1.0-preview1</Version>
|
||||
<Version>0.1.0-preview3</Version>
|
||||
<Title>Semi.Avalonia</Title>
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<Description>Avalonia Theme inspired by Semi Design. </Description>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<PackageReleaseNotes>Initial Release</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Add new controls:
|
||||
* Slider
|
||||
* GridSplitter
|
||||
* Carousel
|
||||
* Popup
|
||||
* Tabstrip
|
||||
* Timepicker
|
||||
* DatePicker
|
||||
* Canlendar
|
||||
* CalendarDatePicker
|
||||
* CaptionButtons
|
||||
* TitleBar
|
||||
* SplitView
|
||||
* ManagedFileChooser
|
||||
* DropdownButton
|
||||
* SplitButton
|
||||
|
||||
Fixes:
|
||||
* Fix TextBox and AutoComplete Padding
|
||||
* Fix Button default color
|
||||
* Fix Menu spacing
|
||||
* Fix various Flyout/Popup CornerRadius
|
||||
|
||||
Msic:
|
||||
* Add default ContextFlyout for TextBox</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<SolidColorBrush x:Key="AutoCompleteBoxPopupBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Opacity="0.08" Color="#1C1F23" />
|
||||
<Thickness x:Key="AutoCompleteBoxPopupBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="AutoCompleteBoxPopupMargin">0 4</Thickness>
|
||||
<Thickness x:Key="AutoCompleteBoxPopupMargin">4</Thickness>
|
||||
<CornerRadius x:Key="AutoCompleteBoxPopupCornerRadius">6</CornerRadius>
|
||||
<SolidColorBrush x:Key="AutoCompleteBoxBorderlessBorderBrush" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="AutoCompleteBoxBorderlessBackground" Opacity="0.05" Color="#2E3238" />
|
||||
|
||||
50
src/Semi.Avalonia/Themes/Light/Calendar.axaml
Normal file
50
src/Semi.Avalonia/Themes/Light/Calendar.axaml
Normal file
@@ -0,0 +1,50 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="using:System">
|
||||
<!-- Add Resources Here -->
|
||||
<SolidColorBrush x:Key="CalendarBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="CalendarForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarBorderBrush" Opacity="0.08" Color="#1C1F23" />
|
||||
<Thickness x:Key="CalendarBorderThickness">1</Thickness>
|
||||
<CornerRadius x:Key="CalendarCornerRadius">6</CornerRadius>
|
||||
<GridLength x:Key="CalendarItemWeekDayNameHeight">40</GridLength>
|
||||
<SolidColorBrush x:Key="CalendarItemWeekDayNameForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemIconForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<PathGeometry x:Key="CalendarItemPreviousIconGlyph">M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782 6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782 19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355 12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924 3.65354 16.2782 4.23933Z</PathGeometry>
|
||||
<PathGeometry x:Key="CalendarItemNextIconGlyph">M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z</PathGeometry>
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" />
|
||||
<Thickness x:Key="CalendarItemCalendarButtonBorderThickness">0</Thickness>
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonPressedBackground" Opacity="0.13" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedBackground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="White" />
|
||||
<FontWeight x:Key="CalendarItemCalendarButtonSelectedFontWeight">600</FontWeight>
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonDisabledForeground" Opacity="0.35" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBlackoutForeground" Opacity="0.35" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonInactiveForeground" Opacity="0.65" Color="#1C1F23" />
|
||||
<CornerRadius x:Key="CalendarItemCalendarButtonCornerRadius">3</CornerRadius>
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBorderBrush" Color="Transparent" />
|
||||
<CornerRadius x:Key="CalendarItemCalendarDayButtonCornerRadius">3</CornerRadius>
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPressedBackground" Opacity="0.13" Color="#2E3238" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedBackground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="White" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayForeground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayBackground" Opacity="0.05" Color="#2E3238" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonDisabledForeground" Opacity="0.35" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBlackoutForeground" Opacity="0.35" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonInactiveForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
|
||||
<sys:Double x:Key="CalendarMinWidth">240</sys:Double>
|
||||
</ResourceDictionary>
|
||||
15
src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
Normal file
15
src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
Normal file
@@ -0,0 +1,15 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- -->
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconPointeroverForeground" Color="#1C1F23" />
|
||||
<PathGeometry x:Key="CalendarDatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</PathGeometry>
|
||||
<SolidColorBrush x:Key="CalendarDatePickerBackground" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerBorderBrush" Color="#C6CACD" />
|
||||
<Thickness x:Key="CalendarDatePickerBorderThickness">1</Thickness>
|
||||
<CornerRadius x:Key="CalendarDatePickerCornerRadius">3</CornerRadius>
|
||||
<SolidColorBrush x:Key="CalendarDatePickerFocusBorderBrush" Color="#004FB3" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerDisabledBackground" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerDisabledBorderBrush" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerDisabledIconForeground" Opacity="0.4" Color="#2E3238" />
|
||||
|
||||
</ResourceDictionary>
|
||||
14
src/Semi.Avalonia/Themes/Light/CaptionButtons.axaml
Normal file
14
src/Semi.Avalonia/Themes/Light/CaptionButtons.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<PathGeometry x:Key="WindowCloseIconGlyph">M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z</PathGeometry>
|
||||
<PathGeometry x:Key="WindowMaximizeGlyph">M4,4H20V20H4V4M6,8V18H18V8H6Z</PathGeometry>
|
||||
<PathGeometry x:Key="WindowMinimizeGlyph">M20,14H4V10H20</PathGeometry>
|
||||
<PathGeometry x:Key="WindowRestoreGlyph">M4,8H8V4H20V16H16V20H4V8M16,8V14H18V6H10V8H16M6,12V18H14V12H6Z</PathGeometry>
|
||||
<PathGeometry x:Key="WindowExpandGlyph">M10,21V19H6.41L10.91,14.5L9.5,13.09L5,17.59V14H3V21H10M14.5,10.91L19,6.41V10H21V3H14V5H17.59L13.09,9.5L14.5,10.91Z</PathGeometry>
|
||||
<PathGeometry x:Key="WindowCollapseGlyph">M19.5,3.09L15,7.59V4H13V11H20V9H16.41L20.91,4.5L19.5,3.09M4,13V15H7.59L3.09,19.5L4.5,20.91L9,16.41V20H11V13H4Z</PathGeometry>
|
||||
<SolidColorBrush x:Key="CaptionButtonPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="CaptionButtonPressedBackground" Opacity="0.13" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="CaptionButtonClosePointeroverBackground" Color="#D52515" />
|
||||
<SolidColorBrush x:Key="CaptionButtonClosePressedBackground" Color="#B2140C" />
|
||||
<SolidColorBrush x:Key="CaptionButtonForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
</ResourceDictionary>
|
||||
4
src/Semi.Avalonia/Themes/Light/DatePicker.axaml
Normal file
4
src/Semi.Avalonia/Themes/Light/DatePicker.axaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<PathGeometry x:Key="DatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</PathGeometry>
|
||||
</ResourceDictionary>
|
||||
41
src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml
Normal file
41
src/Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml
Normal file
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<!-- Add Resources Here -->
|
||||
<SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="White" />
|
||||
<Thickness x:Key="DateTimePickerListItemPadding">0 3 0 6</Thickness>
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="#1C1F23" />
|
||||
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedBackground" Opacity="0.13" Color="#2E3238" />
|
||||
|
||||
<PathGeometry x:Key="DateTimePickerButtonUpGlyph">M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z</PathGeometry>
|
||||
<PathGeometry x:Key="DateTimePickerButtonDownGlyph">M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z</PathGeometry>
|
||||
<PathGeometry x:Key="DateTimePickerAcceptGlyph">M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915 9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019 9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246 5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988 14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z</PathGeometry>
|
||||
<PathGeometry x:Key="DateTimePickerDismissGlyph">M17.6568 19.7782C18.2426 20.3639 19.1924 20.3639 19.7782 19.7782C20.3639 19.1924 20.3639 18.2426 19.7782 17.6568L14.1213 12L19.7782 6.34313C20.3639 5.75734 20.3639 4.8076 19.7782 4.22181C19.1924 3.63602 18.2426 3.63602 17.6568 4.22181L12 9.87866L6.34313 4.22181C5.75734 3.63602 4.8076 3.63602 4.22181 4.22181C3.63602 4.8076 3.63602 5.75734 4.22181 6.34313L9.87866 12L4.22181 17.6568C3.63602 18.2426 3.63602 19.1924 4.22181 19.7782C4.8076 20.3639 5.75734 20.3639 6.34313 19.7782L12 14.1213L17.6568 19.7782Z</PathGeometry>
|
||||
|
||||
<SolidColorBrush x:Key="DateTimePickerSeparatorBackground" Opacity="0.08" Color="#1C1F23" />
|
||||
<sys:Double x:Key="DateTimePickerListBoxItemHeight">28</sys:Double>
|
||||
|
||||
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonBorderBrush" Color="#C6CACD" />
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonBackground" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonForeground" Color="#1C1F23" />
|
||||
|
||||
<SolidColorBrush x:Key="DateTimePickerIconForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="DateTimePickerEmptyForeground" Opacity="0.5" Color="#1C1F23" />
|
||||
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonPointeroverBorderBrush" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonDisabledBorderBrush" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonDisabledBackground" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="DateTimePickerButtonDisabledIconForeground" Opacity="0.4" Color="#2E3238" />
|
||||
|
||||
<BoxShadows x:Key="DateTimePickerFlyoutBoxShadow">0 0 8 0 #1A000000</BoxShadows>
|
||||
<Thickness x:Key="DateTimePickerFlyoutPadding">16 0</Thickness>
|
||||
<Thickness x:Key="DateTimePickerFlyoutBorderMargin">8</Thickness>
|
||||
|
||||
</ResourceDictionary>
|
||||
4
src/Semi.Avalonia/Themes/Light/DropdownButton.axaml
Normal file
4
src/Semi.Avalonia/Themes/Light/DropdownButton.axaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<PathGeometry x:Key="DropdownButtonIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</PathGeometry>
|
||||
</ResourceDictionary>
|
||||
5
src/Semi.Avalonia/Themes/Light/GridSplitter.axaml
Normal file
5
src/Semi.Avalonia/Themes/Light/GridSplitter.axaml
Normal file
@@ -0,0 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<SolidColorBrush x:Key="GridSplitterBackground" Opacity="0.08" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="GridSplitterPreviewBackground" Color="#CBE7FE" />
|
||||
</ResourceDictionary>
|
||||
@@ -6,21 +6,33 @@
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Border.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Button.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ButtonSpinner.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Calendar.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CaptionButtons.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/CheckBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ComboBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DatePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DropdownButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Expander.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/GridSplitter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Label.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ListBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ManagedFileChooser.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Menu.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/NotificationCard.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/NumericUpDown.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ProgressBar.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/RadioButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ScrollViewer.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Slider.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/SplitButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/SplitView.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/TabControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/TabItem.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/TextBlock.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/TextBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/TimePicker.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ToggleButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ToggleSwitch.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Tooltip.axaml" />
|
||||
|
||||
7
src/Semi.Avalonia/Themes/Light/ManagedFileChooser.axaml
Normal file
7
src/Semi.Avalonia/Themes/Light/ManagedFileChooser.axaml
Normal file
@@ -0,0 +1,7 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<SolidColorBrush x:Key="ManagedFileChooserIconForeground" Opacity="0.65" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="ManagedFileChooserTextForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="ManagedFileChooserSeparatorBorderBrush" Opacity="0.08" Color="#1C1F23" />
|
||||
<PathGeometry x:Key="ManagedFileChooserUpButtonGlyph">M20 18V20H13.5C9.91 20 7 17.09 7 13.5V7.83L3.91 10.92L2.5 9.5L8 4L13.5 9.5L12.09 10.91L9 7.83V13.5C9 16 11 18 13.5 18H20Z</PathGeometry>
|
||||
</ResourceDictionary>
|
||||
@@ -13,9 +13,9 @@
|
||||
<SolidColorBrush x:Key="MenuFlyoutBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="MenuFlyoutBorderBrush" Opacity="0.08" Color="#1C1F23" />
|
||||
<Thickness x:Key="MenuFlyoutBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="MenuFlyoutPadding">8</Thickness>
|
||||
<Thickness x:Key="MenuFlyoutPadding">0 4</Thickness>
|
||||
<BoxShadows x:Key="MenuFlyoutBorderBoxShadow">0 0 8 0 #1A000000</BoxShadows>
|
||||
<CornerRadius x:Key="MenuFlyoutCornerRadius">3</CornerRadius>
|
||||
<CornerRadius x:Key="MenuFlyoutCornerRadius">6</CornerRadius>
|
||||
<sys:Double x:Key="MenuFlyoutMinHeight">16</sys:Double>
|
||||
<sys:Double x:Key="MenuFlyoutMinWidth">100</sys:Double>
|
||||
<sys:Double x:Key="MenuFlyoutMaxHeight">400</sys:Double>
|
||||
@@ -24,7 +24,7 @@
|
||||
<!-- MenuItem -->
|
||||
<SolidColorBrush x:Key="MenuItemBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="MenuItemForeground" Color="#1C1F23" />
|
||||
<Thickness x:Key="MenuItemPadding">8 4</Thickness>
|
||||
<Thickness x:Key="MenuItemPadding">16 8</Thickness>
|
||||
|
||||
<SolidColorBrush x:Key="MenuItemSeparatorBackground" Opacity="0.08" Color="#1C1F23" />
|
||||
<sys:Double x:Key="MenuItemSeparatorHeight">1</sys:Double>
|
||||
|
||||
28
src/Semi.Avalonia/Themes/Light/Slider.axaml
Normal file
28
src/Semi.Avalonia/Themes/Light/Slider.axaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<!-- Add Resources Here -->
|
||||
<SolidColorBrush x:Key="SliderTrackForeground" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="SliderTrackBackground" Opacity="0.05" Color="#2E3238" />
|
||||
<sys:Double x:Key="SliderTrackWidth">4</sys:Double>
|
||||
<CornerRadius x:Key="SliderTrackCornerRadius">3</CornerRadius>
|
||||
<sys:Double x:Key="SliderThumbWidth">16</sys:Double>
|
||||
<sys:Double x:Key="SliderThumbHeight">16</sys:Double>
|
||||
<CornerRadius x:Key="SliderThumbCornerRadius">24</CornerRadius>
|
||||
<Thickness x:Key="SliderBorderThickness">0</Thickness>
|
||||
<BoxShadows x:Key="SliderThumbBoxShadow">0 0 1 1 #1A000000</BoxShadows>
|
||||
|
||||
<sys:Double x:Key="SliderTickHorizontalHeight">4</sys:Double>
|
||||
<sys:Double x:Key="SliderTickVerticalWidth">4</sys:Double>
|
||||
<SolidColorBrush x:Key="SliderTickForeground" Color="#C6CACD" />
|
||||
<SolidColorBrush x:Key="SliderThumbBackground" Color="White" />
|
||||
<SolidColorBrush x:Key="SliderThumbBorderBrush" Color="#0077FA" />
|
||||
<SolidColorBrush x:Key="SliderThumbPointeroverBorderBrush" Color="#0062D6" />
|
||||
<SolidColorBrush x:Key="SliderThumbPressedBorderBrush" Color="#004FB3" />
|
||||
<Thickness x:Key="SliderThumbBorderThickness">2</Thickness>
|
||||
|
||||
<SolidColorBrush x:Key="SliderTrackDisabledForeground" Color="#CBE7FE" />
|
||||
<SolidColorBrush x:Key="SliderThumbDisabledBorderBrush" Color="#CBE7FE" />
|
||||
<SolidColorBrush x:Key="SliderTrackDisabledBackground" Color="#F9F9F9" />
|
||||
</ResourceDictionary>
|
||||
8
src/Semi.Avalonia/Themes/Light/SplitButton.axaml
Normal file
8
src/Semi.Avalonia/Themes/Light/SplitButton.axaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<!-- Add Resources Here -->
|
||||
<PathGeometry x:Key="SplitButtonIconGlyph">M20.5598 9.65618L12.7546 18.6322C12.3559 19.0906 11.644 19.0906 11.2453 18.6322L3.4401 9.65618C2.8773 9.00895 3.33701 8 4.19471 8L19.8052 8C20.6629 8 21.1226 9.00895 20.5598 9.65618Z</PathGeometry>
|
||||
<sys:Double x:Key="SplitButtonSeparatorWidth">1</sys:Double>
|
||||
</ResourceDictionary>
|
||||
13
src/Semi.Avalonia/Themes/Light/SplitView.axaml
Normal file
13
src/Semi.Avalonia/Themes/Light/SplitView.axaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="using:System">
|
||||
<!-- Add Resources Here -->
|
||||
<x:Double x:Key="SplitViewOpenPaneThemeLength">320</x:Double>
|
||||
<x:Double x:Key="SplitViewCompactPaneThemeLength">48</x:Double>
|
||||
<sys:TimeSpan x:Key="SplitViewPaneAnimationOpenDuration">00:00:00.2</sys:TimeSpan>
|
||||
<sys:TimeSpan x:Key="SplitViewPaneAnimationCloseDuration">00:00:00.1</sys:TimeSpan>
|
||||
<Easing x:Key="SplitViewPaneAnimationEasing">0.1,0.9,0.2,1.0</Easing>
|
||||
<SolidColorBrush x:Key="SplitViewSeparatorBackground" Opacity="0.08" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="SplitViewPaneBackground" Color="White" />
|
||||
</ResourceDictionary>
|
||||
@@ -38,8 +38,8 @@
|
||||
<CornerRadius x:Key="TextBoxPrefixContentCornerRadius">0 3 3 0</CornerRadius>
|
||||
<CornerRadius x:Key="TextBoxBothContentCornerRadius">0 0 0 0</CornerRadius>
|
||||
|
||||
<Thickness x:Key="TextBoxInnerLeftContentPadding">8 0 0 0</Thickness>
|
||||
<Thickness x:Key="TextBoxInnerRightContentPadding">0 0 8 0</Thickness>
|
||||
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 8 0</Thickness>
|
||||
<Thickness x:Key="TextBoxInnerRightContentPadding">8 0 0 0</Thickness>
|
||||
<Thickness x:Key="TextBoxContentPadding">8 0</Thickness>
|
||||
<Thickness x:Key="TextBoxBorderThickness">1</Thickness>
|
||||
|
||||
|
||||
7
src/Semi.Avalonia/Themes/Light/TimePicker.axaml
Normal file
7
src/Semi.Avalonia/Themes/Light/TimePicker.axaml
Normal file
@@ -0,0 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<!-- Add Resources Here -->
|
||||
<PathGeometry x:Key="TimePickerIconGlyph">M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM13.5 6.5V11.3787L17.0607 14.9393C17.6464 15.5251 17.6464 16.4749 17.0607 17.0607C16.4749 17.6464 15.5251 17.6464 14.9393 17.0607L10.9393 13.0607C10.658 12.7794 10.5 12.3978 10.5 12V6.5C10.5 5.67157 11.1716 5 12 5C12.8284 5 13.5 5.67157 13.5 6.5Z</PathGeometry>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user