Skip to content

Commit e7bf220

Browse files
committed
Code Quality: Added placeholder content for Shelf
1 parent 7728bda commit e7bf220

File tree

10 files changed

+260
-2
lines changed

10 files changed

+260
-2
lines changed
Lines changed: 39 additions & 0 deletions
Loading
Lines changed: 39 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4194,6 +4194,9 @@
41944194
<value>Enable Omnibar</value>
41954195
</data>
41964196
<data name="SectionsHiddenMessage" xml:space="preserve">
4197-
<value>You can add sections to the sidebar by right-clicking 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>
4198+
</data>
4199+
<data name="EmptyShelfText" xml:space="preserve">
4200+
<value>Drag files or folders here to interact with them across different tabs</value>
41984201
</data>
41994202
</root>

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@
325325
<!-- Right Side Action Buttons -->
326326
<StackPanel
327327
Grid.Column="2"
328+
Margin="0,0,4,0"
328329
Orientation="Horizontal"
329330
Spacing="4">
330331

src/Files.App/UserControls/Pane/ShelfPane.xaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,28 @@
1111
mc:Ignorable="d">
1212

1313
<UserControl.Resources>
14-
<converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
14+
<ResourceDictionary>
15+
<converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
16+
17+
<ResourceDictionary.ThemeDictionaries>
18+
<ResourceDictionary x:Key="Light">
19+
<ImageSource x:Key="EmptyShelf.48">ms-appx:///Assets/Shelf/EmptyShelf_48_ThemeLight.svg</ImageSource>
20+
<ImageSource x:Key="EmptyShelf.100">ms-appx:///Assets/Shelf/EmptyShelf_100_ThemeLight.svg</ImageSource>
21+
<ImageSource x:Key="EmptyShelf.200">ms-appx:///Assets/Shelf/EmptyShelf_200_ThemeLight.svg</ImageSource>
22+
</ResourceDictionary>
23+
<ResourceDictionary x:Key="Dark">
24+
<ImageSource x:Key="EmptyShelf.48">ms-appx:///Assets/Shelf/EmptyShelf_48_ThemeDark.svg</ImageSource>
25+
<ImageSource x:Key="EmptyShelf.100">ms-appx:///Assets/Shelf/EmptyShelf_100_ThemeDark.svg</ImageSource>
26+
<ImageSource x:Key="EmptyShelf.200">ms-appx:///Assets/Shelf/EmptyShelf_200_ThemeDark.svg</ImageSource>
27+
</ResourceDictionary>
28+
<ResourceDictionary x:Key="HighContrast">
29+
<ImageSource x:Key="EmptyShelf.48">ms-appx:///Assets/Shelf/EmptyShelf_48_ThemeDark.svg</ImageSource>
30+
<ImageSource x:Key="EmptyShelf.100">ms-appx:///Assets/Shelf/EmptyShelf_100_ThemeDark.svg</ImageSource>
31+
<ImageSource x:Key="EmptyShelf.200">ms-appx:///Assets/Shelf/EmptyShelf_200_ThemeDark.svg</ImageSource>
32+
</ResourceDictionary>
33+
</ResourceDictionary.ThemeDictionaries>
34+
35+
</ResourceDictionary>
1536
</UserControl.Resources>
1637

1738
<Grid
@@ -31,6 +52,7 @@
3152
<RowDefinition Height="Auto" />
3253
</Grid.RowDefinitions>
3354

55+
<!-- Shelf Header -->
3456
<StackPanel
3557
Grid.Row="0"
3658
Padding="12,12,12,4"
@@ -48,6 +70,30 @@
4870

4971
</StackPanel>
5072

73+
<!-- Empty Shelf Content -->
74+
<StackPanel
75+
x:Name="EmptyShelfContent"
76+
Grid.Row="1"
77+
Padding="16,0,16,0"
78+
VerticalAlignment="Center"
79+
Orientation="Vertical"
80+
Spacing="16"
81+
Visibility="Collapsed">
82+
83+
<Image
84+
x:Name="EmptyShelfImage"
85+
MaxHeight="48"
86+
Source="{ThemeResource EmptyShelf.48}" />
87+
88+
<TextBlock
89+
MaxWidth="240"
90+
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
91+
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
92+
Text="{helpers:ResourceString Name=EmptyShelfText}"
93+
TextAlignment="Center" />
94+
95+
</StackPanel>
96+
5197
<!-- Items List -->
5298
<ListView
5399
x:Name="ShelfItemsList"
@@ -101,6 +147,7 @@
101147
</ListView>
102148

103149

150+
<!-- Shelf Footer -->
104151
<StackPanel
105152
Grid.Row="2"
106153
Padding="12,12,12,4"

src/Files.App/UserControls/Pane/ShelfPane.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ private async void Shelf_Drop(object sender, DragEventArgs e)
6060

6161
ItemsSource.Add(shelfItem);
6262
}
63+
64+
// ToDo bind to property in view model
65+
EmptyShelfContent.Visibility = ItemsSource.Count == 0 ? Microsoft.UI.Xaml.Visibility.Visible : Microsoft.UI.Xaml.Visibility.Collapsed;
6366
}
6467

6568
private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)

0 commit comments

Comments
 (0)