Fix #166: hide controls from beginning

This commit is contained in:
Paddy Xu
2018-06-23 16:39:32 +03:00
parent c771c72017
commit 2743a83e27
5 changed files with 24 additions and 3 deletions

View File

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

View File

@@ -90,6 +90,16 @@
</Grid> </Grid>
<Grid x:Name="videoControlContainer" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="32"> <Grid x:Name="videoControlContainer" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="32">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding HasVideo, ElementName=viewerPanel}" Value="True">
<Setter Property="Opacity" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.Resources> <Grid.Resources>
<Storyboard x:Key="ShowControlStoryboard" Completed="AutoHideViedoControlContainer"> <Storyboard x:Key="ShowControlStoryboard" Completed="AutoHideViedoControlContainer">
<DoubleAnimation <DoubleAnimation

View File

@@ -60,7 +60,7 @@ namespace QuickLook.Plugin.VideoViewer
// apply global theme // apply global theme
Resources.MergedDictionaries[0].MergedDictionaries.Clear(); Resources.MergedDictionaries[0].MergedDictionaries.Clear();
ShowViedoControlContainer(null, null); //ShowViedoControlContainer(null, null);
viewerPanel.PreviewMouseMove += ShowViedoControlContainer; viewerPanel.PreviewMouseMove += ShowViedoControlContainer;
mediaElement.PropertyChanged += PlayerPropertyChanged; mediaElement.PropertyChanged += PlayerPropertyChanged;

View File

@@ -171,7 +171,7 @@ namespace QuickLook
if (Visibility != Visibility.Visible) if (Visibility != Visibility.Visible)
Show(); Show();
ShowWindowCaptionContainer(null, null); //ShowWindowCaptionContainer(null, null);
//WindowHelper.SetActivate(new WindowInteropHelper(this), ContextObject.CanFocus); //WindowHelper.SetActivate(new WindowInteropHelper(this), ContextObject.CanFocus);
// load plugin, do not block UI // load plugin, do not block UI
@@ -221,7 +221,7 @@ namespace QuickLook
{ {
// limit str length // limit str length
if (replaceWith.Length > 16) if (replaceWith.Length > 16)
replaceWith = replaceWith.Substring(0, 14) + "…" + replaceWith.Substring(replaceWith.Length - 2); replaceWith = replaceWith.Substring(0, 8) + "…" + replaceWith.Substring(replaceWith.Length - 8);
str = TranslationHelper.Get(str); str = TranslationHelper.Get(str);
var elements = str.Split(new[] {"{0}"}, StringSplitOptions.None).ToList(); var elements = str.Split(new[] {"{0}"}, StringSplitOptions.None).ToList();

View File

@@ -48,6 +48,16 @@
<Grid x:Name="windowCaptionContainer" Height="{StaticResource MainWindowCaptionHeight}" <Grid x:Name="windowCaptionContainer" Height="{StaticResource MainWindowCaptionHeight}"
VerticalAlignment="Top" VerticalAlignment="Top"
ZIndex="100"> ZIndex="100">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding ContextObject.TitlebarAutoHide, ElementName=mainWindow}" Value="True">
<Setter Property="Opacity" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.Resources> <Grid.Resources>
<Storyboard x:Key="ShowCaptionContainerStoryboard" Completed="AutoHideCaptionContainer"> <Storyboard x:Key="ShowCaptionContainerStoryboard" Completed="AutoHideCaptionContainer">
<DoubleAnimation <DoubleAnimation