push changes
This commit is contained in:
parent
4efc6bf4ec
commit
d19cc9d7b9
@ -94,4 +94,7 @@ Global
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86}
|
||||
EndGlobalSection
|
||||
GlobalSection(RiderSharedRunConfigurations) = postSolution
|
||||
File = .run\SC-Single.run.xml
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
34
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
Normal file
34
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
Normal file
@ -0,0 +1,34 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HyperlinkButtonDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton Height="30" NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="iRihi Homepage"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
BorderThickness="1"
|
||||
Classes="WithIcon"
|
||||
Height="30"
|
||||
NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="test"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs
Normal file
14
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class HyperlinkButtonDemo : UserControl
|
||||
{
|
||||
public HyperlinkButtonDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -23,4 +23,11 @@
|
||||
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj" />
|
||||
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Pages\HyperlinkButtonDemo.axaml.cs">
|
||||
<DependentUpon>HyperLinkButtonDemo.axaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Semi.Avalonia.Demo.Views.MainView"
|
||||
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"
|
||||
xmlns:pages="using:Semi.Avalonia.Demo.Pages"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@ -21,52 +21,52 @@
|
||||
Margin="8"
|
||||
Padding="12,4"
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Grid VerticalAlignment="Center" ColumnDefinitions="*, Auto">
|
||||
<Grid ColumnDefinitions="*, Auto" VerticalAlignment="Center">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Classes="H6"
|
||||
Text="Semi Avalonia"
|
||||
Theme="{DynamicResource TitleTextBlock}" />
|
||||
Theme="{DynamicResource TitleTextBlock}"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
Margin="8,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="/" />
|
||||
Text="/"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
Margin="8,0"
|
||||
VerticalAlignment="Center"
|
||||
Classes="Secondary"
|
||||
Text="{Binding #tab.SelectedItem.Header}" />
|
||||
Margin="8,0"
|
||||
Text="{Binding #tab.SelectedItem.Header}"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<ToggleSwitch
|
||||
Grid.Column="1"
|
||||
Padding="4"
|
||||
IsCheckedChanged="ToggleButton_OnIsCheckedChanged"
|
||||
Padding="4"
|
||||
Theme="{DynamicResource ButtonToggleSwitch}">
|
||||
<ToggleSwitch.OnContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="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 23ZM17 15C17.476 15 17.9408 14.9525 18.3901 14.862C17.296 17.3011 14.8464 19 12 19C8.13401 19 5 15.866 5 12C5 8.60996 7.40983 5.78277 10.6099 5.13803C10.218 6.01173 10 6.98041 10 8C10 11.866 13.134 15 17 15Z"
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
|
||||
Height="16"
|
||||
Width="16" />
|
||||
</ToggleSwitch.OnContent>
|
||||
<ToggleSwitch.OffContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13"
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
|
||||
Height="16"
|
||||
Width="16" />
|
||||
</ToggleSwitch.OffContent>
|
||||
</ToggleSwitch>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
<TabControl
|
||||
Name="tab"
|
||||
Grid.Row="1"
|
||||
Margin="8"
|
||||
Padding="20,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="8"
|
||||
Name="tab"
|
||||
Padding="20,0,0,0"
|
||||
TabStripPlacement="Left"
|
||||
Theme="{DynamicResource NavigationTab}">
|
||||
<TabItem Header="Overview">
|
||||
@ -126,6 +126,9 @@
|
||||
<TabItem Header="HeaderedContentControl">
|
||||
<pages:HeaderedContentControlDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="HyperlinkButton">
|
||||
<pages:HyperlinkButtonDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Label">
|
||||
<pages:LabelDemo />
|
||||
</TabItem>
|
||||
@ -145,7 +148,7 @@
|
||||
<pages:NumericUpDownDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="PathIcon">
|
||||
<pages:PathIconDemo/>
|
||||
<pages:PathIconDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="ProgressBar">
|
||||
<pages:ProgressBarDemo />
|
||||
|
108
src/Semi.Avalonia/Controls/HyperlinkButton.axaml
Normal file
108
src/Semi.Avalonia/Controls/HyperlinkButton.axaml
Normal file
@ -0,0 +1,108 @@
|
||||
<ResourceDictionary
|
||||
x:CompileBindings="True"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme TargetType="HyperlinkButton" x:Key="{x:Type HyperlinkButton}">
|
||||
<Setter Property="Padding" Value="0,0,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||
<Setter Property="MinHeight" Value="32" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="HyperlinkButton">
|
||||
<ContentPresenter
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Cursor="{TemplateBinding Cursor}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
TextElement.FontFeatures="{TemplateBinding FontWeight}"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
||||
UseLayoutRounding="False"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="PART_ContentPresenter" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.WithIcon">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="HyperlinkButton">
|
||||
<Grid
|
||||
ColumnDefinitions="Auto,*"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="RootGrid">
|
||||
<Grid Grid.Column="0" VerticalAlignment="Top">
|
||||
<Border
|
||||
Background="{DynamicResource CheckBoxDefaultBackground}"
|
||||
Height="{DynamicResource HyperlinkButtonIconHeight}"
|
||||
Opacity="0"
|
||||
UseLayoutRounding="False"
|
||||
Width="{DynamicResource HyperlinkButtonIconWidth}"
|
||||
x:Name="BackgroundRectangle" />
|
||||
<!-- <PathIcon -->
|
||||
<!-- Data="{DynamicResource HyperlinkButtonLinkGlyph}" -->
|
||||
<!-- Foreground="{DynamicResource CheckBoxForeground}" -->
|
||||
<!-- Height="{DynamicResource HyperlinkButtonLinkGlyphHeight}" -->
|
||||
<!-- Name="LinkGlyph" -->
|
||||
<!-- VerticalAlignment="Bottom" -->
|
||||
<!-- Width="{DynamicResource HyperlinkButtonLinkGlyphWidth}" /> -->
|
||||
</Grid>
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Cursor="{TemplateBinding Cursor}"
|
||||
Grid.Column="1"
|
||||
IsVisible="{TemplateBinding Content,
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
RecognizesAccessKey="True"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="ContentPresenter" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Unvisited Pointerover State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Unvisited Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
</Style>
|
||||
|
||||
<!-- Unvisited Disabled state -->
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:visited">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
|
||||
<!-- Visited Pointerover State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
|
||||
</Style>
|
||||
|
||||
<!-- Visited Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="RenderTransform" Value="scale(0.98)" />
|
||||
</Style>
|
||||
|
||||
<!-- Visited Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
x:CompileBindings="True"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:CompileBindings="True">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/AutoCompleteBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Border.axaml" />
|
||||
@ -24,6 +24,7 @@
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/GridSplitter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/HeaderedContentControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/HyperlinkButton.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" />
|
||||
|
9
src/Semi.Avalonia/Themes/Shared/HyperlinkButton.axaml
Normal file
9
src/Semi.Avalonia/Themes/Shared/HyperlinkButton.axaml
Normal file
@ -0,0 +1,9 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<x:Double x:Key="HyperlinkButtonFontSize">14</x:Double>
|
||||
<x:Double x:Key="HyperlinkButtonIconWidth">16</x:Double>
|
||||
<x:Double x:Key="HyperlinkButtonIconHeight">16</x:Double>
|
||||
<x:Double x:Key="HyperlinkButtonLinkGlyphWidth">16</x:Double>
|
||||
<x:Double x:Key="HyperlinkButtonLinkGlyphHeight">16</x:Double>
|
||||
|
||||
<PathGeometry x:Key="HyperlinkButtonLinkGlyph">M 12.9393 2.9393 C 15.182 0.69666 18.818 0.696668 21.0606 2.93931 C 23.3033 5.18195 23.3033 8.81799 21.0606 11.0606 L 18.3925 13.7288 C 18.4631 13.3298 18.5 12.9192 18.5 12.5 C 18.5 11.5751 18.3206 10.6921 17.9947 9.88386 L 18.9393 8.93931 C 20.0104 7.86824 20.0104 6.13169 18.9393 5.06063 C 17.8682 3.98956 16.1317 3.98956 15.0606 5.06062 L 11.0606 9.06063 C 9.98956 10.1317 9.98956 11.8682 11.0606 12.9393 C 11.3265 13.2052 11.6335 13.4051 11.961 13.539 L 9.75848 15.7415 C 9.47 15.5439 9.19556 15.3169 8.9393 15.0606 C 6.69666 12.818 6.69666 9.18195 8.9393 6.93931 L 12.9393 2.9393 Z M 2.9393 12.9393 L 5.60751 10.2711 C 5.53685 10.6701 5.49999 11.0808 5.49999 11.5001 C 5.49999 12.4249 5.67935 13.3079 6.00519 14.1161 L 5.06062 15.0607 C 3.98956 16.1317 3.98956 17.8683 5.06063 18.9393 C 6.13169 20.0104 7.86824 20.0104 8.9393 18.9393 L 12.9393 14.9393 C 14.0104 13.8683 14.0104 12.1317 12.9393 11.0607 C 12.7664 10.8878 12.5762 10.7428 12.3743 10.6258 L 14.5302 8.46985 C 14.7141 8.61357 14.8914 8.77007 15.0606 8.93934 C 17.3033 11.182 17.3033 14.818 15.0606 17.0607 L 11.0606 21.0607 C 8.81798 23.3033 5.18194 23.3033 2.9393 21.0607 C 0.696665 18.818 0.696663 15.182 2.9393 12.9393 Z</PathGeometry>
|
||||
</ResourceDictionary>
|
@ -20,6 +20,7 @@
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/Flyout.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/GridSplitter.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/HeaderedContentControl.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/HyperlinkButton.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/Label.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/ListBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/ManagedFileChooser.axaml" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user