mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
simplifying the xaml and making things tighter (#2327)
This commit is contained in:
@@ -5,9 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
xmlns:ToolkitBehaviors="using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors"
|
|
||||||
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
|
|
||||||
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
|
|
||||||
ActualThemeChanged="UserControl_ActualThemeChanged"
|
ActualThemeChanged="UserControl_ActualThemeChanged"
|
||||||
Loaded="UserControl_Loaded"
|
Loaded="UserControl_Loaded"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
@@ -357,19 +354,18 @@
|
|||||||
<Grid
|
<Grid
|
||||||
x:Name="PowerBar"
|
x:Name="PowerBar"
|
||||||
Background="{ThemeResource BackdropAcrylicBrush}"
|
Background="{ThemeResource BackdropAcrylicBrush}"
|
||||||
Height="72"
|
Height="60"
|
||||||
Translation="0,0,16"
|
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="AutoCompleteTextBox"
|
x:Name="AutoCompleteTextBox"
|
||||||
x:FieldModifier="public"
|
x:FieldModifier="public"
|
||||||
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
||||||
Height="72"
|
Height="60"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
AllowFocusOnInteraction="False"
|
AllowFocusOnInteraction="False"
|
||||||
ScrollViewer.BringIntoViewOnFocusChange="False"
|
ScrollViewer.BringIntoViewOnFocusChange="False"
|
||||||
Canvas.ZIndex="0"
|
Canvas.ZIndex="0"
|
||||||
Margin="0"
|
Margin="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="24"
|
FontSize="24"
|
||||||
DesiredCandidateWindowAlignment="BottomEdge" />
|
DesiredCandidateWindowAlignment="BottomEdge" />
|
||||||
@@ -379,7 +375,7 @@
|
|||||||
x:FieldModifier="public"
|
x:FieldModifier="public"
|
||||||
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
|
||||||
PlaceholderText="Start typing"
|
PlaceholderText="Start typing"
|
||||||
Height="72"
|
Height="60"
|
||||||
ScrollViewer.BringIntoViewOnFocusChange="False"
|
ScrollViewer.BringIntoViewOnFocusChange="False"
|
||||||
Canvas.ZIndex="0"
|
Canvas.ZIndex="0"
|
||||||
Margin="0"
|
Margin="0"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
<Grid
|
<Grid
|
||||||
x:Name="PowerBar"
|
x:Name="PowerBar"
|
||||||
Background="{ThemeResource BackdropAcrylicBrush}"
|
Background="{ThemeResource BackdropAcrylicBrush}"
|
||||||
Translation="0,0,16"
|
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="SuggestionsList"
|
x:Name="SuggestionsList"
|
||||||
@@ -22,13 +21,12 @@
|
|||||||
MinHeight="{Binding Results.MaxHeight}"
|
MinHeight="{Binding Results.MaxHeight}"
|
||||||
AllowFocusOnInteraction="False"
|
AllowFocusOnInteraction="False"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="True"
|
||||||
Margin="{ThemeResource AutoSuggestListMargin}"
|
Margin="0"
|
||||||
Padding="{ThemeResource AutoSuggestListPadding}"
|
Padding="{ThemeResource AutoSuggestListPadding}"
|
||||||
ItemsSource="{Binding Results.Results, Mode=OneWay}"
|
ItemsSource="{Binding Results.Results, Mode=OneWay}"
|
||||||
SelectionMode="Single"
|
SelectionMode="Single"
|
||||||
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
|
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
|
||||||
Style="{StaticResource ListViewNoAnimations}"
|
Style="{StaticResource ListViewNoAnimations}">
|
||||||
>
|
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate >
|
<DataTemplate >
|
||||||
<Grid Height="72" Width="690" Background="Transparent" RowSpacing="0">
|
<Grid Height="72" Width="690" Background="Transparent" RowSpacing="0">
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Window x:Class="PowerLauncher.MainWindow"
|
<Window x:Class="PowerLauncher.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:wox="clr-namespace:PowerLauncher"
|
|
||||||
xmlns:vm="clr-namespace:Wox.ViewModel;assembly=Wox"
|
xmlns:vm="clr-namespace:Wox.ViewModel;assembly=Wox"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@@ -30,24 +29,38 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Border x:Name="SearchBoxBorder" Margin="10" Grid.Row="0" BorderThickness="4" CornerRadius="4">
|
<Border
|
||||||
|
x:Name="SearchBoxBorder"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="8"
|
||||||
|
BorderThickness="4"
|
||||||
|
CornerRadius="4">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect BlurRadius="12" Opacity="0.3" ShadowDepth="4" />
|
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<xaml:WindowsXamlHost InitialTypeName="PowerLauncher.UI.LauncherControl" ChildChanged="WindowsXamlHostTextBox_ChildChanged" />
|
<xaml:WindowsXamlHost
|
||||||
|
InitialTypeName="PowerLauncher.UI.LauncherControl"
|
||||||
|
ChildChanged="WindowsXamlHostTextBox_ChildChanged" />
|
||||||
</Border>
|
</Border>
|
||||||
<Border Grid.Row="1" Name="myElement" Background="Transparent" Height="10"/>
|
<Border
|
||||||
<Border x:Name="ListBoxBorder" Margin="10" Grid.Row="2" BorderThickness="4" CornerRadius="4" Visibility="{Binding Results.Visbility}">
|
x:Name="ListBoxBorder"
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="8"
|
||||||
|
BorderThickness="4"
|
||||||
|
CornerRadius="4"
|
||||||
|
Visibility="{Binding Results.Visbility}">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect BlurRadius="12" Opacity="0.3" ShadowDepth="4" />
|
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<xaml:WindowsXamlHost PreviewMouseDown="WindowsXamlHost_PreviewMouseDown" InitialTypeName="PowerLauncher.UI.ResultList" ChildChanged="WindowsXamlHostListView_ChildChanged" />
|
<xaml:WindowsXamlHost
|
||||||
|
InitialTypeName="PowerLauncher.UI.ResultList"
|
||||||
|
ChildChanged="WindowsXamlHostListView_ChildChanged"
|
||||||
|
PreviewMouseDown="WindowsXamlHost_PreviewMouseDown" />
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Window.InputBindings>
|
<Window.InputBindings>
|
||||||
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
|
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
|
||||||
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}"></KeyBinding>
|
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
|
||||||
</Window.InputBindings>
|
</Window.InputBindings>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
Reference in New Issue
Block a user