mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-20 02:19:57 +08:00
Stop using adaptive theme. Fix #194.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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" />
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user