Skip to content

Commit

Permalink
beta 1.2.1.5
Browse files Browse the repository at this point in the history
- fixed a bug where customise wallpaper in control panel did not work when selected screen is not primary and wallpaper arrangement is span.
- changed tostring() to originalstring for url dragdrop.
- made in-app customise wallpaper menu default to selected screen for per wallpaper arrangement.
- updated some commandline control helptext.
  • Loading branch information
rocksdanister committed Apr 7, 2021
1 parent 22e4e2c commit 64b95ae
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/livelywpf/livelyCmdUtility/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SeekWallpaperOptions
{
[Option("value",
Required = true,
HelpText = "Seek percentage from current position.")]
HelpText = "Seek percentage, optionally add +/- to seek from current position.")]
public string Param { get; set; }

[Option("monitor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public LivelyPropertiesView(LibraryModel model)
wallpaperData = model;
try
{
var wpInfo = GetLivelyPropertyDetails(model, Program.SettingsVM.Settings.WallpaperArrangement);
var wpInfo = GetLivelyPropertyDetails(model, Program.SettingsVM.Settings.WallpaperArrangement, Program.SettingsVM.Settings.SelectedDisplay);
this.livelyPropertyCopyPath = wpInfo.Item1;
this.screen = wpInfo.Item2;
}
Expand Down Expand Up @@ -619,7 +619,7 @@ public static bool RestoreOriginalPropertyFile(LibraryModel wallpaperData, strin
/// </summary>
/// <param name="obj">LibraryModel object</param>
/// <returns></returns>
public static Tuple<string, LivelyScreen> GetLivelyPropertyDetails(LibraryModel obj, WallpaperArrangement arrangement)
public static Tuple<string, LivelyScreen> GetLivelyPropertyDetails(LibraryModel obj, WallpaperArrangement arrangement, LivelyScreen selectedScreen)
{
if (obj.LivelyPropertyPath == null)
{
Expand All @@ -633,8 +633,7 @@ public static Tuple<string, LivelyScreen> GetLivelyPropertyDetails(LibraryModel
{
try
{
//wallpaper not running, give the path for primaryscreen.
screen = ScreenHelper.GetPrimaryScreen();
screen = selectedScreen;
var dataFolder = Path.Combine(Program.WallpaperDir, "SaveData", "wpdata");
if (screen.DeviceNumber != null)
{
Expand Down Expand Up @@ -685,7 +684,7 @@ public static Tuple<string, LivelyScreen> GetLivelyPropertyDetails(LibraryModel
case WallpaperArrangement.per:
{
//more than one screen; if selected display, sendpath otherwise send the first one found.
int index = items.FindIndex(x => ScreenHelper.ScreenCompare(Program.SettingsVM.Settings.SelectedDisplay, x.GetScreen(), DisplayIdentificationMode.deviceId));
int index = items.FindIndex(x => ScreenHelper.ScreenCompare(selectedScreen, x.GetScreen(), DisplayIdentificationMode.deviceId));
livelyPropertyCopy = index != -1 ? items[index].GetLivelyPropertyCopyPath() : items[0].GetLivelyPropertyCopyPath();
screen = index != -1 ? items[index].GetScreen() : items[0].GetScreen();
}
Expand Down
2 changes: 1 addition & 1 deletion src/livelywpf/livelywpf/Cmd/CommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SeekWallpaperOptions
{
[Option("value",
Required = true,
HelpText = "Seek percentage from current position.")]
HelpText = "Seek percentage, optionally add +/- to seek from current position.")]
public string Param { get; set; }

[Option("monitor",
Expand Down
18 changes: 5 additions & 13 deletions src/livelywpf/livelywpf/ViewModel/ScreenLayoutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,12 @@ public RelayCommand CustomiseWallpaperCommand

private void CustomiseWallpaper(ScreenLayoutModel selection)
{
if (SelectedItem != null)
//only for running wallpapers..
var items = SetupDesktop.Wallpapers.FindAll(x => x.GetWallpaperData().LivelyPropertyPath != null);
if (items.Count > 0)
{
foreach (var x in SetupDesktop.Wallpapers)
{
if (ScreenHelper.ScreenCompare(x.GetScreen(), selection.Screen, DisplayIdentificationMode.deviceId))
{
if (selection.LivelyPropertyPath != null)
{
var settingsWidget = new Cef.LivelyPropertiesTrayWidget(x.GetWallpaperData());
settingsWidget.Show();
}
break;
}
}
var settingsWidget = new Cef.LivelyPropertiesTrayWidget(items[0].GetWallpaperData());
settingsWidget.Show();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/livelywpf/livelywpf/Views/Main/LibraryView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ await this.Dispatcher.InvokeAsync(new Action(async () => {
if (Program.SettingsVM.Settings.AutoDetectOnlineStreams &&
StreamHelper.IsSupportedStream(uri))
{
Program.LibraryVM.AddWallpaper(uri.ToString(),
Program.LibraryVM.AddWallpaper(uri.OriginalString,
WallpaperType.videostream,
LibraryTileType.processing,
Program.SettingsVM.Settings.SelectedDisplay);
}
else
{
Program.LibraryVM.AddWallpaper(uri.ToString(),
Program.LibraryVM.AddWallpaper(uri.OriginalString,
WallpaperType.url,
LibraryTileType.processing,
Program.SettingsVM.Settings.SelectedDisplay);
Expand Down
2 changes: 1 addition & 1 deletion src/livelywpf/livelywpf/livelywpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<StartupObject>livelywpf.Program</StartupObject>
<ApplicationIcon>appicon.ico</ApplicationIcon>
<Version>1.0.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<AssemblyVersion>1.2.1.5</AssemblyVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
Expand Down

0 comments on commit 64b95ae

Please sign in to comment.