-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
236 additions
and
41 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/TextBlockDemo.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:hc="https://handyorg.github.io/handycontrol" | ||
x:Class="HandyControlDemo.UserControl.TextBlockDemo" | ||
Background="{DynamicResource RegionBrush}"> | ||
<ScrollViewer> | ||
<hc:UniformSpacingPanel Margin="32" | ||
Spacing="5" | ||
Orientation="Vertical"> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockLargeBold" | ||
Theme="{StaticResource TextBlockLargeBold}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockLarge" | ||
Theme="{StaticResource TextBlockLarge}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockHeaderBold" | ||
Theme="{StaticResource TextBlockTitleBold}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockHeader" | ||
Theme="{StaticResource TextBlockTitle}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockSubHeaderBold" | ||
Theme="{StaticResource TextBlockSubTitleBold}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockSubHeader" | ||
Theme="{StaticResource TextBlockSubTitle}" /> | ||
|
||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultBold" | ||
Theme="{StaticResource TextBlockDefaultBold}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefault" | ||
Theme="{StaticResource TextBlockDefault}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultAccent" | ||
Theme="{StaticResource TextBlockDefaultAccent}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultSecLight" | ||
Theme="{StaticResource TextBlockDefaultSecLight}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultThiLight" | ||
Theme="{StaticResource TextBlockDefaultThiLight}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultPrimary" | ||
Theme="{StaticResource TextBlockDefaultPrimary}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultDanger" | ||
Theme="{StaticResource TextBlockDefaultDanger}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultWarning" | ||
Theme="{StaticResource TextBlockDefaultWarning}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultInfo" | ||
Theme="{StaticResource TextBlockDefaultInfo}" /> | ||
<TextBlock HorizontalAlignment="Left" | ||
Text="TextBlockDefaultSuccess" | ||
Theme="{StaticResource TextBlockDefaultSuccess}" /> | ||
</hc:UniformSpacingPanel> | ||
</ScrollViewer> | ||
</UserControl> |
9 changes: 9 additions & 0 deletions
9
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/TextBlockDemo.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HandyControlDemo.UserControl; | ||
|
||
public partial class TextBlockDemo : Avalonia.Controls.UserControl | ||
{ | ||
public TextBlockDemo() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:system="using:System"> | ||
<system:Double x:Key="LargeFontSize">24</system:Double> | ||
<system:Double x:Key="HeadFontSize">20</system:Double> | ||
<system:Double x:Key="SubHeadFontSize">16</system:Double> | ||
<system:Double x:Key="TextFontSize">12</system:Double> | ||
</ResourceDictionary> |
37 changes: 0 additions & 37 deletions
37
src/Avalonia/HandyControl_Avalonia/Themes/Styles/Style.axaml
This file was deleted.
Oops, something went wrong.
125 changes: 125 additions & 0 deletions
125
src/Avalonia/HandyControl_Avalonia/Themes/Styles/TextBlock.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<ControlTheme x:Key="TextBlockBaseStyle" | ||
TargetType="TextBlock"> | ||
<Setter Property="VerticalAlignment" | ||
Value="Center" /> | ||
<Setter Property="HorizontalAlignment" | ||
Value="Center" /> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource PrimaryTextBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefault" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock" /> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultAccent" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource AccentBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultPrimary" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource PrimaryBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultDanger" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource DangerBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultWarning" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource WarningBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultInfo" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource InfoBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultSuccess" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource SuccessBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultSecLight" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource SecondaryTextBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultThiLight" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource ThirdlyTextBrush}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockLarge" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource LargeFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockTitle" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource HeadFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockSubTitle" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource SubHeadFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockBoldBaseStyle" | ||
BasedOn="{StaticResource TextBlockBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontWeight" | ||
Value="Bold" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockLargeBold" | ||
BasedOn="{StaticResource TextBlockBoldBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource LargeFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockTitleBold" | ||
BasedOn="{StaticResource TextBlockBoldBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource HeadFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockSubTitleBold" | ||
BasedOn="{StaticResource TextBlockBoldBaseStyle}" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource SubHeadFontSize}" /> | ||
</ControlTheme> | ||
|
||
<ControlTheme x:Key="TextBlockDefaultBold" | ||
BasedOn="{StaticResource TextBlockBoldBaseStyle}" | ||
TargetType="TextBlock" /> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
<!-- ReSharper disable once Xaml.RedundantNamespaceAlias --> | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="HandyControl.Themes.Theme"> | ||
x:Class="HandyControl.Themes.Theme" | ||
xmlns:hc="clr-namespace:HandyControl.Controls"> | ||
<Styles.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<MergeResourceInclude Source="/Themes/Basic/Colors.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Sizes.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Fonts.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Effects.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Geometries.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Paths.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Brushes.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Basic/Converters.axaml" /> | ||
|
||
<MergeResourceInclude Source="/Themes/Styles/TextBlock.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ContentControl.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/UserControl.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/Window.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/Button.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/RepeatButton.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ToggleButton.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/RadioButton.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/CheckBox.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/Border.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ItemsControl.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/TabItem.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/TabControl.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ListBoxItem.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ScrollViewer.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/ListBox.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/Label.axaml" /> | ||
<MergeResourceInclude Source="/Themes/Styles/Slider.axaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Styles.Resources> | ||
|
||
<StyleInclude Source="/Themes/Styles/Style.axaml" /> | ||
<Style Selector=":is(UserControl)"> | ||
<Setter Property="Theme" | ||
Value="{DynamicResource {x:Type UserControl}}" /> | ||
</Style> | ||
</Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters