Stop using adaptive theme. Fix #194.

This commit is contained in:
Paddy Xu
2018-06-23 16:12:08 +03:00
parent db31458ffe
commit 6abca346be
3 changed files with 2 additions and 18 deletions

View File

@@ -80,7 +80,6 @@ namespace QuickLook.Plugin.VideoViewer
else else
{ {
context.TitlebarAutoHide = true; context.TitlebarAutoHide = true;
context.Theme = Themes.Dark;
context.TitlebarBlurVisibility = true; context.TitlebarBlurVisibility = true;
} }
} }

View File

@@ -42,10 +42,10 @@
<BlurEffect Radius="100" /> <BlurEffect Radius="100" />
</Rectangle.Effect> </Rectangle.Effect>
<Rectangle.Fill> <Rectangle.Fill>
<ImageBrush ImageSource="{Binding ElementName=viewerPanel, Path=CoverArt}" Stretch="UniformToFill" <ImageBrush ImageSource="{Binding ElementName=viewerPanel, Path=CoverArt}" Stretch="UniformToFill" />
Opacity="0.9" />
</Rectangle.Fill> </Rectangle.Fill>
</Rectangle> </Rectangle>
<Rectangle Grid.Column="0" Grid.ColumnSpan="2" Fill="{DynamicResource MainWindowBackground}" Opacity="0.6" />
<Image Grid.Column="0" x:Name="imageCoverArt" Margin="20,40,20,40"> <Image Grid.Column="0" x:Name="imageCoverArt" Margin="20,40,20,40">
<Image.Effect> <Image.Effect>
<DropShadowEffect Direction="0" BlurRadius="6" Color="#FF898989" ShadowDepth="0" /> <DropShadowEffect Direction="0" BlurRadius="6" Color="#FF898989" ShadowDepth="0" />

View File

@@ -237,7 +237,6 @@ namespace QuickLook.Plugin.VideoViewer
break; break;
case MediaState.Playing: case MediaState.Playing:
UpdateMeta(); UpdateMeta();
DetermineTheme();
HasVideo = mediaElement.VlcMediaPlayer.VideoTrackCount > 0; HasVideo = mediaElement.VlcMediaPlayer.VideoTrackCount > 0;
HasAudio = mediaElement.VlcMediaPlayer.AudioTrackCount > 0; HasAudio = mediaElement.VlcMediaPlayer.AudioTrackCount > 0;
IsPlaying = true; IsPlaying = true;
@@ -277,20 +276,6 @@ namespace QuickLook.Plugin.VideoViewer
: Visibility.Visible; : Visibility.Visible;
} }
private void DetermineTheme()
{
if (HasVideo)
return;
if (CoverArt == null)
return;
using (var bitmap = new Bitmap(CoverArt.ToBitmap()))
{
_context.Theme = bitmap.IsDarkImage() ? Themes.Dark : Themes.Light;
}
}
private void ChangeVolume(double delta) private void ChangeVolume(double delta)
{ {
IsMuted = false; IsMuted = false;