Skip to content

Commit

Permalink
v1.1.2.0 src
Browse files Browse the repository at this point in the history
- Picture wallpaper type.
- Code refactor.
- UI tweaks.
  • Loading branch information
rocksdanister committed Sep 29, 2020
1 parent ed508d7 commit 082bd13
Show file tree
Hide file tree
Showing 22 changed files with 71 additions and 77 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis
<img src="/resources/wallpaper_video.gif" width="600" height="338"/>

<a href="https://visualdon.uk/project/eternal-light/">Eternal Light</a> by VISUALDON
* Use external codec packs or internal windows codec.
* Powered by mpv and vlc player.
* Play .mp4, mkv, webm, avi, mov etc
* Hardware Acceleration support.
* Audio will mute when not on desktop.
#### Webpages
<img src="/resources/wallpaper_html.gif" width="600" height="338"/>

Expand Down Expand Up @@ -88,10 +87,10 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis

**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
## Download
##### Latest version: v1.1.0.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.1.0.0)
##### Latest version: v1.1.2.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.1.2.0)
- [`Download Lively Wallpaper`][direct-full-win32]

[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.1.0.0/lively_setup_x86_full_v1100.exe
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.1.2.0/lively_setup_x86_full_v1120.exe

**Installer will give Smartscreen warning, [discussion.](https://github.com/rocksdanister/lively/issues/9)**

Expand Down
2 changes: 1 addition & 1 deletion src/installer/Script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; https://jrsoftware.org/isinfo.php

#define MyAppName "Lively Wallpaper"
#define MyAppVersion "1.1.0.0"
#define MyAppVersion "1.1.2.0"
#define MyAppPublisher "rocksdanister"
#define MyAppURL "https://github.com/rocksdanister/lively"
#define MyAppExeName "livelywpf.exe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
d:DesignHeight="400"
d:DesignWidth="400">

<Grid BorderBrush="{ThemeResource SystemBaseLowColor}" BorderThickness="1">
<Grid BorderBrush="{ThemeResource SystemBaseLowColor}" BorderThickness="1" Background="{ThemeResource SystemListLowColor}">
<GridView HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="GridControl" Margin="5, 5, 5, 5"
ItemsSource= "{Binding ScreenItems}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" >
<GridView.ItemTemplate>
<DataTemplate >
<Grid Width="192" Height="108" Background="{ThemeResource SystemBaseLowColor}">
<Image Source="{Binding ScreenImagePath}" Stretch="UniformToFill" Opacity="0.50"/>
<Viewbox Width="192" Height="108">
<TextBlock Text="{Binding ScreenTitle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ScreenTitle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Viewbox>
</Grid>
</DataTemplate>
Expand All @@ -29,4 +29,4 @@
</GridView.ItemsPanel>
</GridView>
</Grid>
</UserControl>
</UserControl>
9 changes: 5 additions & 4 deletions src/livelywpf/UserControls/livelysettings/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@
<ScrollViewer Margin="0, 0, 15, 0">
<StackPanel Margin="0, 10, 0, 0">
<ToggleSwitch IsOn="{Binding IsStartup, Mode=TwoWay}" Header="{x:Bind UIText.TitleWindowsStart}"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipWindowsStart}"/>
<TextBlock Margin="0,5,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipWindowsStart}"/>

<ComboBox SelectedIndex="0" Margin="0,10,0,0" MinWidth="150" Header="{x:Bind UIText.TitleLanguage}"
ItemsSource="{Binding LanguageItems}"
DisplayMemberPath="Language"
SelectedItem="{Binding SelectedLanguageItem, Mode=TwoWay}"
/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipLanguage}"/>
<!--<HyperlinkButton Margin="0, 0, 0, 0" FontSize="12" Content="Help translate Lively." NavigateUri="https://github.com/rocksdanister/lively-translations"/>-->
<HyperlinkButton Margin="0, 0, 0, 0" FontSize="12" Content="{x:Bind UIText.TextHelpTranslateLively}"
NavigateUri="https://github.com/rocksdanister/lively-translations" ToolTipService.ToolTip="https://github.com/rocksdanister/lively-translations"/>

<ComboBox Margin="0,10,0,0" MinWidth="150" SelectedIndex="{Binding SelectedTileSizeIndex, Mode=TwoWay}" Header="{x:Bind UIText.TitleTileSize}" >
<ComboBoxItem Content="{x:Bind UIText.TextTileSizeSmall}"/>
<ComboBoxItem Content="{x:Bind UIText.TextTileSizeNormal}"/>
<ComboBoxItem Content="{x:Bind UIText.TextTileSizeLarge}"/>
</ComboBox>
<TextBlock Margin="0,5,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipTitleSize}"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipTitleSize}"/>

<ComboBox Margin="0,10,0,0" MinWidth="150" SelectedIndex="{Binding SelectedLivelyUIModeIndex, Mode=TwoWay}" Header="{x:Bind UIText.TitleUIMode}">
<ComboBoxItem Content="{x:Bind UIText.TextUIModeNormal}"/>
Expand Down Expand Up @@ -157,7 +158,7 @@
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipWallpaperStreamQuality}"/>

<CheckBox Content="{x:Bind UIText.TitleDetectWallpaperStream}" IsChecked="{Binding DetectStreamWallpaper, Mode=TwoWay}"/>
<CheckBox Margin="0,10,0,0" Content="{x:Bind UIText.TitleDetectWallpaperStream}" IsChecked="{Binding DetectStreamWallpaper, Mode=TwoWay}"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDetectWallpaperStream}"/>

<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWebBrowser}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class LocalizeText
public string TitleSettings { get; set; }

//general
public string TextHelpTranslateLively { get; set; }
public string TitleWindowsStart { get; set; }
public string TipWindowsStart { get; set; }
public string TitleLanguage { get; set; }
Expand Down
4 changes: 0 additions & 4 deletions src/livelywpf/livelywpf/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Reflection;
using System.Xml.Schema;
using Windows.ApplicationModel.VoiceCommands;

