Skip to content

Commit

Permalink
simple-breadcrumb-bar スタイルを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Nov 3, 2023
1 parent 3581395 commit b34a083
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 69 deletions.
18 changes: 17 additions & 1 deletion src/Beutl.Controls/Styles.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="/Styling/ButtonStyles.axaml" />
<ResourceInclude Source="/Styling/ComboBoxStyles.axaml" />
<ResourceInclude Source="/Styling/ToggleSwitchStyles.axaml" />
<ResourceInclude Source="/Styling/ToggleButtonStyles.axaml" />
<ResourceInclude Source="/Styling/ComboBoxStyles.axaml" />
<ResourceInclude Source="/Styling/SimpleBreadcrumbBar.axaml" />

<ResourceInclude Source="/Styling/ProgressRing.axaml" />
<ResourceInclude Source="/Styling/FileInputArea.axaml" />
Expand Down Expand Up @@ -105,6 +106,21 @@
<Setter Property="Height" Value="24" />
</Style>

<Style Selector="StackPanel.simple-breadcrumb-bar">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Spacing" Value="16" />

<Style Selector="^ > Separator">
<Setter Property="Theme" Value="{StaticResource SimpleLargeBreadcrumbBarSeparator}" />
</Style>
<Style Selector="^ > Button">
<Setter Property="Theme" Value="{StaticResource SimpleLargeBreadcrumbBarButton}" />
</Style>
<Style Selector="^ > TextBlock">
<Setter Property="Theme" Value="{StaticResource SimpleLargeBreadcrumbBarTextBlock}" />
</Style>
</Style>

<StyleInclude Source="avares://Beutl.Controls/Styling/NavigationView.axaml" />
<StyleInclude Source="avares://Beutl.Controls/Styling/Placeholder.axaml" />
</Styles>
73 changes: 73 additions & 0 deletions src/Beutl.Controls/Styling/SimpleBreadcrumbBar.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="using:FluentAvalonia.UI.Controls">

<ControlTheme x:Key="SimpleLargeBreadcrumbBarSeparator" TargetType="Separator">
<Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextBlock.TextWrapping" Value="Wrap" />
<Setter Property="VerticalAlignment" Value="Center" />

<Setter Property="Template">
<ControlTemplate>
<TextBlock FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Text="&#xE974;" />
</ControlTemplate>
</Setter>
</ControlTheme>

<ControlTheme x:Key="SimpleLargeBreadcrumbBarButton"
BasedOn="{StaticResource ResourceKey={x:Type Button}}"
TargetType="Button">
<Setter Property="FontFamily" Value="XamlAutoFontFamily" />
<Setter Property="FontSize" Value="24" />
<Setter Property="FontWeight" Value="SemiBold" />
<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/ ui|FABorder#Root">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
</Style>

<Style Selector="^:pressed /template/ ui|FABorder#Root">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Opacity" Value="0.5" />
</Style>

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

<ControlTheme x:Key="SimpleLargeBreadcrumbBarTextBlock" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource XamlAutoFontFamily}" />
<Setter Property="FontSize" Value="24" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextBlock.TextWrapping" Value="Wrap" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="ClipToBounds" Value="False" />
</ControlTheme>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@
</UserControl.KeyBindings>

<Grid RowDefinitions="Auto,Auto,*">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Click="NavigatePackageDetailsPage_Click"
Content="{CompiledBinding Package.Name}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Click="NavigatePackageDetailsPage_Click" Content="{CompiledBinding Package.Name}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{x:Static lang:ExtensionsPage.Package_Releases_Tip}" />
<TextBlock Text="{x:Static lang:ExtensionsPage.Package_Releases_Tip}" />
</StackPanel>

<ui:CommandBar Grid.Row="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@
</UserControl.Styles>

<Grid RowDefinitions="Auto,*,Auto">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Click="NavigatePackageDetailsPage_Click"
Content="{CompiledBinding Package.Name}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Click="NavigatePackageDetailsPage_Click" Content="{CompiledBinding Package.Name}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{x:Static lang:Strings.Settings}" />
<TextBlock Text="{x:Static lang:Strings.Settings}" />
</StackPanel>

<ScrollViewer Grid.Row="1" Margin="10,0">
Expand Down
18 changes: 6 additions & 12 deletions src/Beutl/Pages/ExtensionsPages/DevelopPages/ReleasePage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,16 @@
</UserControl.Styles>

<Grid RowDefinitions="Auto,*,Auto">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Click="NavigatePackageDetailsPage_Click"
Content="{CompiledBinding Release.Package.Name}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Click="NavigatePackageDetailsPage_Click" Content="{CompiledBinding Release.Package.Name}" />

<Label Classes="breadcrumb" />
<Separator />

<Button Classes="breadcrumb"
Click="NavigatePackageReleasesPage_Click"
Content="{x:Static lang:ExtensionsPage.Package_Releases_Tip}" />
<Button Click="NavigatePackageReleasesPage_Click" Content="{x:Static lang:ExtensionsPage.Package_Releases_Tip}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{CompiledBinding Release.Version.Value}" />
<TextBlock Text="{CompiledBinding Release.Version.Value}" />
</StackPanel>


