Skip to content

Commit 9b0200a

Browse files
committed
WIP: Individual Ribbon Item Sizing
1 parent 936d338 commit 9b0200a

26 files changed

+2610
-2287
lines changed

Files.Package/Files.Package.wapproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<GenerateTestArtifacts>False</GenerateTestArtifacts>
6060
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
6161
<EntryPointProjectUniqueName>..\Files\Files.csproj</EntryPointProjectUniqueName>
62-
<PackageCertificateThumbprint>10EF406F2BC44E3C8E8F85988D53990173626FC1</PackageCertificateThumbprint>
62+
<PackageCertificateThumbprint>72235815D2912224F3229AE45F9386420BE848AA</PackageCertificateThumbprint>
6363
</PropertyGroup>
6464
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
6565
<AppxBundle>Always</AppxBundle>

Files.Package/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop">
3-
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.0.0" />
3+
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=Luke Blevins" Version="0.7.0.0" />
44
<Properties>
55
<DisplayName>Files UWP - Preview</DisplayName>
66
<PublisherDisplayName>Yair A</PublisherDisplayName>

Files/BaseLayout.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Files
2424
/// <summary>
2525
/// The base class which every layout page must derive from
2626
/// </summary>
27-
public class BaseLayout : Page
27+
public abstract class BaseLayout : Page
2828
{
2929
public bool IsQuickLookEnabled { get; set; } = false;
3030

@@ -95,60 +95,60 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
9595
InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView;
9696
instanceTabsView.TabStrip_SelectionChanged(null, null);
9797
}
98-
App.CurrentInstance.CanRefresh = true;
98+
App.CurrentInstance.NavigationControl.CanRefresh = true;
9999
(App.CurrentInstance.OperationsControl as RibbonArea).RibbonViewModel.AlwaysPresentCommands.isEnabled = true;
100100
AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed;
101101
App.CurrentInstance.ViewModel.Universal.path = parameters;
102102

103103
if (App.CurrentInstance.ViewModel.Universal.path == Path.GetPathRoot(App.CurrentInstance.ViewModel.Universal.path))
104104
{
105-
(App.CurrentInstance.OperationsControl as RibbonArea).Up.IsEnabled = false;
105+
App.CurrentInstance.NavigationControl.CanNavigateToParent = false;
106106
}
107107
else
108108
{
109-
(App.CurrentInstance.OperationsControl as RibbonArea).Up.IsEnabled = true;
109+
App.CurrentInstance.NavigationControl.CanNavigateToParent = true;
110110
}
111111

112112
App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.Universal.path);
113113
App.Clipboard_ContentChanged(null, null);
114114

