diff --git a/FlyleafLib.Controls.WPF/Config.cs b/FlyleafLib.Controls.WPF/Config.cs index 5e74b746..577a1919 100644 --- a/FlyleafLib.Controls.WPF/Config.cs +++ b/FlyleafLib.Controls.WPF/Config.cs @@ -19,6 +19,8 @@ public ObservableCollection public string SelectedTheme { get => _SelectedTheme; set => Set(ref _SelectedTheme, value); } string _SelectedTheme; + public int ActivityTimeout { get; set; } // we just store it to file + public string SubsFontFamily { get => _SubsFontFamily; set => Set(ref _SubsFontFamily, value); } string _SubsFontFamily; public double SubsFontSize { get => _SubsFontSize; set => Set(ref _SubsFontSize, value); } @@ -45,7 +47,7 @@ public static void Load(FlyleafME flyleaf, string path) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(UIConfig)); flyleaf.UIConfig = (UIConfig) xmlSerializer.Deserialize(fs); - + flyleaf.ActivityTimeout = flyleaf.UIConfig.ActivityTimeout; flyleaf.UIConfig.Loaded = true; flyleaf.UIConfig.flyleaf = flyleaf; foreach(var theme in flyleaf.UIConfig.Themes) @@ -56,11 +58,14 @@ public static void Load(FlyleafME flyleaf, string path) public static void Save(FlyleafME flyleaf, string uiConfigPath, string configPath, string enginePath) { if (uiConfigPath != null) + { + flyleaf.UIConfig.ActivityTimeout = flyleaf.ActivityTimeout; using (FileStream fs = new FileStream(uiConfigPath, FileMode.Create)) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(UIConfig)); xmlSerializer.Serialize(fs, flyleaf.UIConfig); } + } if (configPath != null) flyleaf.Config.Save(configPath); diff --git a/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj b/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj index 1364f017..2795d199 100644 --- a/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj +++ b/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj @@ -4,7 +4,7 @@ net6.0-windows;net5.0-windows;net472 true true - 1.2-pre + 1.2-pre2 SuRGeoNix SuRGeoNix © 2022 LGPL-3.0-or-later @@ -14,15 +14,9 @@ flyleaf flyleaflib video audio media player element control WPF Media Player Control/Element (based on FlyleafLib) - - Introduces FlyleafME WPF Media Element Control (WPF Flyleaf Control replacement) - * Updated with the new FlyleafHost and gains better performance - * Resolves several issues with DPI - * Code clean-up and styles to allow easier override and customization + * Fixes an issue to respect Subtitles FontStyle + * Adds Activity Timeout on Settings * Updates FlyleafLib - - - Breaking Changes - * Flyleaf (WPF Control) has been renamed to FlyleafME (Media Element) and does not require a FlyleafHost as it was required previously with the VideoView (it derives from it) - * See WPF/FlyleafHost.cs for the new dependency properties and customization diff --git a/FlyleafLib.Controls.WPF/FlyleafME.cs b/FlyleafLib.Controls.WPF/FlyleafME.cs index 75caeeed..25e0d9f3 100644 --- a/FlyleafLib.Controls.WPF/FlyleafME.cs +++ b/FlyleafLib.Controls.WPF/FlyleafME.cs @@ -74,9 +74,6 @@ public SerializableDictionary> public bool CanPaste { get => _CanPaste; set => Set(ref _CanPaste, value); } bool _CanPaste; - public string SubtitlesFontDesc { get => _SubtitlesFontDesc; set => Set(ref _SubtitlesFontDesc, value); } - string _SubtitlesFontDesc; - public UITheme SelectedTheme { get => _SelectedTheme; @@ -309,7 +306,6 @@ private void Initialize() if (uitheme.Name == UIConfig.SelectedTheme) SelectedTheme = uitheme; - SubtitlesFontDesc = $"{UIConfig.SubsFontFamily} ({UIConfig.SubsFontWeight}), {UIConfig.SubsFontSize}"; subsInitialMargin = UIConfig.SubsMargin; if (popUpMenu != null) @@ -433,8 +429,8 @@ public async void OpenSettingsAction(object obj = null) Player.Activity.IsEnabled = false; - var prevKeys = KeyBindingsMode; - KeyBindingsMode = AvailableWindows.None; + var prevKeys = KeyBindings; + KeyBindings = AvailableWindows.None; Dictionary saveFilterValues = new Dictionary(); foreach(var filter in Config.Video.Filters.Values) @@ -444,7 +440,7 @@ public async void OpenSettingsAction(object obj = null) var result = await DialogHost.Show(settings, dialogSettingsIdentifier); Player.Activity.IsEnabled = true; - KeyBindingsMode = prevKeys; + KeyBindings = prevKeys; if (result == null) return; @@ -530,8 +526,6 @@ public void SetSubtitlesFontAction(object obj = null) UIConfig.SubsFontStretch= dialog.Font.Stretch.ToString(); UIConfig.SubsFontStyle = dialog.Font.Style.ToString(); UIConfig.SubsFontColor = dialog.Font.BrushColor.Color; - - SubtitlesFontDesc = $"{UIConfig.SubsFontFamily} ({UIConfig.SubsFontWeight}), {UIConfig.SubsFontSize}"; } } #endregion diff --git a/FlyleafLib.Controls.WPF/Settings.xaml b/FlyleafLib.Controls.WPF/Settings.xaml index 6f0f8e7b..72c31fba 100644 --- a/FlyleafLib.Controls.WPF/Settings.xaml +++ b/FlyleafLib.Controls.WPF/Settings.xaml @@ -191,7 +191,8 @@ - + + @@ -207,34 +208,39 @@ + + + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + + diff --git a/FlyleafLib.Controls.WPF/Themes/FlyleafME.xaml b/FlyleafLib.Controls.WPF/Themes/FlyleafME.xaml index 5369122b..0b9b291a 100644 --- a/FlyleafLib.Controls.WPF/Themes/FlyleafME.xaml +++ b/FlyleafLib.Controls.WPF/Themes/FlyleafME.xaml @@ -10,7 +10,7 @@ + + + + + + + + + + + + + + + - - - + + + + +