Skip to content

Commit 1eb0e0a

Browse files
lukeblevinsyaira2tsvietOK
authored
Added settings to choose multitasking preferences (#1833)
Co-authored-by: Yair Aichenbaum <[email protected]> Co-authored-by: Vladyslav Tsvietkov <[email protected]>
1 parent b195651 commit 1eb0e0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+913
-307
lines changed

Files/App.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Files.View_Models;
88
using Files.Views;
99
using Microsoft.Toolkit.Uwp.Helpers;
10-
using Microsoft.Toolkit.Uwp.Notifications;
1110
using Newtonsoft.Json;
1211
using NLog;
1312
using System;
@@ -20,7 +19,6 @@
2019
using Windows.ApplicationModel.AppService;
2120
using Windows.Storage;
2221
using Windows.UI.Core;
23-
using Windows.UI.Notifications;
2422
using Windows.UI.ViewManagement;
2523
using Windows.UI.Xaml;
2624
using Microsoft.AppCenter;
@@ -29,11 +27,16 @@
2927
using Windows.UI.Xaml.Controls;
3028
using Windows.UI.Xaml.Media.Animation;
3129
using Windows.UI.Xaml.Navigation;
30+
using Microsoft.Toolkit.Uwp.Notifications;
31+
using Windows.UI.Notifications;
32+
using Files.UserControls.MultiTaskingControl;
3233

3334
namespace Files
3435
{
3536
sealed partial class App : Application
3637
{
38+
public static IMultitaskingControl MultitaskingControl = null;
39+
3740
private static IShellPage currentInstance;
3841
private static bool ShowErrorNotification = false;
3942

Files/BaseLayout.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
257257
App.CurrentInstance.InstanceViewModel.IsPageTypeRecycleBin = workingDir.StartsWith(App.AppSettings.RecycleBinPath);
258258
App.CurrentInstance.InstanceViewModel.IsPageTypeMtpDevice = workingDir.StartsWith("\\\\?\\");
259259

260-
await App.CurrentInstance.MultitaskingControl?.SetSelectedTabInfo(new DirectoryInfo(workingDir).Name, workingDir);
260+
await App.MultitaskingControl?.SetSelectedTabInfo(new DirectoryInfo(workingDir).Name, workingDir);
261261
App.CurrentInstance.FilesystemViewModel.RefreshItems();
262262

263-
App.CurrentInstance.MultitaskingControl?.SelectionChanged();
263+
App.MultitaskingControl?.SelectionChanged();
264264
MainPage.Clipboard_ContentChanged(null, null);
265265
App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters;
266266
}
@@ -535,7 +535,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
535535
AssociatedInteractions = App.CurrentInstance.InteractionOperations;
536536
if (App.CurrentInstance == null)
537537
{
538-
App.CurrentInstance = VerticalTabView.GetCurrentSelectedTabInstance<ModernShellPage>();
538+
App.CurrentInstance = VerticalTabViewControl.GetCurrentSelectedTabInstance<ModernShellPage>();
539539
}
540540
}
541541
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using Windows.Storage;
3+
using Windows.UI.Xaml;
4+
using Windows.UI.Xaml.Data;
5+
6+
namespace Files.Converters
7+
{
8+
internal class MultiBooleanConverter
9+
{
10+
public static Boolean Convert(bool a, bool b)
11+
=> (a || b) ? true : false;
12+
}
13+
}

Files/Dialogs/ExceptionDialog.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public ExceptionDialog()
1818

1919
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
2020
{
21-
if (App.CurrentInstance.MultitaskingControl.Items.Count == 1)
21+
if (App.MultitaskingControl.Items.Count == 1)
2222
{
2323
App.CloseApp();
2424
}
25-
else if (App.CurrentInstance.MultitaskingControl.Items.Count > 1)
25+
else if (App.MultitaskingControl.Items.Count > 1)
2626
{
27-
App.CurrentInstance.MultitaskingControl.Items.RemoveAt(App.InteractionViewModel.TabStripSelectedIndex);
27+
App.MultitaskingControl.Items.RemoveAt(App.InteractionViewModel.TabStripSelectedIndex);
2828
}
2929
}
3030

Files/Files.csproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
<Compile Include="CommandLine\ParsedCommandType.cs" />
157157
<Compile Include="Controllers\IJson.cs" />
158158
<Compile Include="Controllers\SidebarPinnedController.cs" />
159+
<Compile Include="Converters\MultiBooleanConverter.cs" />
159160
<Compile Include="Converters\StorageDeleteOptionToBooleanConverter.cs" />
160161
<Compile Include="DataModels\DefaultLanguageModel.cs" />
161162
<Compile Include="DataModels\SidebarPinnedModel.cs" />
@@ -241,8 +242,8 @@
241242
<DependentUpon>StatusCenter.xaml</DependentUpon>
242243
</Compile>
243244
<Compile Include="UserControls\MultitaskingControl\TabItem.cs" />
244-
<Compile Include="UserControls\MultitaskingControl\VerticalTabView.xaml.cs">
245-
<DependentUpon>VerticalTabView.xaml</DependentUpon>
245+
<Compile Include="UserControls\MultitaskingControl\VerticalTabViewControl.xaml.cs">
246+
<DependentUpon>VerticalTabViewControl.xaml</DependentUpon>
246247
</Compile>
247248
<Compile Include="UserControls\Widgets\LibraryCards.xaml.cs">
248249
<DependentUpon>LibraryCards.xaml</DependentUpon>
@@ -311,6 +312,9 @@
311312
<Compile Include="Views\SettingsPages\Experimental.xaml.cs">
312313
<DependentUpon>Experimental.xaml</DependentUpon>
313314
</Compile>
315+
<Compile Include="Views\SettingsPages\Multitasking.xaml.cs">
316+
<DependentUpon>Multitasking.xaml</DependentUpon>
317+
</Compile>
314318
<Compile Include="Views\SettingsPages\Preferences.xaml.cs">
315319
<DependentUpon>Preferences.xaml</DependentUpon>
316320
</Compile>
@@ -497,7 +501,7 @@
497501
<SubType>Designer</SubType>
498502
<Generator>MSBuild:Compile</Generator>
499503
</Page>
500-
<Page Include="UserControls\MultitaskingControl\VerticalTabView.xaml">
504+
<Page Include="UserControls\MultitaskingControl\VerticalTabViewControl.xaml">
501505
<SubType>Designer</SubType>
502506
<Generator>MSBuild:Compile</Generator>
503507
</Page>
@@ -573,6 +577,10 @@
573577
<Generator>MSBuild:Compile</Generator>
574578
<SubType>Designer</SubType>
575579
</Page>
580+
<Page Include="Views\SettingsPages\Multitasking.xaml">
581+
<Generator>MSBuild:Compile</Generator>
582+
<SubType>Designer</SubType>
583+
</Page>
576584
<Page Include="Views\SettingsPages\Preferences.xaml">
577585
<SubType>Designer</SubType>
578586
<Generator>MSBuild:Compile</Generator>

Files/IShellPage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public interface IShellPage
1717
public CurrentInstanceViewModel InstanceViewModel { get; }
1818
public BaseLayout ContentPage { get; }
1919
public Control OperationsControl { get; }
20-
public IMultitaskingControl MultitaskingControl { get; }
2120
public Type CurrentPageType { get; }
2221
public INavigationControlItem SidebarSelectedItem { get; set; }
2322
public INavigationToolbar NavigationToolbar { get; }

Files/Interacts/Interaction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,13 @@ private async void OpenSelectedItems(bool displayApplicationPicker)
520520

521521
public void CloseTab()
522522
{
523-
if (App.CurrentInstance.MultitaskingControl.Items.Count == 1)
523+
if (App.MultitaskingControl.Items.Count == 1)
524524
{
525525
App.CloseApp();
526526
}
527-
else if (App.CurrentInstance.MultitaskingControl.Items.Count > 1)
527+
else if (App.MultitaskingControl.Items.Count > 1)
528528
{
529-
App.CurrentInstance.MultitaskingControl.Items.RemoveAt(App.InteractionViewModel.TabStripSelectedIndex);
529+
App.MultitaskingControl.Items.RemoveAt(App.InteractionViewModel.TabStripSelectedIndex);
530530
}
531531
}
532532

Files/MultilingualResources/Files.de-DE.xlf

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,10 +1084,6 @@
10841084
<source>Open file location</source>
10851085
<target state="translated">Dateispeicherort öffnen</target>
10861086
</trans-unit>
1087-
<trans-unit id="SettingsPreferencesShowHorizontalTabStrip.Text" translate="yes" xml:space="preserve">
1088-
<source>Show a horizontal tab strip on the title bar</source>
1089-
<target state="new">Show a horizontal tab strip on the title bar</target>
1090-
</trans-unit>
10911087
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
10921088
<source>Unknown</source>
10931089
<target state="translated">Unbekannt</target>
@@ -1124,10 +1120,6 @@
11241120
<source>Find out what's new</source>
11251121
<target state="new">Find out what's new</target>
11261122
</trans-unit>
1127-
<trans-unit id="SettingsPreferencesShowMultitaskingControl.Text" translate="yes" xml:space="preserve">
1128-
<source>Show multitasking flyout in the navigation toolbar</source>
1129-
<target state="translated">Multitasking-Flyout in der Navigationstoolbar anzeigen</target>
1130-
</trans-unit>
11311123
<trans-unit id="InvalidItemDialogContent" translate="yes" xml:space="preserve">
11321124
<source>The item referenced is either invalid or inaccessible.{0}Error message:{0}{1}</source>
11331125
<target state="new">The item referenced is either invalid or inaccessible.{0}Error message:{0}{1}</target>
@@ -1180,6 +1172,38 @@
11801172
<source>Are you sure you want to delete these {0} items?</source>
11811173
<target state="new">Are you sure you want to delete these {0} items?</target>
11821174
</trans-unit>
1175+
<trans-unit id="SettingsMultitaskingAdaptive.Content" translate="yes" xml:space="preserve">
1176+
<source>Adaptive (Recommended)</source>
1177+
<target state="new">Adaptive (Recommended)</target>
1178+
</trans-unit>
1179+
<trans-unit id="SettingsMultitaskingAdaptiveDescription.Text" translate="yes" xml:space="preserve">
1180+
<source>Selects the best multitasking control based on how the app window is resized. When the window is small, you'll notice the horizontal tab strip is collapsed into a flyout on the navigation toolbar.</source>
1181+
<target state="new">Selects the best multitasking control based on how the app window is resized. When the window is small, you'll notice the horizontal tab strip is collapsed into a flyout on the navigation toolbar.</target>
1182+
</trans-unit>
1183+
<trans-unit id="SettingsMultitaskingHorizontal.Content" translate="yes" xml:space="preserve">
1184+
<source>Horizontal</source>
1185+
<target state="new">Horizontal</target>
1186+
</trans-unit>
1187+
<trans-unit id="SettingsMultitaskingHorizontalDescription.Text" translate="yes" xml:space="preserve">
1188+
<source>Always hides the vertical multitasking flyout from the navigation toolbar, and shows the traditional horizontal tabstrip on the app window. This is suited for users who need to keep track of every open app instance at all times.</source>
1189+
<target state="new">Always hides the vertical multitasking flyout from the navigation toolbar, and shows the traditional horizontal tabstrip on the app window. This is suited for users who need to keep track of every open app instance at all times.</target>
1190+
</trans-unit>
1191+
<trans-unit id="SettingsMultitaskingTitle.Text" translate="yes" xml:space="preserve">
1192+
<source>Multitasking</source>
1193+
<target state="new">Multitasking</target>
1194+
</trans-unit>
1195+
<trans-unit id="SettingsMultitaskingVertical.Content" translate="yes" xml:space="preserve">
1196+
<source>Vertical</source>
1197+
<target state="new">Vertical</target>
1198+
</trans-unit>
1199+
<trans-unit id="SettingsMultitaskingVerticalDescription.Text" translate="yes" xml:space="preserve">
1200+
<source>Collapses the horizontal list of app instances into a vertical flyout on the navigation toolbar, designed for users who want a clean app interface with on-demand access to a multitasking experience.</source>
1201+
<target state="new">Collapses the horizontal list of app instances into a vertical flyout on the navigation toolbar, designed for users who want a clean app interface with on-demand access to a multitasking experience.</target>
1202+
</trans-unit>
1203+
<trans-unit id="SettingsNavMultitasking.Content" translate="yes" xml:space="preserve">
1204+
<source>Multitasking</source>
1205+
<target state="new">Multitasking</target>
1206+
</trans-unit>
11831207
<trans-unit id="BaseLayoutItemContextFlyoutSetAs.Text" translate="yes" xml:space="preserve">
11841208
<source>Set as</source>
11851209
<target state="new">Set as</target>

0 commit comments

Comments
 (0)