115115
if (parameters.Equals(App.AppSettings.DesktopPath))
116116
{
117-
App.CurrentInstance.PathControlDisplayText = "Desktop";
117+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Desktop";
118118
}
119119
else if (parameters.Equals(App.AppSettings.DocumentsPath))
120120
{
121-
App.CurrentInstance.PathControlDisplayText = "Documents";
121+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Documents";
122122
}
123123
else if (parameters.Equals(App.AppSettings.DownloadsPath))
124124
{
125-
App.CurrentInstance.PathControlDisplayText = "Downloads";
125+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Downloads";
126126
}
127127
else if (parameters.Equals(App.AppSettings.PicturesPath))
128128
{
129-
App.CurrentInstance.PathControlDisplayText = "Pictures";
129+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Pictures";
130130
}
131131
else if (parameters.Equals(App.AppSettings.MusicPath))
132132
{
133-
App.CurrentInstance.PathControlDisplayText = "Music";
133+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Music";
134134
}
135135
else if (parameters.Equals(App.AppSettings.OneDrivePath))
136136
{
137-
App.CurrentInstance.PathControlDisplayText = "OneDrive";
137+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "OneDrive";
138138
}
139139
else if (parameters.Equals(App.AppSettings.VideosPath))
140140
{
141-
App.CurrentInstance.PathControlDisplayText = "Videos";
141+
App.CurrentInstance.NavigationControl.PathControlDisplayText = "Videos";
142142
}
143143
else
144144
{
145145
if (parameters.Equals(@"C:\") || parameters.Equals(@"c:\"))
146146
{
147-
App.CurrentInstance.PathControlDisplayText = @"Local Disk (C:\)";
147+
App.CurrentInstance.NavigationControl.PathControlDisplayText = @"Local Disk (C:\)";
148148
}
149149
else
150150
{
151-
App.CurrentInstance.PathControlDisplayText = parameters;
151+
App.CurrentInstance.NavigationControl.PathControlDisplayText = parameters;
152152
}
153153
}
154154
}

Files/Files.csproj

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,21 @@
146146
<Compile Include="CommandLine\ParsedCommand.cs" />
147147
<Compile Include="CommandLine\ParsedCommands.cs" />
148148
<Compile Include="CommandLine\ParsedCommandType.cs" />
149-
<Compile Include="UserControls\RibbonArea.xaml.cs">
149+
<Compile Include="UserControls\NavigationToolbar\INavigationToolbar.cs" />
150+
<Compile Include="UserControls\NavigationToolbar\NavigationToolbar.xaml.cs">
151+
<DependentUpon>NavigationToolbar.xaml</DependentUpon>
152+
</Compile>
153+
<Compile Include="UserControls\Ribbon\IRibbonItem.cs" />
154+
<Compile Include="UserControls\Ribbon\RibbonArea.xaml.cs">
150155
<DependentUpon>RibbonArea.xaml</DependentUpon>
151156
</Compile>
152-
<Compile Include="UserControls\RibbonPage.xaml.cs">
157+
<Compile Include="UserControls\Ribbon\RibbonCommandItem.xaml.cs">
158+
<DependentUpon>RibbonCommandItem.xaml</DependentUpon>
159+
</Compile>
160+
<Compile Include="UserControls\Ribbon\RibbonDividerItem.xaml.cs">
161+
<DependentUpon>RibbonDividerItem.xaml</DependentUpon>
162+
</Compile>
163+
<Compile Include="UserControls\Ribbon\RibbonPage.xaml.cs">
153164
<DependentUpon>RibbonPage.xaml</DependentUpon>
154165
</Compile>
155166
<Compile Include="UserControls\Sidebar.xaml.cs">
@@ -295,11 +306,23 @@
295306
<Generator>MSBuild:Compile</Generator>
296307
<SubType>Designer</SubType>
297308
</ApplicationDefinition>
298-
<Page Include="UserControls\RibbonArea.xaml">
309+
<Page Include="UserControls\NavigationToolbar\NavigationToolbar.xaml">
310+
<SubType>Designer</SubType>
311+
<Generator>MSBuild:Compile</Generator>
312+
</Page>
313+
<Page Include="UserControls\Ribbon\RibbonArea.xaml">
314+
<SubType>Designer</SubType>
315+
<Generator>MSBuild:Compile</Generator>
316+
</Page>
317+
<Page Include="UserControls\Ribbon\RibbonCommandItem.xaml">
318+
<SubType>Designer</SubType>
319+
<Generator>MSBuild:Compile</Generator>
320+
</Page>
321+
<Page Include="UserControls\Ribbon\RibbonDividerItem.xaml">
299322
<SubType>Designer</SubType>
300323
<Generator>MSBuild:Compile</Generator>
301324
</Page>
302-
<Page Include="UserControls\RibbonPage.xaml">
325+
<Page Include="UserControls\Ribbon\RibbonPage.xaml">
303326
<SubType>Designer</SubType>
304327
<Generator>MSBuild:Compile</Generator>
305328
</Page>

Files/Filesystem/ItemViewModel.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private void JumpTimer_Tick(object sender, object e)
267267
private void Universal_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
268268
{
269269
// Clear the path UI
270-
App.CurrentInstance.PathComponents.Clear();
270+
App.CurrentInstance.NavigationControl.PathComponents.Clear();
271271
// Style tabStyleFixed = App.selectedTabInstance.accessiblePathTabView.Resources["PathSectionTabStyle"] as Style;
272272
FontWeight weight = new FontWeight()
273273
{
@@ -302,7 +302,7 @@ private void Universal_PropertyChanged(object sender, System.ComponentModel.Prop
302302
Title = componentLabel,
303303
Path = tag,
304304
};
305-
App.CurrentInstance.PathComponents.Add(item);
305+
App.CurrentInstance.NavigationControl.PathComponents.Add(item);
306306
}
307307
else
308308
{
@@ -322,7 +322,7 @@ private void Universal_PropertyChanged(object sender, System.ComponentModel.Prop
322322
Title = componentLabel,
323323
Path = tag,
324324
};
325-
App.CurrentInstance.PathComponents.Add(item);
325+
App.CurrentInstance.NavigationControl.PathComponents.Add(item);
326326

327327
}
328328
index++;
@@ -405,9 +405,9 @@ public void CancelLoadAndClearFiles()
405405
{
406406
_fileQueryResult.ContentsChanged -= FileContentsChanged;
407407
}
408-
App.CurrentInstance.CanGoBack = true;
409-
App.CurrentInstance.CanGoForward = true;
410-
App.CurrentInstance.CanNavigateToParent = true;
408+
App.CurrentInstance.NavigationControl.CanGoBack = true;
409+
App.CurrentInstance.NavigationControl.CanGoForward = true;
410+
App.CurrentInstance.NavigationControl.CanNavigateToParent = true;
411411

412412
}
413413

@@ -610,7 +610,7 @@ public async void LoadExtendedItemProperties(ListedItem item)
610610

611611
public async void RapidAddItemsToCollectionAsync(string path)
612612
{
613-
App.CurrentInstance.CanRefresh = false;
613+
App.CurrentInstance.NavigationControl.CanRefresh = false;
614614

615615
Frame rootFrame = Window.Current.Content as Frame;
616616
var instanceTabsView = rootFrame.Content as InstanceTabsView;
@@ -650,8 +650,8 @@ public async void RapidAddItemsToCollectionAsync(string path)
650650
break;
651651
}
652652

653-
App.CurrentInstance.CanGoBack = App.CurrentInstance.ContentFrame.CanGoBack;
654-
App.CurrentInstance.CanGoForward = App.CurrentInstance.ContentFrame.CanGoForward;
653+
App.CurrentInstance.NavigationControl.CanGoBack = App.CurrentInstance.ContentFrame.CanGoBack;
654+
App.CurrentInstance.NavigationControl.CanGoForward = App.CurrentInstance.ContentFrame.CanGoForward;
655655

656656
try
657657
{
@@ -732,7 +732,7 @@ public async void RapidAddItemsToCollectionAsync(string path)
732732
OrderFiles();
733733
stopwatch.Stop();
734734
Debug.WriteLine("Loading of items in " + Universal.path + " completed in " + stopwatch.ElapsedMilliseconds + " milliseconds.\n");
735-
App.CurrentInstance.CanRefresh = true;
735+
App.CurrentInstance.NavigationControl.CanRefresh = true;
736736
LoadIndicator.isVisible = Visibility.Collapsed;
737737
isLoadingItems = false;
738738
}
@@ -826,7 +826,7 @@ public async void AddItemsToCollectionAsync(string path)
826826
RapidAddItemsToCollectionAsync(path);
827827
return;
828828
// Eventually add logic for user choice between item load methods
829-
App.CurrentInstance.CanRefresh = false;
829+
App.CurrentInstance.NavigationControl.CanRefresh = false;
830830

831831
Frame rootFrame = Window.Current.Content as Frame;
832832
var instanceTabsView = rootFrame.Content as InstanceTabsView;
@@ -885,8 +885,8 @@ public async void AddItemsToCollectionAsync(string path)
885885
FileSizeBytes = 0
886886
};
887887

