Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
Revert "添加将插画设置为桌面壁纸的功能"
Browse files Browse the repository at this point in the history
This reverts commit ff3d769.
  • Loading branch information
YukinoShary committed May 9, 2020
1 parent daede1b commit 15ada40
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 32 deletions.
1 change: 0 additions & 1 deletion PixivFSUWP/BigImage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<InkToolbarStencilButton/>
</InkToolbar>
</CommandBar.Content>
<AppBarButton x:Name="btnSetWallpaper" Icon="SetLockScreen" x:Uid="SetWallpaper" Label="设置为壁纸" Click="btnSetWallpaper_Click"/>
<AppBarButton x:Name="btnSaveImage" Icon="Save" x:Uid="SaveImage" Click="BtnSaveImage_Click"/>
<AppBarToggleButton x:Name="btnDraw" Icon="Edit" x:Uid="Draw" Unchecked="BtnDraw_Unchecked" Checked="BtnDraw_Checked"/>
</CommandBar>
Expand Down
25 changes: 0 additions & 25 deletions PixivFSUWP/BigImage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.Graphics.Canvas;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
Expand All @@ -13,7 +12,6 @@
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.Storage.Provider;
using Windows.System.UserProfile;
using Windows.UI;
using Windows.UI.Popups;
using Windows.UI.ViewManagement;
Expand Down Expand Up @@ -133,28 +131,6 @@ private async void BtnSaveImage_Click(object sender, RoutedEventArgs e)
await saveImage();
}

private async void btnSetWallpaper_Click(object sender, RoutedEventArgs e)
{
if (UserProfilePersonalizationSettings.IsSupported())
{
UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings.Current;
StorageFile file = await parameter.ImageCache.CopyAsync(ApplicationData.Current.LocalFolder, "WallpaperImage", NameCollisionOption.ReplaceExisting);
if (!await settings.TrySetWallpaperImageAsync(file))
{
Debug.WriteLine(file.Path);
var messageDialog = new MessageDialog("更换壁纸失败");
await messageDialog.ShowAsync();
}
else
await ShowTip("已更换壁纸");
}
else
{
var messageDialog = new MessageDialog("您的设备不支持更换壁纸");
await messageDialog.ShowAsync();
}
}

List<(string, int)> tips = new List<(string, int)>();
bool _tip_busy = false;

Expand Down Expand Up @@ -278,6 +254,5 @@ private async Task saveStrokes()
await ShowTip(GetResourceString("NoInkPlain"));
}
}

}
}
2 changes: 0 additions & 2 deletions PixivFSUWP/Data/BigImageDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.UI.Xaml.Media.Imaging;

namespace PixivFSUWP.Data
Expand All @@ -15,6 +14,5 @@ public class BigImageDetail
public int Width { get; set; }
public int Height { get; set; }
public byte[] Image { get; set; }
public StorageFile ImageCache { get; set; }
}
}
6 changes: 2 additions & 4 deletions PixivFSUWP/IllustDetailPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,14 @@ private async void ImageList_ItemClick(object sender, ItemClickEventArgs e)
{

var Item = e.ClickedItem as ViewModels.ImageItemViewModel;
var tmpFileName = illust.OriginalUrls[0].ToString().Split('/').Last();
await Data.OverAll.ShowNewWindow(typeof(BigImage), new Data.BigImageDetail()
{
Title = illust.Title,
Width = Item.ImageSource.PixelWidth,
Height = Item.ImageSource.PixelHeight,
Author = illust.Author,
Image = await Data.OverAll.ImageToBytes(Item.ImageSource),
ImageCache = await Data.CacheManager.GetCachedFileAsync(tmpFileName)
});
Image = await Data.OverAll.ImageToBytes(Item.ImageSource)
});
}

private async void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
Expand Down

0 comments on commit 15ada40

Please sign in to comment.