Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added collapsible sections to the sidebar #3661

Merged
merged 47 commits into from Feb 25, 2021
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c3456d5
Added collapsible Drivers/Cloud Drivers on Sidebar control
oleitao Feb 21, 2021
d0a6ac8
-Rename to ChildItems
oleitao Feb 21, 2021
57ec6ef
Added favorites collapsible section
oleitao Feb 21, 2021
c727add
Keep track of the collapsed/expanded state by section
oleitao Feb 21, 2021
292bcbf
Squashed commit of the following:
gave92 Feb 21, 2021
51bf841
Merge remote-tracking branch 'origin/main' into rev_temp
gave92 Feb 21, 2021
d817535
Fix right click always opening Home
gave92 Feb 21, 2021
c662112
Separated home and quickaccess
gave92 Feb 21, 2021
addc62e
Do not select headers
gave92 Feb 21, 2021
1bd699e
Network drives collapsible section added
oleitao Feb 21, 2021
2cd016f
Added settings
yaira2 Feb 21, 2021
131743a
Merge commit 'refs/pull/3661/head' of https://github.com/duke7553/fil…
gave92 Feb 21, 2021
1ec99c2
Merge branch 'main' of https://github.com/duke7553/files-uwp into rev…
gave92 Feb 21, 2021
c812982
Added sections icons
oleitao Feb 21, 2021
bbcff35
Auto expand sections on hover
gave92 Feb 21, 2021
9864150
Merge branch 'collapsible-side-layout' of https://github.com/oleitao/…
oleitao Feb 22, 2021
66333b2
yaichenbaum changes review
oleitao Feb 22, 2021
183f240
yaichenbaum changes review
oleitao Feb 22, 2021
5d37d66
gave92 merge fix
oleitao Feb 22, 2021
45f3699
Merge commit 'refs/pull/3661/head' of https://github.com/duke7553/fil…
gave92 Feb 22, 2021
198441b
Removed unnecessary settings
gave92 Feb 22, 2021
11c53b8
Fix recyclebin context menu, Code cleanup
gave92 Feb 22, 2021
8094cb3
yaichenbaum rename the quick access section to favorites section
oleitao Feb 23, 2021
613c057
Expanded state be saved to AppSettings so it's persisted across app r…
oleitao Feb 23, 2021
95af988
Settings sidebar panels order fix
oleitao Feb 24, 2021
7a6902f
Removed sidebar settings page
gave92 Feb 24, 2021
d881ddb
Revert change to LocationItem
gave92 Feb 24, 2021
5172eb0
Merge remote-tracking branch 'origin/main' into rev_collapse
gave92 Feb 24, 2021
e4491d6
Removed SidebarViewModel
gave92 Feb 24, 2021
e3fa8ac
Update Files/Strings/en-US/Resources.resw
yaira2 Feb 24, 2021
9a88821
Removed extra settings
gave92 Feb 24, 2021
4362bdd
Merge commit 'refs/pull/3661/head' of https://github.com/duke7553/fil…
gave92 Feb 24, 2021
59454e2
Updated strings
yaira2 Feb 24, 2021
cc80fcb
Cleaning up settings page
gave92 Feb 24, 2021
1eb6fdd
Added Star icon on 'Favorites' section
oleitao Feb 24, 2021
29778d7
Move recyclebin to favorites
gave92 Feb 24, 2021
6d12496
Update Files/Views/Settings.xaml.cs
yaira2 Feb 24, 2021
abbd5dc
Merge commit 'refs/pull/3661/head' of https://github.com/duke7553/fil…
gave92 Feb 24, 2021
a2217a9
yaichenbaum fix review
oleitao Feb 24, 2021
a1e47e7
Move recyclebin at the end
gave92 Feb 24, 2021
4c97acd
Merge branch 'collapsible-side-layout' of https://github.com/oleitao/…
oleitao Feb 24, 2021
16312b1
Merge commit 'refs/pull/3661/head' of https://github.com/duke7553/fil…
gave92 Feb 24, 2021
41f1763
Update Files/Filesystem/Drives.cs
yaira2 Feb 24, 2021
1edbb62
Moved the home item into the favorites section
oleitao Feb 24, 2021
9977edb
review fixes
oleitao Feb 24, 2021
7b27328
gave92 fix review
oleitao Feb 24, 2021
04f363c
Added favorite section icon
oleitao Feb 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 20 additions & 4 deletions Files/DataModels/SidebarPinnedModel.cs
Expand Up @@ -278,6 +278,21 @@ public async Task AddItemToSidebarAsync(string path)
}
}

/// <summary>
/// Adds the item to sidebar asynchronous.
/// </summary>
/// <param name="section">The section.</param>
public async Task AddItemToSidebarAsync(LocationItem section)
gave92 marked this conversation as resolved.
Show resolved Hide resolved
{
var lastItem = favoriteSection.ChildItems.LastOrDefault(x => x.ItemType == NavigationControlItemType.Location && !x.Path.Equals(App.AppSettings.RecycleBinPath));
int insertIndex = lastItem != null ? favoriteSection.ChildItems.IndexOf(lastItem) + 1 : 0;

if (!favoriteSection.ChildItems.Contains(section))
{
favoriteSection.ChildItems.Insert(insertIndex, section);
}
}

/// <summary>
/// Adds all items to the navigation sidebar
/// </summary>
Expand All @@ -287,15 +302,16 @@ public async Task AddAllItemsToSidebar()
try
{
MainPage.SideBarItems.BeginBulkOperation();

if (homeSection != null)
gave92 marked this conversation as resolved.
Show resolved Hide resolved
await AddItemToSidebarAsync(homeSection);

for (int i = 0; i < Items.Count(); i++)
{
string path = Items[i];
await AddItemToSidebarAsync(path);
}
if (!MainPage.SideBarItems.Contains(homeSection))
{
MainPage.SideBarItems.Add(homeSection);
}

if (!MainPage.SideBarItems.Contains(favoriteSection))
{
MainPage.SideBarItems.Add(favoriteSection);
Expand Down