Skip to content

Commit

Permalink
LiteButtonStyle を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Nov 3, 2023
1 parent 8f15fb9 commit 3581395
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
1 change: 1 addition & 0 deletions src/Beutl.Controls/Styles.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="/Styling/ButtonStyles.axaml" />
<ResourceInclude Source="/Styling/ToggleSwitchStyles.axaml" />
<ResourceInclude Source="/Styling/ToggleButtonStyles.axaml" />
<ResourceInclude Source="/Styling/ComboBoxStyles.axaml" />
Expand Down
27 changes: 27 additions & 0 deletions src/Beutl.Controls/Styling/ButtonStyles.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="using:FluentAvalonia.UI.Controls">

<Design.PreviewWith>
<Border Padding="16">
<Button Theme="{DynamicResource LiteButtonStyle}">
Hello
</Button>
</Border>
</Design.PreviewWith>

<ControlTheme x:Key="LiteButtonStyle"
BasedOn="{StaticResource TransparentButton}"
TargetType="Button">
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />

<Style Selector="^:pointerover /template/ ui|FABorder#Root">
<Setter Property="Opacity" Value="0.8" />
<Setter Property="Background" Value="Transparent" />
</Style>
</ControlTheme>

</ResourceDictionary>
34 changes: 0 additions & 34 deletions src/Beutl/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,40 +104,6 @@
</Style>
</Style>

<Style Selector="Button.simple">
<Setter Property="FontFamily" Value="XamlAutoFontFamily" />
<Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextBlock.TextWrapping" Value="Wrap" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" />

<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Transitions">
<Transitions />
</Setter>
</Style>

<Style Selector="^:pointerover /template/ Border#BorderElement">
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ButtonForeground}" />
</Style>

<Style Selector="^:pointerover /template/ Border#BorderElement">
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Opacity" Value="0.5" />
</Style>
</Style>

<Style Selector="Label.breadcrumb">
<Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
<Setter Property="FontSize" Value="16" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@

<Button Margin="0,0,0,32"
HorizontalAlignment="Center"
Classes="simple"
Click="OpenPublisherPage_Click"
Content="{Binding Package.Owner.Name}" />
Content="{Binding Package.Owner.Name}"
Theme="{StaticResource LiteButtonStyle}" />

<StackPanel HorizontalAlignment="Center" Spacing="8">
<ComboBox Margin="0,0,-32,0"
Expand Down
2 changes: 1 addition & 1 deletion src/Beutl/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Main(string[] args)
using IDisposable _ = Telemetry.GetDisposable();
Telemetry.Started();

// PGOを有効化
// ProfileOptimizationを有効化
string jitProfiles = Path.Combine(BeutlEnvironment.GetHomeDirectoryPath(), "jitProfiles");
if (!Directory.Exists(jitProfiles))
Directory.CreateDirectory(jitProfiles);
Expand Down

0 comments on commit 3581395

Please sign in to comment.