Skip to content

Commit 441c122

Browse files
authored
Feature: Redid set as background flyout (#9775)
1 parent d827a32 commit 441c122

File tree

10 files changed

+1184
-905
lines changed

10 files changed

+1184
-905
lines changed

src/Files.Uwp/Interacts/BaseLayoutCommandImplementationModel.cs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,23 @@ public virtual void SetAsLockscreenBackgroundItem(RoutedEventArgs e)
112112

113113
public virtual async void SetAsDesktopBackgroundItem(RoutedEventArgs e)
114114
{
115-
if (SlimContentPage.SelectedItems.Count > 1)
116-
{
117-
var images = (from o in SlimContentPage.SelectedItems select o.ItemPath).ToArray();
115+
WallpaperHelpers.SetAsBackground(WallpaperType.Desktop, SlimContentPage.SelectedItem.ItemPath);
116+
}
118117

119-
var connection = await AppServiceConnectionHelper.Instance;
120-
if (connection != null)
121-
{
122-
var value = new ValueSet
123-
{
124-
{ "Arguments", "WallpaperOperation" },
125-
{ "wallpaperop", "SetSlideshow" },
126-
{ "filepaths", images }
127-
};
128-
await connection.SendMessageAsync(value);
129-
}
130-
}
131-
else
118+
public virtual async void SetAsSlideshowItem(RoutedEventArgs e)
119+
{
120+
var images = (from o in SlimContentPage.SelectedItems select o.ItemPath).ToArray();
121+
122+
var connection = await AppServiceConnectionHelper.Instance;
123+
if (connection != null)
132124
{
133-
WallpaperHelpers.SetAsBackground(WallpaperType.Desktop, SlimContentPage.SelectedItem.ItemPath);
125+
var value = new ValueSet
126+
{
127+
{ "Arguments", "WallpaperOperation" },
128+
{ "wallpaperop", "SetSlideshow" },
129+
{ "filepaths", images }
130+
};
131+
await connection.SendMessageAsync(value);
134132
}
135133
}
136134

src/Files.Uwp/Interacts/BaseLayoutCommandsViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ private void InitializeCommands()
3131
CreateShortcutCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.CreateShortcut);
3232
SetAsLockscreenBackgroundItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsLockscreenBackgroundItem);
3333
SetAsDesktopBackgroundItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsDesktopBackgroundItem);
34+
SetAsSlideshowItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsSlideshowItem);
3435
RunAsAdminCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.RunAsAdmin);
3536
RunAsAnotherUserCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.RunAsAnotherUser);
3637
SidebarPinItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SidebarPinItem);
@@ -90,6 +91,8 @@ private void InitializeCommands()
9091

9192
public ICommand SetAsDesktopBackgroundItemCommand { get; private set; }
9293

94+
public ICommand SetAsSlideshowItemCommand { get; private set; }
95+
9396
public ICommand RunAsAdminCommand { get; private set; }
9497

9598
public ICommand RunAsAnotherUserCommand { get; private set; }

src/Files.Uwp/Interacts/IBaseLayoutCommandImplementationModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public interface IBaseLayoutCommandImplementationModel : IDisposable
1616

1717
void SetAsDesktopBackgroundItem(RoutedEventArgs e);
1818

19+
void SetAsSlideshowItem(RoutedEventArgs e);
20+
1921
void RunAsAdmin(RoutedEventArgs e);
2022

2123
void RunAsAnotherUser(RoutedEventArgs e);

src/Files.Uwp/ResourceDictionaries/ToolbarButtonStyle.xaml

Lines changed: 435 additions & 202 deletions
Large diffs are not rendered by default.

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,9 +2672,6 @@ We use App Center to track which settings are being used, find bugs, and fix cra
26722672
<data name="RunWithPowerShell" xml:space="preserve">
26732673
<value>Run with PowerShell</value>
26742674
</data>
2675-
<data name="SetAsBackground" xml:space="preserve">
2676-
<value>Set as desktop background</value>
2677-
</data>
26782675
<data name="ShowFolderSizesWarning" xml:space="preserve">
26792676
<value>Calculating folder sizes is resource intensive and may cause your CPU usage to increase.</value>
26802677
</data>
@@ -2786,6 +2783,15 @@ We use App Center to track which settings are being used, find bugs, and fix cra
27862783
<data name="ReviewFilesContent" xml:space="preserve">
27872784
<value>Would you like to review Files?</value>
27882785
</data>
2786+
<data name="SetAsBackgroundFlyout" xml:space="preserve">
2787+
<value>Set as background</value>
2788+
</data>
2789+
<data name="SetAsLockscreen" xml:space="preserve">
2790+
<value>Set as lockscreen</value>
2791+
</data>
2792+
<data name="SetAsBackground" xml:space="preserve">
2793+
<value>Set as desktop background</value>
2794+
</data>
27892795
<data name="SetAsDefault" xml:space="preserve">
27902796
<value>Set as default</value>
27912797
</data>
@@ -2807,4 +2813,7 @@ We use App Center to track which settings are being used, find bugs, and fix cra
28072813
<data name="DisplayTypeColumn" xml:space="preserve">
28082814
<value>Display Type column</value>
28092815
</data>
2816+
<data name="Lockscreen" xml:space="preserve">
2817+
<value>Lockscreen</value>
2818+
</data>
28102819
</root>

0 commit comments

Comments
 (0)