Expand Down
12 changes: 4 additions & 8 deletions src/Beutl/Pages/SettingsPages/AnExtensionSettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
x:DataType="vm:AnExtensionSettingsPageViewModel"
mc:Ignorable="d">
<Grid Margin="18" RowDefinitions="Auto,*">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Command="{Binding NavigateParent}"
Content="{x:Static lang:Strings.Extensions}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Command="{Binding NavigateParent}" Content="{x:Static lang:Strings.Extensions}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{Binding Extension.DisplayName}" />
<TextBlock Text="{Binding Extension.DisplayName}" />
</StackPanel>

<ScrollViewer Grid.Row="1" Margin="0,12,0,0">
Expand Down
12 changes: 4 additions & 8 deletions src/Beutl/Pages/SettingsPages/DecoderPriorityPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@
x:DataType="vm:DecoderPriorityPageViewModel"
mc:Ignorable="d">
<Grid Margin="18" RowDefinitions="Auto,*">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Command="{Binding NavigateParent}"
Content="{x:Static lang:Strings.Extensions}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Command="{Binding NavigateParent}" Content="{x:Static lang:Strings.Extensions}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{x:Static lang:SettingsPage.DecoderPriority}" />
<TextBlock Text="{x:Static lang:SettingsPage.DecoderPriority}" />
</StackPanel>

<ScrollViewer Grid.Row="1">
Expand Down
12 changes: 4 additions & 8 deletions src/Beutl/Pages/SettingsPages/EditorExtensionPriorityPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
x:DataType="vm:EditorExtensionPriorityPageViewModel"
mc:Ignorable="d">
<Grid Margin="18" RowDefinitions="Auto,*">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Command="{Binding NavigateParent}"
Content="{x:Static lang:Strings.Extensions}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Command="{Binding NavigateParent}" Content="{x:Static lang:Strings.Extensions}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{x:Static lang:SettingsPage.Editor_Extension_Priority}" />
<TextBlock Text="{x:Static lang:SettingsPage.Editor_Extension_Priority}" />
</StackPanel>

<ScrollViewer Grid.Row="1">
Expand Down
4 changes: 2 additions & 2 deletions src/Beutl/Pages/SettingsPages/EditorSettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<Grid Margin="18" RowDefinitions="Auto,*">

<TextBlock Margin="10,8"
Classes="breadcrumb"
Text="{x:Static lang:Strings.Editor}" />
Text="{x:Static lang:Strings.Editor}"
Theme="{StaticResource SimpleLargeBreadcrumbBarTextBlock}" />

<ScrollViewer Grid.Row="1">
<StackPanel Margin="10,16,10,0"
Expand Down
4 changes: 2 additions & 2 deletions src/Beutl/Pages/SettingsPages/ExtensionsSettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<Grid Margin="18" RowDefinitions="Auto,*">

<TextBlock Margin="10,8"
Classes="breadcrumb"
Text="{x:Static lang:Strings.Extensions}" />
Text="{x:Static lang:Strings.Extensions}"
Theme="{StaticResource SimpleLargeBreadcrumbBarTextBlock}" />

<ScrollViewer Grid.Row="1">
<StackPanel Margin="10,16,10,0"
Expand Down
12 changes: 4 additions & 8 deletions src/Beutl/Pages/SettingsPages/StorageDetailPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@
<Panel>

<Grid Margin="18" RowDefinitions="Auto,Auto,Auto">
<StackPanel Margin="10,8"
Orientation="Horizontal"
Spacing="16">
<Button Classes="breadcrumb"
Command="{CompiledBinding NavigateParent}"
Content="{x:Static lang:SettingsPage.Storage}" />
<StackPanel Margin="10,8" Classes="simple-breadcrumb-bar">
<Button Command="{CompiledBinding NavigateParent}" Content="{x:Static lang:SettingsPage.Storage}" />

<Label Classes="breadcrumb" />
<Separator />

<TextBlock Classes="breadcrumb" Text="{CompiledBinding TypeString}" />
<TextBlock Text="{CompiledBinding TypeString}" />
</StackPanel>

<ui:CommandBar Grid.Row="1" DefaultLabelPosition="Right">
Expand Down
4 changes: 2 additions & 2 deletions src/Beutl/Pages/SettingsPages/TelemetrySettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<Grid Margin="18" RowDefinitions="Auto,*">

<TextBlock Margin="10,8"
Classes="breadcrumb"
Text="{x:Static lang:SettingsPage.Telemetry}" />
Text="{x:Static lang:SettingsPage.Telemetry}"
Theme="{StaticResource SimpleLargeBreadcrumbBarTextBlock}" />

<ScrollViewer Grid.Row="1">
<StackPanel Margin="10,16,10,0"
Expand Down
4 changes: 2 additions & 2 deletions src/Beutl/Pages/SettingsPages/ViewSettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<Grid Margin="18" RowDefinitions="Auto,*">

<TextBlock Margin="10,8"
Classes="breadcrumb"
Text="{x:Static lang:Strings.View}" />
Text="{x:Static lang:Strings.View}"
Theme="{StaticResource SimpleLargeBreadcrumbBarTextBlock}" />

<ScrollViewer Grid.Row="1">
<StackPanel Margin="10,16,10,0"
Expand Down

0 comments on commit b34a083

Please sign in to comment.