Skip to content

Commit

Permalink
chore: update MainContent.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Jan 20, 2023
1 parent bec25d7 commit 3405428
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 56 deletions.
110 changes: 55 additions & 55 deletions src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
<ResourceDictionary Source="../Basic/Fonts.xaml"/>
<ResourceDictionary Source="../Basic/Geometries.xaml" />
<ResourceDictionary Source="../Basic/Fonts.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
<Setter Property="UseLayoutRounding" Value="False"/>
<Setter Property="Height" Value="77"/>
<Setter Property="Width" Value="36.06"/>
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Height" Value="77" />
<Setter Property="Width" Value="36.06" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<hc:SimplePanel>
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/>
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/>
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06" />
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White" />
</hc:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
<Setter Property="Opacity" Value=".9" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value=".6"/>
<Setter Property="Opacity" Value=".6" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -37,76 +33,76 @@
</Style>

<Style x:Key="TabItemTransparent" BasedOn="{StaticResource TabItemInLine}" TargetType="TabItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Background" Value="Transparent" />
</Style>

<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
<Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource Boolean2VisibilityConverter}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource Boolean2VisibilityConverter}}" />
<Setter Property="Background" Value="Transparent" />
</Style>

<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
<Setter Property="hc:BorderElement.CornerRadius" Value="4"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}"/>
<Setter Property="hc:ScrollViewer.IsInertiaEnabled" Value="True"/>
<Setter Property="hc:BorderElement.CornerRadius" Value="4" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}" />
<Setter Property="hc:ScrollViewer.IsInertiaEnabled" Value="True" />
</Style>

<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"/>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}" />
</ItemsPanelTemplate>

<Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}">
<Setter Property="NonClientAreaBackground" Value="#262e2f"/>
<Setter Property="OtherButtonHoverBackground" Value="#888580"/>
<Setter Property="OtherButtonForeground" Value="White"/>
<Setter Property="OtherButtonHoverForeground" Value="White"/>
<Setter Property="NonClientAreaForeground" Value="White"/>
<Setter Property="CloseButtonForeground" Value="White"/>
<Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico"/>
<Setter Property="NonClientAreaBackground" Value="#262e2f" />
<Setter Property="OtherButtonHoverBackground" Value="#888580" />
<Setter Property="OtherButtonForeground" Value="White" />
<Setter Property="OtherButtonHoverForeground" Value="White" />
<Setter Property="NonClientAreaForeground" Value="White" />
<Setter Property="CloseButtonForeground" Value="White" />
<Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico" />
</Style>

<Style x:Key="TextBlockFabricIcons" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource FabricIcons}"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontFamily" Value="{StaticResource FabricIcons}" />
<Setter Property="FontSize" Value="14" />
</Style>

<Style TargetType="hc:Sprite" BasedOn="{StaticResource {x:Type hc:Sprite}}">
<Setter Property="Padding" Value="25"/>
<Setter Property="Padding" Value="25" />
</Style>

<Storyboard x:Key="Custom1Transition" x:Shared="False">
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
<ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>

<Storyboard x:Key="Custom2Transition" x:Shared="False">
<DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
<ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>

<Storyboard x:Key="Custom3Transition" x:Shared="False">
<DoubleAnimation From=".8" To="1" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
<ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>

<Style x:Key="TextEditorCustom" TargetType="avalonedit:TextEditor">
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="FontFamily" Value="Consolas"/>
<Setter Property="Margin" Value="4"/>
<Setter Property="ShowLineNumbers" Value="True"/>
<Setter Property="LineNumbersForeground" Value="{DynamicResource EditorLineNumbersForeground}"/>
<Setter Property="Foreground" Value="{DynamicResource EditorForeground}"/>
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="FontFamily" Value="Consolas" />
<Setter Property="Margin" Value="4" />
<Setter Property="ShowLineNumbers" Value="True" />
<Setter Property="LineNumbersForeground" Value="{DynamicResource EditorLineNumbersForeground}" />
<Setter Property="Foreground" Value="{DynamicResource EditorForeground}" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="avalonedit:TextEditor">
Expand Down Expand Up @@ -158,18 +154,18 @@
</Style>

<Style x:Key="Path4GeometryItem" TargetType="Path">
<Setter Property="Margin" Value="10"/>
<Setter Property="Data" Value="{Binding Info.Data,RelativeSource={RelativeSource AncestorType=Border}}"/>
<Setter Property="Fill" Value="{DynamicResource PrimaryBrush}"/>
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="20"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Stretch" Value="Uniform"/>
<Setter Property="Margin" Value="10" />
<Setter Property="Data" Value="{Binding Info.Data,RelativeSource={RelativeSource AncestorType=Border}}" />
<Setter Property="Fill" Value="{DynamicResource PrimaryBrush}" />
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Stretch" Value="Uniform" />
<Style.Triggers>
<DataTrigger Binding="{Binding Info.Line,RelativeSource={RelativeSource AncestorType=Border}}" Value="True">
<Setter Property="Fill" Value="{x:Null}"/>
<Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}"/>
<Setter Property="Fill" Value="{x:Null}" />
<Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
Expand All @@ -179,12 +175,16 @@
<Setter.Value>
<ControlTemplate TargetType="GroupItem">
<hc:SimpleStackPanel>
<hc:Divider Content="{ex:Lang Key={Binding Name}}" LineStrokeDashArray="2, 2" Padding="16,0" Margin="0,16,0,10"/>
<ItemsPresenter Margin="{TemplateBinding Padding}"/>
<hc:Divider Content="{ex:Lang Key={Binding Name}}" LineStrokeDashArray="2, 2" Padding="16,0" Margin="0,16,0,10" />
<ItemsPresenter Margin="{TemplateBinding Padding}" />
</hc:SimpleStackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="TabControl.PreviewCode" BasedOn="{StaticResource TabControlInLine}" TargetType="TabControl">
<Setter Property="BorderThickness" Value="0 1 0 0" />
</Style>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private void InitTextEditor()

BorderCode.Child = new TabControl
{
Style = ResourceHelper.GetResource<Style>("TabControlInLine"),
Style = ResourceHelper.GetResource<Style>("TabControl.PreviewCode"),
Items =
{
new TabItem
Expand Down

0 comments on commit 3405428

Please sign in to comment.