Skip to content

Commit 6c37e2e

Browse files
committed
Initial commit
1 parent 79b7621 commit 6c37e2e

File tree

8 files changed

+127
-1
lines changed

8 files changed

+127
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
using CommunityToolkit.WinUI;
5+
using Microsoft.UI.Xaml;
6+
using Microsoft.UI.Xaml.Controls;
7+
using Microsoft.UI.Xaml.Media;
8+
using Microsoft.UI.Xaml.Markup;
9+
using Microsoft.UI.Xaml.Shapes;
10+
using Microsoft.UI.Xaml.Input;
11+
using Microsoft.UI;
12+
13+
namespace Files.App.Controls
14+
{
15+
public sealed partial class Breadcrumb : Control
16+
{
17+
// TODO: Put properties here
18+
}
19+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
using CommunityToolkit.WinUI;
5+
using Microsoft.UI.Xaml;
6+
using Microsoft.UI.Xaml.Controls;
7+
using Microsoft.UI.Xaml.Media;
8+
using Microsoft.UI.Xaml.Markup;
9+
using Microsoft.UI.Xaml.Shapes;
10+
using Microsoft.UI.Xaml.Input;
11+
using Microsoft.UI;
12+
13+
namespace Files.App.Controls
14+
{
15+
public sealed partial class Breadcrumb : Control
16+
{
17+
public Breadcrumb()
18+
{
19+
DefaultStyleKey = typeof(Breadcrumb);
20+
}
21+
}
22+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
2+
<ResourceDictionary
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:Files.App.Controls">
6+
7+
<!--<x:Double x:Key="OmnibarDefaultHeight">38</x:Double>
8+
<CornerRadius x:Key="OmnibarDefaultCornerRadius">19</CornerRadius>
9+
<Thickness x:Key="OmnibarFocusedBorderThickness">2</Thickness>
10+
<Thickness x:Key="OmnibarUnfocusedBorderThickness">1</Thickness>
11+
<Thickness x:Key="OmnibarUnfocusedRootPadding">1</Thickness>-->
12+
13+
<Style BasedOn="{StaticResource DefaultBreadcrumbStyle}" TargetType="local:Breadcrumb" />
14+
15+
<Style x:Key="DefaultBreadcrumbStyle" TargetType="local:Breadcrumb">
16+
<Setter Property="IsTabStop" Value="True" />
17+
<Setter Property="UseSystemFocusVisuals" Value="True" />
18+
<Setter Property="HorizontalAlignment" Value="Stretch" />
19+
<Setter Property="Background" Value="{ThemeResource ControlFillColorDefaultBrush}" />
20+
<!--<Setter Property="Padding" Value="{StaticResource OmnibarUnfocusedRootPadding}" />-->
21+
<Setter Property="BorderBrush" Value="{ThemeResource CircleElevationBorderBrush}" />
22+
<!--<Setter Property="BorderThickness" Value="{StaticResource OmnibarUnfocusedBorderThickness}" />-->
23+
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
24+
<!--<Setter Property="CornerRadius" Value="{StaticResource OmnibarDefaultCornerRadius}" />-->
25+
<Setter Property="VerticalAlignment" Value="Center" />
26+
<Setter Property="IsFocusEngagementEnabled" Value="True" />
27+
<Setter Property="Template">
28+
<Setter.Value>
29+
<ControlTemplate TargetType="local:Breadcrumb">
30+
<Grid x:Name="PART_RootGrid" />
31+
</ControlTemplate>
32+
</Setter.Value>
33+
</Setter>
34+
</Style>
35+
36+
</ResourceDictionary>

src/Files.App.Controls/Themes/Generic.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<!--#endregion-->
5656

5757
<!--#region SidebarView-->
58-
<ResourceDictionary Source="ms-appx:///Files.App.Controls/Sidebar/SidebarStyles.xaml" />
58+
<ResourceDictionary Source="ms-appx:///Files.App.Controls/Sidebar/SidebarStyles.xaml" />
5959
<!--#endregion-->
6060

6161
<!--#region Omnibar-->
@@ -67,6 +67,10 @@
6767
<ResourceDictionary Source="ms-appx:///Files.App.Controls/SamplePanel/SamplePanel.xaml" />
6868
<!--#endregion-->
6969

70+
<!--#region Breadcrumb-->
71+
<ResourceDictionary Source="ms-appx:///Files.App.Controls/Breadcrumb/Breadcrumb.xaml" />
72+
<!--#endregion-->
73+
7074
</ResourceDictionary.MergedDictionaries>
7175

7276
</ResourceDictionary>

tests/Files.App.UITests/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<NavigationViewItem Content="SidebarView" Tag="SidebarViewPage" />
9393
<NavigationViewItem Content="StorageRing/StorageBar" Tag="StorageControlsPage" />
9494
<NavigationViewItem Content="Omnibar" Tag="OmnibarPage" />
95+
<NavigationViewItem Content="Breadcrumb" Tag="BreadcrumbPage" />
9596
</NavigationViewItem.MenuItems>
9697
</NavigationViewItem>
9798
</NavigationView.MenuItems>

tests/Files.App.UITests/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ private void NavigationView_SelectionChanged(NavigationView sender, NavigationVi
5050
nameof(StorageControlsPage) => typeof(StorageControlsPage),
5151
nameof(SidebarViewPage) => typeof(SidebarViewPage),
5252
nameof(OmnibarPage) => typeof(OmnibarPage),
53+
nameof(BreadcrumbPage) => typeof(BreadcrumbPage),
5354
_ => throw new InvalidOperationException("There's no applicable page associated with the given key."),
5455
});
5556

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
2+
<Page
3+
x:Class="Files.App.UITests.Views.BreadcrumbPage"
4+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:controls="using:Files.App.Controls"
7+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
8+
xmlns:local="using:Files.App.UITests.Views"
9+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
10+
mc:Ignorable="d">
11+
12+
<StackPanel Spacing="24">
13+
14+
<controls:SamplePanel Header="Default usage">
15+
<controls:SamplePanel.MainContent>
16+
<StackPanel>
17+
<TextBlock
18+
HorizontalAlignment="Center"
19+
VerticalAlignment="Center"
20+
FontStyle="Italic"
21+
Text="Breadcrumb will come soon in here." />
22+
</StackPanel>
23+
</controls:SamplePanel.MainContent>
24+
</controls:SamplePanel>
25+
26+
</StackPanel>
27+
</Page>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.UI.Xaml;
5+
using Microsoft.UI.Xaml.Controls;
6+
7+
namespace Files.App.UITests.Views
8+
{
9+
public sealed partial class BreadcrumbPage : Page
10+
{
11+
public BreadcrumbPage()
12+
{
13+
InitializeComponent();
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)