mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-08 01:52:52 +08:00
Merge branch 'dev/PowerLauncher' into dev/traies/merge-powerlauncher
This commit is contained in:
commit
dceef35aac
@ -12,23 +12,17 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Color x:Key="BackgroundColor">#FFf2f1f2</Color>
|
||||
<SolidColorBrush x:Key="PrimaryTextColor" Color="Black"/>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="{ThemeResource SystemChromeLowColor}" />
|
||||
<AcrylicBrush x:Key="BackdropAcrylicBrush" BackgroundSource="Backdrop" TintColor="White" TintOpacity="0.9" FallbackColor="White"/>
|
||||
<AcrylicBrush x:Key="KeyboardShortcutAcrylicBrush" BackgroundSource="Backdrop" TintColor="White" TintOpacity="0.9" FallbackColor="White"/>
|
||||
<SolidColorBrush x:Key="ItemBackgroundColor" Color="#FFFFFFFF"/>
|
||||
<Color x:Key="DropShadowColor">#FF979797</Color>
|
||||
<x:Double x:Key="DropShadowBlurRadius">8</x:Double>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="{StaticResource BackgroundColor}" />
|
||||
<AcrylicBrush x:Key="BackdropAcrylicBrush" BackgroundSource="Backdrop" TintColor="{StaticResource BackgroundColor}" TintOpacity="0.9" FallbackColor="{StaticResource BackgroundColor}"/>
|
||||
</ResourceDictionary>
|
||||
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<SolidColorBrush x:Key="PrimaryTextColor" Color="White"/>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="{ThemeResource SystemChromeLowColor}" />
|
||||
<AcrylicBrush x:Key="BackdropAcrylicBrush" BackgroundSource="Backdrop" TintColor="#88484848" TintOpacity="0.9" FallbackColor="#FF484848"/>
|
||||
<AcrylicBrush x:Key="KeyboardShortcutAcrylicBrush" BackgroundSource="Backdrop" TintColor="Black" TintOpacity="0.9" FallbackColor="Black"/>
|
||||
<SolidColorBrush x:Key="ItemBackgroundColor" Color="#FFFFFFFF"/>
|
||||
<x:Double x:Key="DropShadowBlurRadius">8</x:Double>
|
||||
<Color x:Key="DropShadowColor">#FF979797</Color>
|
||||
<Color x:Key="BackgroundColor">#FF484848</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="{ThemeResource BackgroundColor}" />
|
||||
<AcrylicBrush x:Key="BackdropAcrylicBrush" BackgroundSource="Backdrop" TintColor="{StaticResource BackgroundColor}" TintOpacity="0.9" FallbackColor="{StaticResource BackgroundColor}"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
@ -42,7 +36,7 @@
|
||||
|
||||
<Style x:Key="IconOnlyButton" TargetType="Button">
|
||||
<Setter Property="Background" Value="{ThemeResource ButtonRevealBackground}" />
|
||||
<Setter Property="Foreground" Value="{ThemeResource PrimaryTextColor}" />
|
||||
<!--<Setter Property="Foreground" Value="{ThemeResource PrimaryTextColor}" />-->
|
||||
<!--<Setter Property="BorderBrush" Value="0" />-->
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource ButtonRevealBorderThemeThickness}" />
|
||||
<Setter Property="Padding" Value="{ThemeResource ButtonPadding}" />
|
||||
@ -112,195 +106,6 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="GridViewItem" x:Key="DropShadowGridViewItemRevealStyle">
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<!--<Setter Property="Background" Value="{ThemeResource GridViewItemRevealBackground}" />-->
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource GridViewItemRevealBorderThemeThickness}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource GridViewItemRevealBorderBrush}" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||
|
||||
<Setter Property="Foreground" Value="{ThemeResource GridViewItemForeground}" />
|
||||
<Setter Property="TabNavigation" Value="Local" />
|
||||
<Setter Property="IsHoldingEnabled" Value="True" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="0,0,4,4" />
|
||||
<Setter Property="MinWidth" Value="{ThemeResource GridViewItemMinWidth}" />
|
||||
<Setter Property="MinHeight" Value="{ThemeResource GridViewItemMinHeight}" />
|
||||
<Setter Property="AllowDrop" Value="False" />
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True" />
|
||||
<Setter Property="FocusVisualMargin" Value="-2" />
|
||||
<Setter Property="FocusVisualPrimaryBrush" Value="{ThemeResource GridViewItemFocusVisualPrimaryBrush}" />
|
||||
<Setter Property="FocusVisualPrimaryThickness" Value="2" />
|
||||
<Setter Property="FocusVisualSecondaryBrush" Value="{ThemeResource GridViewItemFocusVisualSecondaryBrush}" />
|
||||
<Setter Property="FocusVisualSecondaryThickness" Value="1" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="GridViewItem">
|
||||
|
||||
<Grid x:Name="RootGrid" Width="120" Background="{ThemeResource GridViewItemRevealBackground}">
|
||||
<!--<Interactivity:Interaction.Behaviors>
|
||||
<Core:EventTriggerBehavior EventName="PointerEntered">
|
||||
<Core:CallMethodAction TargetObject="{Binding ElementName=GridScaleUp}" MethodName="StartAnimation"/>
|
||||
</Core:EventTriggerBehavior>
|
||||
<Core:EventTriggerBehavior EventName="PointerExited">
|
||||
<Core:CallMethodAction TargetObject="{Binding ElementName=GridScaleDown}" MethodName="StartAnimation"/>
|
||||
</Core:EventTriggerBehavior>
|
||||
</Interactivity:Interaction.Behaviors>-->
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="PointerOver" To="Normal" GeneratedDuration="0:0:0">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="DropShadowHolder" Storyboard.TargetProperty="(DropShadowPanel.ShadowOpacity)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.8">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseIn"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:0.6" Value="0.2">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="DropShadowHolder" Storyboard.TargetProperty="(DropShadowPanel.BlurRadius)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="{StaticResource DropShadowBlurRadiusOnHover}">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseIn"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:0.6" Value="{StaticResource DropShadowBlurRadius}">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="Selected">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentPresenter.BorderThickness" Value="2" />
|
||||
<Setter Target="ContentPresenter.BorderBrush" Value="{StaticResource PrimaryTextColor}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver" />
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ListViewItemRevealBackground}" />
|
||||
<!--<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource GridViewItemRevealBackgroundPointerOver}"/>-->
|
||||
<!--<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource GridViewItemRevealForegroundPointerOver}" />-->
|
||||
</VisualState.Setters>
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="DropShadowHolder" Storyboard.TargetProperty="(DropShadowPanel.ShadowOpacity)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.2">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseIn"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:0.6" Value="0.8">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="DropShadowHolder" Storyboard.TargetProperty="(DropShadowPanel.BlurRadius)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="{StaticResource DropShadowBlurRadius}">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseIn"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:0.6" Value="{StaticResource DropShadowBlurRadiusOnHover}">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<CubicEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="PointerOverSelected">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver" />
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ListViewItemRevealBackground }" />
|
||||
<Setter Target="ContentPresenter.BorderThickness" Value="2" />
|
||||
<Setter Target="ContentPresenter.BorderBrush" Value="{StaticResource PrimaryTextColor}" />
|
||||
<!--<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource GridViewItemRevealForegroundPointerOver}" />-->
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="PointerOverPressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed" />
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ListViewItemRevealBackground }" />
|
||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ListViewItemRevealBackground }" />
|
||||
<!--<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource GridViewItemForegroundPressed}" />-->
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed" />
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ListViewItemRevealBackground }" />
|
||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ListViewItemRevealBackground }" />
|
||||
<!--<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource GridViewItemForegroundPressed}" />-->
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
|
||||
<VisualState x:Name="PressedSelected">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed" />
|
||||
|
||||
<Setter Target="ContentPresenter.BorderThickness" Value="2" />
|
||||
<Setter Target="ContentPresenter.BorderBrush" Value="{StaticResource PrimaryTextColor}" />
|
||||
<!--<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource GridViewItemForegroundPressed}" />-->
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="DisabledStates">
|
||||
<VisualState x:Name="Enabled" />
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="Root.RevealBorderThickness" Value="0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ToolkitControls:DropShadowPanel x:Name="DropShadowHolder" VerticalAlignment="Stretch" Width="72" Margin="10" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
BlurRadius="{StaticResource DropShadowBlurRadius}"
|
||||
ShadowOpacity="0.2"
|
||||
OffsetX="0"
|
||||
OffsetY="0"
|
||||
Color="{StaticResource DropShadowColor}">
|
||||
<ContentPresenter x:Name="ContentPresenter" CornerRadius="4" Width="72"
|
||||
Background="{StaticResource ItemBackgroundColor}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="2"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
|
||||
AutomationProperties.AccessibilityView="Raw" />
|
||||
</ToolkitControls:DropShadowPanel>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</xaml:XamlApplication>
|
@ -15,7 +15,7 @@
|
||||
<Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
|
||||
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" />
|
||||
<Setter Property="Background" Value="{ThemeResource TextControlBackground}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
|
||||
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
@ -26,156 +26,15 @@
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
|
||||
<Setter Property="Padding" Value="12,0,0,0" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Grid>
|
||||
|
||||
<Grid.Resources>
|
||||
<Style x:Name="DeleteButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid
|
||||
x:Name="ButtonLayoutGrid"
|
||||
BorderBrush="{ThemeResource TextControlButtonBorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{ThemeResource TextControlButtonBackground}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>-->
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PrimaryTextColor}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="ButtonLayoutGrid"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="0"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<TextBlock x:Name="GlyphElement"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontStyle="Normal"
|
||||
FontSize="{ThemeResource AutoSuggestBoxIconFontSize}"
|
||||
Text=""
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
AutomationProperties.AccessibilityView="Raw" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Name="QueryButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
Background="{ThemeResource TextControlButtonBackground}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
BorderBrush="{ThemeResource TextControlButtonBorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="" FontFamily="Segoe MDL2 Assets"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
FontSize="24"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PrimaryTextColor}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="0"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</ContentPresenter>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
@ -191,16 +50,11 @@
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Normal" />
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="#FF2e2e2e" />
|
||||
</ObjectAnimationUsingKeyFrames>-->
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="#FF7e7e7e" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
@ -210,14 +64,7 @@
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Focused">
|
||||
|
||||
<Storyboard>
|
||||
<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="#" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="#FF2e2e2e" />
|
||||
</ObjectAnimationUsingKeyFrames>-->
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
@ -227,62 +74,19 @@
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="RequestedTheme">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Light" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="QueryButton" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForeground}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="ButtonStates">
|
||||
<VisualState x:Name="ButtonVisible">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeleteButton" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="ButtonCollapsed" />
|
||||
|
||||
</VisualStateGroup>
|
||||
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
x:Name="BorderElement"
|
||||
Grid.Row="1"
|
||||
Background="{TemplateBinding Background}"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Grid.ColumnSpan="3"
|
||||
Grid.RowSpan="1" />
|
||||
<ContentPresenter
|
||||
x:Name="HeaderContentPresenter"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Visibility="Collapsed"
|
||||
Grid.Row="0"
|
||||
Foreground="{ThemeResource TextControlHeaderForeground}"
|
||||
Margin="{ThemeResource AutoSuggestBoxTopHeaderMargin}"
|
||||
Grid.ColumnSpan="3"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
FontWeight="Normal"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<ScrollViewer
|
||||
x:Name="ContentElement"
|
||||
Grid.Row="1"
|
||||
@ -293,18 +97,18 @@
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
IsTabStop="False"
|
||||
Margin="12,0,0,0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="4"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
ZoomMode="Disabled" />
|
||||
|
||||
<ContentControl
|
||||
x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Height="42"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
Margin="12,0,0,0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
@ -313,38 +117,6 @@
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding PlaceholderText}"
|
||||
IsHitTestVisible="False" />
|
||||
<Button
|
||||
x:Name="DeleteButton"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource DeleteButtonStyle}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
IsTabStop="False"
|
||||
Grid.Column="1"
|
||||
Visibility="Collapsed" Opacity="0"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
MinWidth="34"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
VerticalAlignment="Stretch" />
|
||||
<Button
|
||||
x:Name="QueryButton"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource QueryButtonStyle}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
IsTabStop="False"
|
||||
Grid.Column="2"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
MinWidth="34"
|
||||
Width="{TemplateBinding Height}"
|
||||
VerticalAlignment="Stretch"
|
||||
AutomationProperties.AccessibilityView="Raw"/>
|
||||
<ContentPresenter
|
||||
x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="3"
|
||||
Content="{TemplateBinding Description}"
|
||||
x:Load="False"
|
||||
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
|
||||
AutomationProperties.AccessibilityView="Raw" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@ -352,17 +124,33 @@
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid
|
||||
x:Name="PowerBar"
|
||||
Background="{ThemeResource BackdropAcrylicBrush}"
|
||||
Height="60"
|
||||
VerticalAlignment="Top">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="64"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
x:Name="AutoCompleteTextBlock"
|
||||
x:FieldModifier="public"
|
||||
Opacity="0.6"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
AllowFocusOnInteraction="False"
|
||||
ScrollViewer.BringIntoViewOnFocusChange="False"
|
||||
Canvas.ZIndex="0"
|
||||
Margin="24,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="24"
|
||||
/>
|
||||
|
||||
<TextBox
|
||||
x:Name="AutoCompleteTextBox"
|
||||
x:Name="QueryTextBox"
|
||||
x:FieldModifier="public"
|
||||
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
||||
Height="60"
|
||||
IsReadOnly="True"
|
||||
AllowFocusOnInteraction="False"
|
||||
PlaceholderText="Start typing.."
|
||||
ScrollViewer.BringIntoViewOnFocusChange="False"
|
||||
Canvas.ZIndex="0"
|
||||
Margin="0"
|
||||
@ -370,17 +158,13 @@
|
||||
FontSize="24"
|
||||
DesiredCandidateWindowAlignment="BottomEdge" />
|
||||
|
||||
<TextBox
|
||||
x:Name="TextBox"
|
||||
x:FieldModifier="public"
|
||||
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
||||
PlaceholderText="Start typing"
|
||||
Height="60"
|
||||
ScrollViewer.BringIntoViewOnFocusChange="False"
|
||||
Canvas.ZIndex="0"
|
||||
Margin="0"
|
||||
VerticalAlignment="Center"
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Text=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="24"
|
||||
DesiredCandidateWindowAlignment="BottomEdge" />
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</UserControl>
|
@ -13,11 +13,40 @@
|
||||
d:DesignWidth="720">
|
||||
<UserControl.Resources>
|
||||
<converters:BoolToObjectConverter x:Key="BoolToVisibilityConverter" TrueValue="Visible" FalseValue="Collapsed"/>
|
||||
<Style x:Key="CommandButtonGridViewItemContainerStyle" TargetType="GridViewItem">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Margin" Value="0,0,0,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="GridViewItem">
|
||||
<ListViewItemPresenter x:Name="Root" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="Selected"/>
|
||||
<VisualState x:Name="PointerOver"/>
|
||||
<VisualState x:Name="PointerOverSelected"/>
|
||||
<VisualState x:Name="PointerOverPressed"/>
|
||||
<VisualState x:Name="Pressed"/>
|
||||
<VisualState x:Name="PressedSelected"/>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="DisabledStates">
|
||||
<VisualState x:Name="Enabled"/>
|
||||
<VisualState x:Name="Disabled"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</ListViewItemPresenter>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid
|
||||
x:Name="PowerBar"
|
||||
Background="{ThemeResource BackdropAcrylicBrush}"
|
||||
VerticalAlignment="Top">
|
||||
|
||||
<ListView
|
||||
x:Name="SuggestionsList"
|
||||
x:FieldModifier="public"
|
||||
@ -30,11 +59,10 @@
|
||||
ItemsSource="{Binding Results.Results, Mode=OneWay}"
|
||||
SelectionMode="Single"
|
||||
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
|
||||
Style="{StaticResource ListViewNoAnimations}"
|
||||
>
|
||||
Style="{StaticResource ListViewNoAnimations}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate >
|
||||
<Grid Height="72" Width="690" Background="Transparent" RowSpacing="0">
|
||||
<Grid Height="72" Width="642" Background="Transparent" RowSpacing="0">
|
||||
<Interactivity:Interaction.Behaviors>
|
||||
<Core:EventTriggerBehavior EventName="PointerEntered">
|
||||
<Core:InvokeCommandAction Command="{Binding ActivateContextButtonsHoverCommand}"/>
|
||||
@ -46,22 +74,23 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image x:Name="AppIcon" Height="36" Margin="8,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" Source="{Binding Image}" />
|
||||
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" VerticalAlignment="Bottom"/>
|
||||
<TextBlock x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Opacity="0.6" VerticalAlignment="Top"/>
|
||||
<Image x:Name="AppIcon" Height="36" MaxWidth="56" Grid.RowSpan="2" Margin="-8,0,0,0" HorizontalAlignment="Center" Source="{Binding Image}" />
|
||||
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" Margin="0,0,0,-2" VerticalAlignment="Bottom"/>
|
||||
<TextBlock x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Opacity="0.6" Margin="0,2,0,0" VerticalAlignment="Top"/>
|
||||
<GridView
|
||||
ItemContainerStyle="{StaticResource CommandButtonGridViewItemContainerStyle}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="4"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,42,0"
|
||||
Height="46"
|
||||
Grid.Column="2"
|
||||
Margin="8,8,0,0"
|
||||
Visibility="{Binding AreContextButtonsActive, Converter={StaticResource BoolToVisibilityConverter}}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
@ -70,7 +99,7 @@
|
||||
SelectedIndex="{Binding ContextMenuSelectedIndex}">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Command="{Binding Command}" VerticalAlignment="Center" CornerRadius="4" Height="42" Width="42" BorderThickness="1" Style="{ThemeResource ButtonRevealStyle}">
|
||||
<Button Command="{Binding Command}" VerticalAlignment="Center" CornerRadius="4" Height="42" Width="42" BorderThickness="1" Style="{ThemeResource IconOnlyButton}">
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock Text="{Binding Title}"/>
|
||||
</ToolTipService.ToolTip>
|
||||
|
@ -33,11 +33,11 @@
|
||||
<Border
|
||||
x:Name="SearchBoxBorder"
|
||||
Grid.Row="0"
|
||||
Margin="8"
|
||||
Margin="24,24,24,8"
|
||||
BorderThickness="4"
|
||||
CornerRadius="4">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
|
||||
<DropShadowEffect BlurRadius="16" Opacity="0.8" ShadowDepth="0" />
|
||||
</Border.Effect>
|
||||
<xaml:WindowsXamlHost
|
||||
InitialTypeName="PowerLauncher.UI.LauncherControl"
|
||||
@ -46,12 +46,12 @@
|
||||
<Border
|
||||
x:Name="ListBoxBorder"
|
||||
Grid.Row="1"
|
||||
Margin="8"
|
||||
Margin="24,8,24,24"
|
||||
BorderThickness="4"
|
||||
CornerRadius="4"
|
||||
Visibility="{Binding Results.Visbility}">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
|
||||
<DropShadowEffect BlurRadius="16" Opacity="0.8" ShadowDepth="0" />
|
||||
</Border.Effect>
|
||||
<xaml:WindowsXamlHost
|
||||
InitialTypeName="PowerLauncher.UI.ResultList"
|
||||
|
@ -152,8 +152,8 @@ namespace PowerLauncher
|
||||
_launcher = (PowerLauncher.UI.LauncherControl)host.Child;
|
||||
_launcher.DataContext = _viewModel;
|
||||
_launcher.KeyDown += _launcher_KeyDown;
|
||||
_launcher.TextBox.TextChanging += QueryTextBox_TextChanging;
|
||||
_launcher.TextBox.Loaded += TextBox_Loaded;
|
||||
_launcher.QueryTextBox.TextChanging += QueryTextBox_TextChanging;
|
||||
_launcher.QueryTextBox.Loaded += TextBox_Loaded;
|
||||
_launcher.PropertyChanged += UserControl_PropertyChanged;
|
||||
_viewModel.PropertyChanged += (o, e) =>
|
||||
{
|
||||
@ -170,16 +170,16 @@ namespace PowerLauncher
|
||||
}
|
||||
|
||||
// to select the text so that the user can continue to type
|
||||
if(!String.IsNullOrEmpty(_launcher.TextBox.Text))
|
||||
if(!String.IsNullOrEmpty(_launcher.QueryTextBox.Text))
|
||||
{
|
||||
_launcher.TextBox.SelectAll();
|
||||
_launcher.QueryTextBox.SelectAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(e.PropertyName == nameof(MainViewModel.SystemQueryText))
|
||||
{
|
||||
this._isTextSetProgramatically = true;
|
||||
_launcher.TextBox.Text = _viewModel.SystemQueryText;
|
||||
_launcher.QueryTextBox.Text = _viewModel.SystemQueryText;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -317,31 +317,7 @@ namespace PowerLauncher
|
||||
|
||||
// To populate the AutoCompleteTextBox as soon as the selection is changed or set.
|
||||
// Setting it here instead of when the text is changed as there is a delay in executing the query and populating the result
|
||||
_launcher.AutoCompleteTextBox.PlaceholderText = ListView_FirstItem(_viewModel.QueryText);
|
||||
|
||||
}
|
||||
|
||||
private void ResultsList_ItemClick(object sender, ItemClickEventArgs e)
|
||||
{
|
||||
ResultViewModel result = e?.ClickedItem as ResultViewModel;
|
||||
if(result != null)
|
||||
{
|
||||
_viewModel.Results.SelectedItem = result;
|
||||
_viewModel.OpenResultCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
|
||||
{
|
||||
if (args != null && args.ChosenSuggestion != null)
|
||||
{
|
||||
ResultViewModel result = (ResultViewModel)args.ChosenSuggestion;
|
||||
if (result != null)
|
||||
{
|
||||
_viewModel.Results.SelectedItem = result;
|
||||
_viewModel.OpenResultCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
_launcher.AutoCompleteTextBlock.Text = ListView_FirstItem(_viewModel.QueryText);
|
||||
}
|
||||
|
||||
private const int millisecondsToWait = 200;
|
||||
@ -371,18 +347,18 @@ namespace PowerLauncher
|
||||
|
||||
if(this._isTextSetProgramatically)
|
||||
{
|
||||
this._launcher.TextBox.TextChanged += QueryTextBox_TextChangedProgramatically;
|
||||
this._launcher.QueryTextBox.TextChanged += QueryTextBox_TextChangedProgramatically;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._launcher.TextBox.TextChanged += QueryTextBox_TextChangedByUserInput;
|
||||
this._launcher.QueryTextBox.TextChanged += QueryTextBox_TextChangedByUserInput;
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearAllQueryTextChangedHanlders()
|
||||
{
|
||||
this._launcher.TextBox.TextChanged -= QueryTextBox_TextChangedProgramatically;
|
||||
this._launcher.TextBox.TextChanged -= QueryTextBox_TextChangedByUserInput;
|
||||
this._launcher.QueryTextBox.TextChanged -= QueryTextBox_TextChangedProgramatically;
|
||||
this._launcher.QueryTextBox.TextChanged -= QueryTextBox_TextChangedByUserInput;
|
||||
}
|
||||
|
||||
private void QueryTextBox_TextChangedProgramatically(object sender, Windows.UI.Xaml.Controls.TextChangedEventArgs e)
|
||||
@ -400,7 +376,7 @@ namespace PowerLauncher
|
||||
//To clear the auto-suggest immediately instead of waiting for selection changed
|
||||
if (text == String.Empty)
|
||||
{
|
||||
_launcher.AutoCompleteTextBox.PlaceholderText = String.Empty;
|
||||
_launcher.AutoCompleteTextBlock.Text = String.Empty;
|
||||
}
|
||||
|
||||
_viewModel.QueryText = text;
|
||||
@ -422,7 +398,7 @@ namespace PowerLauncher
|
||||
}
|
||||
}
|
||||
|
||||
private void WindowsXamlHost_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
private void WindowsXamlHost_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
// if (sender != null && e.OriginalSource != null)
|
||||
// {
|
||||
|
Loading…
Reference in New Issue
Block a user