namespace livelywpf
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void Slider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primiti
{
var item = (Windows.UI.Xaml.Controls.Slider)sender;

WallpaperSendMsg("lively-customise slider " + item.Name + " " + item.Value);
WallpaperSendMsg("lively:customise slider " + item.Name + " " + item.Value);
livelyPropertyData[item.Name]["value"] = item.Value;
UpdatePropertyFile();
}
Expand Down Expand Up @@ -352,7 +352,7 @@ private void CmbBox_SelectionChanged1(object sender, Windows.UI.Xaml.Controls.Se
{
var item = (Windows.UI.Xaml.Controls.ComboBox)sender;
var filePath = Path.Combine(livelyPropertyData[item.Name]["folder"].ToString(), item.SelectedItem.ToString()); //filename is unique.
WallpaperSendMsg("lively-customise folderDropdown " + item.Name + " " + "\"" + filePath + "\"");
WallpaperSendMsg("lively:customise folderDropdown " + item.Name + " " + "\"" + filePath + "\"");
livelyPropertyData[item.Name]["value"] = item.SelectedItem.ToString();
UpdatePropertyFile();
}
Expand Down Expand Up @@ -393,7 +393,7 @@ private void CmbBox_SelectionChanged(object sender, Windows.UI.Xaml.Controls.Sel
{
var item = (Windows.UI.Xaml.Controls.ComboBox)sender;
//Form1.chromeBrowser.ExecuteScriptAsync("livelyPropertyListener", item.Name, item.SelectedIndex);
WallpaperSendMsg("lively-customise dropdown " + item.Name + " " + item.SelectedIndex);
WallpaperSendMsg("lively:customise dropdown " + item.Name + " " + item.SelectedIndex);
livelyPropertyData[item.Name]["value"] = item.SelectedIndex;
UpdatePropertyFile();
}
Expand Down Expand Up @@ -437,7 +437,7 @@ private void Rectangle_Click(object sender, EventArgs e)
{
item.Fill = new SolidColorBrush(Color.FromArgb(colorDialog.Color.A, colorDialog.Color.R, colorDialog.Color.G, colorDialog.Color.B));
//Form1.chromeBrowser.ExecuteScriptAsync("livelyPropertyListener", item.Name, ToHexValue(colorDialog.Color));
WallpaperSendMsg("lively-customise color " + item.Name + " " + ToHexValue(colorDialog.Color));
WallpaperSendMsg("lively:customise color " + item.Name + " " + ToHexValue(colorDialog.Color));
livelyPropertyData[item.Name]["value"] = ToHexValue(colorDialog.Color);
UpdatePropertyFile();
}
Expand All @@ -463,7 +463,7 @@ private void DefaultBtn_Click(object sender, EventArgs e)
{
uiPanel.Children.Clear();
LoadUI();
WallpaperSendMsg("lively-customise button lively_default_settings_reload 1");
WallpaperSendMsg("lively:customise button lively_default_settings_reload 1");
}
}

Expand All @@ -473,7 +473,7 @@ private void Button_Click(object sender, EventArgs e)
{
var item = (Button)sender;
//Form1.chromeBrowser.ExecuteScriptAsync("livelyPropertyListener", item.Name, true);
WallpaperSendMsg("lively-customise button " + item.Name + " " + true);
WallpaperSendMsg("lively:customise button " + item.Name + " " + true);
}
catch { }
}
Expand All @@ -488,8 +488,8 @@ private void Checkbox_CheckedChanged(object sender, EventArgs e)
{
var item = (CheckBox)sender;
//Form1.chromeBrowser.ExecuteScriptAsync("livelyPropertyListener", item.Name, item.Checked);
WallpaperSendMsg("lively-customise checkbox " + item.Name + " " + (item.IsChecked == true));
Debug.WriteLine("lively-customise " + item.Name + " " + (item.IsChecked == true));
WallpaperSendMsg("lively:customise checkbox " + item.Name + " " + (item.IsChecked == true));
Debug.WriteLine("lively:customise " + item.Name + " " + (item.IsChecked == true));
livelyPropertyData[item.Name]["value"] = item.IsChecked == true;
UpdatePropertyFile();
}
Expand All @@ -506,8 +506,8 @@ private void Textbox_TextChanged(object sender, EventArgs e)
{
var item = (TextBox)sender;
//Form1.chromeBrowser.ExecuteScriptAsync("livelyPropertyListener", item.Name, item.Text);
WallpaperSendMsg("lively-customise textbox " + item.Name + " " + "\"" + item.Text + "\"");
Debug.WriteLine("lively-customise textbox " + item.Name + " " + "\"" + item.Text + "\"");
WallpaperSendMsg("lively:customise textbox " + item.Name + " " + "\"" + item.Text + "\"");
Debug.WriteLine("lively:customise textbox " + item.Name + " " + "\"" + item.Text + "\"");
livelyPropertyData[item.Name]["value"] = item.Text;
UpdatePropertyFile();
}
Expand Down
6 changes: 3 additions & 3 deletions src/livelywpf/livelywpf/Core/SetupDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ private static async void SetupDesktop_WallpaperInitialized(object sender, Windo
//Reload webpage, fix if the webpage code is not subscribed to window size changed event.
if(reloadRequired)
{
wallpaper.SendMessage("Reload");
wallpaper.SendMessage("lively:reload");
}

Wallpapers.Add(wallpaper);
Expand All @@ -336,11 +336,11 @@ private static async void SetupDesktop_WallpaperInitialized(object sender, Windo
}
else
{
Logger.Error("Core: Failed to launch wallpaper=>" + e.Msg);
Logger.Error("Core: Failed to launch wallpaper=>(No Exception thrown)" + e.Msg);
}
wallpaper.Terminate();
WallpaperChanged?.Invoke(null, null);
MessageBox.Show(e.Error.Message, Properties.Resources.TitleAppName);
MessageBox.Show(Properties.Resources.LivelyExceptionGeneral, Properties.Resources.TextError);
}
}
catch(Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ private void Proc_OutputDataReceived(object sender, DataReceivedEventArgs e)
bool status = true;
Exception error = null;
string msg = null;

try
{
msg = "libMPVPlayer Handle:" + e.Data;
Expand Down
1 change: 1 addition & 0 deletions src/livelywpf/livelywpf/Helpers/File/FileFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static string GetLivelySupportedFileDialogFilter(bool anyFile = false)
filterString.Append("|");
}
filterString.Remove(filterString.Length - 1, 1);

return filterString.ToString();
}
}
Expand Down
10 changes: 2 additions & 8 deletions src/livelywpf/livelywpf/Program.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using ICSharpCode.SharpZipLib.Zip;
using System;
using System.Collections.Generic;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using livelywpf.Core;