888-
App.CurrentInstance.CanGoBack = App.CurrentInstance.ContentFrame.CanGoBack;
889-
App.CurrentInstance.CanGoForward = App.CurrentInstance.ContentFrame.CanGoForward;
888+
App.CurrentInstance.NavigationControl.CanGoBack = App.CurrentInstance.ContentFrame.CanGoBack;
889+
App.CurrentInstance.NavigationControl.CanGoForward = App.CurrentInstance.ContentFrame.CanGoForward;
890890

891891
switch (await _rootFolder.GetIndexedStateAsync())
892892
{
@@ -982,7 +982,7 @@ public async void AddItemsToCollectionAsync(string path)
982982
OrderFiles();
983983
stopwatch.Stop();
984984
Debug.WriteLine("Loading of items in " + Universal.path + " completed in " + stopwatch.ElapsedMilliseconds + " milliseconds.\n");
985-
App.CurrentInstance.CanRefresh = true;
985+
App.CurrentInstance.NavigationControl.CanRefresh = true;
986986
}
987987
catch (UnauthorizedAccessException)
988988
{

Files/IShellPage.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Files.Filesystem;
22
using Files.Interacts;
3+
using Files.UserControls;
34
using System;
45
using System.Collections.Generic;
56
using System.Collections.ObjectModel;
@@ -17,12 +18,7 @@ public interface IShellPage
1718
public ItemViewModel ViewModel { get; }
1819
public BaseLayout ContentPage { get; }
1920
public Control OperationsControl { get; }
20-
public bool CanRefresh { get; set; }
21-
public bool CanNavigateToParent { get; set; }
22-
public bool CanGoBack { get; set; }
23-
public bool CanGoForward { get; set; }
24-
public string PathControlDisplayText { get; set; }
25-
public ObservableCollection<PathBoxItem> PathComponents { get; }
2621
public Type CurrentPageType { get; }
22+
public INavigationToolbar NavigationControl { get; }
2723
}
2824
}

0 commit comments

Comments
 (0)