diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml index ce622fa..18d272c 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml @@ -11,7 +11,8 @@ - diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs index 73665ad..c1b7d71 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs @@ -37,6 +37,7 @@ namespace QuickLook.Plugin.ImageViewer /// public partial class ImagePanel : UserControl, INotifyPropertyChanged, IDisposable { + private Visibility _backgroundVisibility = Visibility.Visible; private Point? _dragInitPos; private Uri _imageSource; private DateTime _lastZoomTime = DateTime.MinValue; @@ -45,7 +46,6 @@ namespace QuickLook.Plugin.ImageViewer private BitmapScalingMode _renderMode = BitmapScalingMode.HighQuality; private BitmapSource _source; private double _zoomFactor = 1d; - private Visibility _backgroundVisibility = Visibility.Visible; private bool _zoomToFit = true; diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs index 517e4af..80011e1 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs @@ -64,8 +64,9 @@ namespace QuickLook.Plugin.ImageViewer context.PreferredSize = new Size(1024, 768); Directory.SetCurrentDirectory(App.AppPath); - + context.TitlebarOverlap = true; + context.TitlebarAutoHide = true; } public void View(string path, ContextObject context) diff --git a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Translations.config b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Translations.config index fce6eb7..b90c10e 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Translations.config +++ b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Translations.config @@ -19,4 +19,4 @@ Consolas - + \ No newline at end of file diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Converters.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Converters.cs index a8a9993..c6c6c0c 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Converters.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Converters.cs @@ -45,4 +45,28 @@ namespace QuickLook.Plugin.VideoViewer throw new NotImplementedException(); } } + + public sealed class VolumeToIconConverter : DependencyObject, IValueConverter + { + private static readonly string[] Volumes = {"\xE992", "\xE993", "\xE994", "\xE995"}; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + return Volumes[0]; + + var v = (int) value; + if (v == 0) + return Volumes[0]; + + v = Math.Min(v, 100); + + return Volumes[1 + v / 34]; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } } \ No newline at end of file diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs index 74ba935..be449d6 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs @@ -78,6 +78,7 @@ namespace QuickLook.Plugin.VideoViewer } else { + context.TitlebarAutoHide = true; context.UseDarkTheme = true; } } diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj index d94eaef..7baa9de 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj @@ -59,9 +59,6 @@ key.snk - - ..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll - .\Meta.Vlc.dll @@ -103,7 +100,6 @@ Code - @@ -112,15 +108,11 @@ False - - - Always - - PreserveNewest + \ No newline at end of file diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/compact-disc.png b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/compact-disc.png deleted file mode 100644 index c9539d3..0000000 Binary files a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/compact-disc.png and /dev/null differ diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/empty.png b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/empty.png new file mode 100644 index 0000000..6d989ff Binary files /dev/null and b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Resources/empty.png differ diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Styles.xaml b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Styles.xaml index 3dc8858..1bd8f97 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Styles.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Styles.xaml @@ -43,7 +43,7 @@ + Fill="{DynamicResource WindowTextForegroundAlternative}" /> diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml index 0c41e11..fade94a 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:vlc="clr-namespace:Meta.Vlc.Wpf;assembly=Meta.Vlc.Wpf" xmlns:local="clr-namespace:QuickLook.Plugin.VideoViewer" xmlns:glassLayer="clr-namespace:QuickLook.Controls.GlassLayer;assembly=QuickLook" @@ -14,6 +13,7 @@ + @@ -42,7 +42,8 @@ - + @@ -56,7 +57,7 @@ - + @@ -67,7 +68,7 @@ - + @@ -77,20 +78,20 @@ + LineHeight="28" MaxHeight="80" TextTrimming="CharacterEllipsis"> ときめきポポロン♪ - チマメ隊 - ときめきポポロン♪ - + Text="{Binding ElementName=mediaElement, Path=Length, Converter={StaticResource TimeSpanToShortStringConverter}}" /> @@ -99,8 +100,7 @@ - + Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.05" /> - - + + + + + - diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs index 19002c1..a1a6c98 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs @@ -21,6 +21,7 @@ using System.Diagnostics; using System.Drawing; using System.Runtime.CompilerServices; using System.Threading.Tasks; +using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media.Animation; @@ -62,13 +63,13 @@ namespace QuickLook.Plugin.VideoViewer _context = context; - buttonPlayPause.MouseLeftButtonUp += TogglePlayPause; + buttonPlayPause.Click += TogglePlayPause; //buttonMute.MouseLeftButtonUp += (sender, e) => //{ // mediaElement.IsMuted = false; // buttonMute.Visibility = Visibility.Collapsed; //}; - buttonMute.MouseLeftButtonUp += (sender, e) => IsMuted = !IsMuted; + buttonMute.Click += (sender, e) => IsMuted = !IsMuted; sliderProgress.PreviewMouseDown += (sender, e) => { @@ -91,7 +92,7 @@ namespace QuickLook.Plugin.VideoViewer } };*/ - PreviewMouseWheel += (sender, e) => ChangeVolume((double) e.Delta / 120 * 2); + PreviewMouseWheel += (sender, e) => ChangeVolume((double) e.Delta / 120 * 4); } public bool IsMuted @@ -228,8 +229,6 @@ namespace QuickLook.Plugin.VideoViewer { var state = e.Value; - Debug.WriteLine(state); - switch (state) { case MediaState.Opening: @@ -268,6 +267,13 @@ namespace QuickLook.Plugin.VideoViewer metaTitle.Text = mediaElement.VlcMediaPlayer.Media.GetMeta(MetaDataType.Title); metaArtists.Text = mediaElement.VlcMediaPlayer.Media.GetMeta(MetaDataType.Artist); metaAlbum.Text = mediaElement.VlcMediaPlayer.Media.GetMeta(MetaDataType.Album); + + metaArtists.Visibility = string.IsNullOrEmpty(metaArtists.Text) + ? Visibility.Collapsed + : Visibility.Visible; + metaAlbum.Visibility = string.IsNullOrEmpty(metaAlbum.Text) + ? Visibility.Collapsed + : Visibility.Visible; } private void DetermineTheme() @@ -308,7 +314,7 @@ namespace QuickLook.Plugin.VideoViewer if (_wasPlaying) mediaElement.Play(); } - private void TogglePlayPause(object sender, MouseButtonEventArgs e) + private void TogglePlayPause(object sender, EventArgs e) { if (mediaElement.VlcMediaPlayer.IsPlaying) { diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/packages.config b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/packages.config deleted file mode 100644 index 069c91c..0000000 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/QuickLook/App.xaml b/QuickLook/App.xaml index 95b5b8c..55d40ca 100644 --- a/QuickLook/App.xaml +++ b/QuickLook/App.xaml @@ -9,8 +9,6 @@ - - diff --git a/QuickLook/Controls/BusyDecorator/BusyDecorator.cs b/QuickLook/Controls/BusyDecorator/BusyDecorator.cs index 1398e4a..7d4b637 100644 --- a/QuickLook/Controls/BusyDecorator/BusyDecorator.cs +++ b/QuickLook/Controls/BusyDecorator/BusyDecorator.cs @@ -29,6 +29,11 @@ namespace QuickLook.Controls.BusyDecorator { private readonly BackgroundVisualHost _busyHost = new BackgroundVisualHost(); + private readonly ResourceDictionary _styles = new ResourceDictionary + { + Source = new Uri("pack://application:,,,/QuickLook;component/Controls/BusyDecorator/BusyDecorator.xaml") + }; + static BusyDecorator() { DefaultStyleKeyProperty.OverrideMetadata( @@ -38,6 +43,8 @@ namespace QuickLook.Controls.BusyDecorator public BusyDecorator() { + Resources.MergedDictionaries.Add(_styles); + AddLogicalChild(_busyHost); AddVisualChild(_busyHost); @@ -85,9 +92,11 @@ namespace QuickLook.Controls.BusyDecorator private void SetBinding(DependencyObject obj, DependencyProperty source, DependencyProperty target) { - var b = new Binding(); - b.Source = this; - b.Path = new PropertyPath(source); + var b = new Binding + { + Source = this, + Path = new PropertyPath(source) + }; BindingOperations.SetBinding(obj, target, b); } diff --git a/QuickLook/Styles/BusyDecorator.xaml b/QuickLook/Controls/BusyDecorator/BusyDecorator.xaml similarity index 75% rename from QuickLook/Styles/BusyDecorator.xaml rename to QuickLook/Controls/BusyDecorator/BusyDecorator.xaml index ec08b35..85f9930 100644 --- a/QuickLook/Styles/BusyDecorator.xaml +++ b/QuickLook/Controls/BusyDecorator/BusyDecorator.xaml @@ -1,9 +1,6 @@ - - + - - +