namespace livelywpf
{
Expand All @@ -22,7 +16,7 @@ public class Program
//Loaded from Settings.json (User configurable.)
public static string WallpaperDir;
public static readonly string AppDataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Lively Wallpaper");
public static readonly bool IsMSIX = new DesktopBridge.Helpers().IsRunningAsUwp();
public static readonly bool IsMSIX = false;//new DesktopBridge.Helpers().IsRunningAsUwp();

//todo: use singleton or something instead?
public static SettingsViewModel SettingsVM;
Expand Down
4 changes: 3 additions & 1 deletion src/livelywpf/livelywpf/ViewModel/LibraryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ await Task.Run(() =>
{
//livelyinfo.json only contains the absolute filepath of the file; file is in different location.
List<string> files = new List<string>();
if (selection.LivelyInfo.Type == WallpaperType.video || selection.LivelyInfo.Type == WallpaperType.gif)
if (selection.LivelyInfo.Type == WallpaperType.video ||
selection.LivelyInfo.Type == WallpaperType.gif ||
selection.LivelyInfo.Type == WallpaperType.picture)
{
files.Add(selection.FilePath);
}
Expand Down
14 changes: 4 additions & 10 deletions src/livelywpf/livelywpf/ViewModel/ScreenLayoutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private void UpdateLayout()
}
else
{
List<Model.ScreenLayoutModel> unsortedScreenItems = new List<Model.ScreenLayoutModel>();
var unsortedScreenItems = new List<ScreenLayoutModel>();
foreach (var item in ScreenHelper.GetScreen())
{
string imgPath = null;
Expand All @@ -220,14 +220,9 @@ private void UpdateLayout()
livelyPropertyFilePath = x.GetLivelyPropertyCopyPath();
}
});
if(Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.duplicate)
{
unsortedScreenItems.Add(new Model.ScreenLayoutModel(item, imgPath, livelyPropertyFilePath, item.DeviceNumber + '"'));
}
else
{
unsortedScreenItems.Add(new Model.ScreenLayoutModel(item, imgPath, livelyPropertyFilePath, item.DeviceNumber));
}
unsortedScreenItems.Add((Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.duplicate ?
new ScreenLayoutModel(item, imgPath, livelyPropertyFilePath, item.DeviceNumber + '"') :
new ScreenLayoutModel(item, imgPath, livelyPropertyFilePath, item.DeviceNumber)));
}

foreach (var item in unsortedScreenItems.OrderBy(x => x.Screen.Bounds.X).ToList())
Expand All @@ -248,7 +243,6 @@ private void UpdateLayout()

private void UpdateWallpaper(WallpaperArrangement previous, WallpaperArrangement current)
{
MessageBox.Show(previous + " " + current);
var wallpapers = SetupDesktop.Wallpapers.ToList();
SetupDesktop.CloseAllWallpapers();
if (previous == WallpaperArrangement.per && current == WallpaperArrangement.span)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:ThemeManager.IsThemeAware="True"
ui:TitleBar.IsIconVisible="True"
ui:TitleBar.IsIconVisible="True"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p = "clr-namespace:livelywpf.Properties"
mc:Ignorable="d"
ResizeMode="NoResize"
WindowStyle="ToolWindow"
BorderBrush="{DynamicResource SystemControlHighlightAltListAccentHighBrush}"
Title="Preview" Height="740" Width="1280"
Title="{x:Static p:Resources.TextPreviewWallpaper}"
Height="737" Width="1280"
Loaded="Window_Loaded" Closing="Window_Closing">
<Grid>
<!-- wallpaper window will be placed here! -->
<Rectangle x:Name="PreviewBorder" Fill="{DynamicResource SystemControlForegroundBaseLowBrush}" Width="1200" Height="650" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Rectangle x:Name="PreviewBorder" Fill="{DynamicResource SystemControlForegroundBaseLowBrush}" Width="1280" Height="720"/>
<ui:ProgressRing x:Name="ProgressRing" IsActive="True" Width="100" Height="100"/>
</Grid>
</Window>
Loading

0 comments on commit 082bd13

Please sign in to comment.