Skip to content

Commit 100dd21

Browse files
committed
Updated section
1 parent a0fece5 commit 100dd21

File tree

11 files changed

+260
-10
lines changed

11 files changed

+260
-10
lines changed

src/Files.App.Controls/Sidebar/SidebarView.Properties.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ public UIElement InnerContent
2121
public static readonly DependencyProperty InnerContentProperty =
2222
DependencyProperty.Register(nameof(InnerContent), typeof(UIElement), typeof(SidebarView), new PropertyMetadata(null));
2323

24+
public UIElement SidebarContent
25+
{
26+
get { return (UIElement)GetValue(SidebarContentProperty); }
27+
set { SetValue(SidebarContentProperty, value); }
28+
}
29+
public static readonly DependencyProperty SidebarContentProperty =
30+
DependencyProperty.Register("SidebarContent", typeof(UIElement), typeof(SidebarView), new PropertyMetadata(null));
31+
2432
public UIElement Footer
2533
{
2634
get { return (UIElement)GetValue(FooterProperty); }

src/Files.App.Controls/Sidebar/SidebarView.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@
5757
<CompositeTransform x:Name="PaneColumnGridTransform" />
5858
</Grid.RenderTransform>
5959

60+
<!-- Content -->
61+
<ContentPresenter
62+
Grid.RowSpan="2"
63+
HorizontalAlignment="Stretch"
64+
VerticalAlignment="Stretch"
65+
HorizontalContentAlignment="Stretch"
66+
VerticalContentAlignment="Stretch"
67+
Content="{x:Bind SidebarContent, Mode=OneWay}" />
68+
6069
<!-- Menu Items -->
6170
<ItemsRepeaterScrollHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
6271
<ScrollViewer
Lines changed: 33 additions & 0 deletions
Loading
Lines changed: 33 additions & 0 deletions
Loading
Lines changed: 43 additions & 0 deletions
Loading
Lines changed: 43 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,10 +4193,7 @@
41934193
<data name="EnableOmnibar" xml:space="preserve">
41944194
<value>Enable Omnibar</value>
41954195
</data>
4196-
<data name="SectionsHidden" xml:space="preserve">
4197-
<value>Sections hidden</value>
4198-
</data>
41994196
<data name="SectionsHiddenMessage" xml:space="preserve">
4200-
<value>You can add the sections back by right-clicking the sidebar area and selecting the sections you want to add.</value>
4197+
<value>You can add sections to the sidebar by right-clicking and selecting the sections you want to add.</value>
42014198
</data>
42024199
</root>

src/Files.App/Views/MainPage.xaml

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@
3131
<ResourceDictionary Source="ms-appx:///Styles/DefaultGridSplitterStyle.xaml" />
3232
</ResourceDictionary.MergedDictionaries>
3333

34+
<ResourceDictionary.ThemeDictionaries>
35+
<ResourceDictionary x:Key="Light">
36+
<ImageSource x:Key="EmptySidebar.48">ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeLight.svg</ImageSource>
37+
<ImageSource x:Key="EmptySidebar.100">ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeLight.svg</ImageSource>
38+
<ImageSource x:Key="EmptySidebar.200">ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeLight.svg</ImageSource>
39+
</ResourceDictionary>
40+
<ResourceDictionary x:Key="Dark">
41+
<ImageSource x:Key="EmptySidebar.48">ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeDark.svg</ImageSource>
42+
<ImageSource x:Key="EmptySidebar.100">ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeDark.svg</ImageSource>
43+
<ImageSource x:Key="EmptySidebar.200">ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeDark.svg</ImageSource>
44+
</ResourceDictionary>
45+
<ResourceDictionary x:Key="HighContrast">
46+
<ImageSource x:Key="EmptySidebar.48">ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeDark.svg</ImageSource>
47+
<ImageSource x:Key="EmptySidebar.100">ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeDark.svg</ImageSource>
48+
<ImageSource x:Key="EmptySidebar.200">ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeDark.svg</ImageSource>
49+
</ResourceDictionary>
50+
</ResourceDictionary.ThemeDictionaries>
51+
3452
<x:Boolean x:Key="True">True</x:Boolean>
3553
<x:Boolean x:Key="False">False</x:Boolean>
3654

@@ -259,14 +277,33 @@
259277
</Grid>
260278
</controls:SidebarView.InnerContent>
261279

280+
<!-- Sidebar Content -->
281+
<controls:SidebarView.SidebarContent>
282+
<StackPanel
283+
x:Name="SidebarContent"
284+
Padding="16,0,16,0"
285+
VerticalAlignment="Center"
286+
Orientation="Vertical"
287+
Spacing="16"
288+
Visibility="{x:Bind SidebarAdaptiveViewModel.AreSectionsHidden, Mode=OneWay}">
289+
290+
<Image
291+
x:Name="EmptySidebarImage"
292+
MaxHeight="48"
293+
Source="{ThemeResource EmptySidebar.48}" />
294+
295+
<TextBlock
296+
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
297+
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
298+
Text="{helpers:ResourceString Name=SectionsHiddenMessage}"
299+
TextAlignment="Center" />
300+
301+
</StackPanel>
302+
</controls:SidebarView.SidebarContent>
303+
304+
<!-- Footer -->
262305
<controls:SidebarView.Footer>
263306
<StackPanel Padding="4" Spacing="4">
264-
<InfoBar
265-
Title="{helpers:ResourceString Name=SectionsHidden}"
266-
IsClosable="False"
267-
IsOpen="{x:Bind SidebarAdaptiveViewModel.AreSectionsHidden, Mode=OneWay}"
268-
Message="{helpers:ResourceString Name=SectionsHiddenMessage}" />
269-
270307
<Border
271308
Height="1"
272309
HorizontalAlignment="Stretch"
@@ -328,6 +365,21 @@
328365
</controls:SidebarView>
329366

330367
<VisualStateManager.VisualStateGroups>
368+
<VisualStateGroup x:Name="SidebarWidthStates">
369+
<VisualState x:Name="NarrowSidebarWidthState">
370+
<VisualState.Setters>
371+
<Setter Target="EmptySidebarImage.MaxHeight" Value="48" />
372+
<Setter Target="EmptySidebarImage.Source" Value="{ThemeResource EmptySidebar.48}" />
373+
</VisualState.Setters>
374+
</VisualState>
375+
<VisualState x:Name="WideSidebarWidthState">
376+
<VisualState.Setters>
377+
<Setter Target="EmptySidebarImage.MaxHeight" Value="100" />
378+
<Setter Target="EmptySidebarImage.Source" Value="{ThemeResource EmptySidebar.100}" />
379+
</VisualState.Setters>
380+
</VisualState>
381+
</VisualStateGroup>
382+
331383
<VisualStateGroup>
332384
<VisualState>
333385
<VisualState.StateTriggers>
@@ -343,6 +395,7 @@
343395
</VisualState.Setters>
344396
</VisualState>
345397
</VisualStateGroup>
398+
346399
<VisualStateGroup>
347400
<VisualState x:Name="NormalSidebarState">
348401
<VisualState.StateTriggers>

0 commit comments

Comments
 (0)