Skip to content

Commit

Permalink
simplifying the xaml and making things tighter (#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
crutkas authored Apr 22, 2020
1 parent fed254f commit 9ae97de
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
12 changes: 4 additions & 8 deletions src/modules/launcher/PowerLauncher.UI/LauncherControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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"
Loaded="UserControl_Loaded"
d:DesignHeight="300"
Expand Down Expand Up @@ -357,19 +354,18 @@
<Grid
x:Name="PowerBar"
Background="{ThemeResource BackdropAcrylicBrush}"
Height="72"
Translation="0,0,16"
Height="60"
VerticalAlignment="Top">
<TextBox
x:Name="AutoCompleteTextBox"
x:FieldModifier="public"
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
Height="72"
Height="60"
IsReadOnly="True"
AllowFocusOnInteraction="False"
ScrollViewer.BringIntoViewOnFocusChange="False"
Canvas.ZIndex="0"
Margin="0"
Margin="0"
VerticalAlignment="Center"
FontSize="24"
DesiredCandidateWindowAlignment="BottomEdge" />
Expand All @@ -379,7 +375,7 @@
x:FieldModifier="public"
Style="{StaticResource CustomAutoSuggestBoxTextBoxStyle}"
PlaceholderText="Start typing"
Height="72"
Height="60"
ScrollViewer.BringIntoViewOnFocusChange="False"
Canvas.ZIndex="0"
Margin="0"
Expand Down
6 changes: 2 additions & 4 deletions src/modules/launcher/PowerLauncher.UI/ResultList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<Grid
x:Name="PowerBar"
Background="{ThemeResource BackdropAcrylicBrush}"
Translation="0,0,16"
VerticalAlignment="Top">
<ListView
x:Name="SuggestionsList"
Expand All @@ -22,13 +21,12 @@
MinHeight="{Binding Results.MaxHeight}"
AllowFocusOnInteraction="False"
IsItemClickEnabled="True"
Margin="{ThemeResource AutoSuggestListMargin}"
Margin="0"
Padding="{ThemeResource AutoSuggestListPadding}"
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">
Expand Down
33 changes: 23 additions & 10 deletions src/modules/launcher/PowerLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Window x:Class="PowerLauncher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wox="clr-namespace:PowerLauncher"
xmlns:vm="clr-namespace:Wox.ViewModel;assembly=Wox"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -30,24 +29,38 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</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>
<DropShadowEffect BlurRadius="12" Opacity="0.3" ShadowDepth="4" />
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
</Border.Effect>
<xaml:WindowsXamlHost InitialTypeName="PowerLauncher.UI.LauncherControl" ChildChanged="WindowsXamlHostTextBox_ChildChanged" />
<xaml:WindowsXamlHost
InitialTypeName="PowerLauncher.UI.LauncherControl"
ChildChanged="WindowsXamlHostTextBox_ChildChanged" />
</Border>
<Border Grid.Row="1" Name="myElement" Background="Transparent" Height="10"/>
<Border x:Name="ListBoxBorder" Margin="10" Grid.Row="2" BorderThickness="4" CornerRadius="4" Visibility="{Binding Results.Visbility}">
<Border
x:Name="ListBoxBorder"
Grid.Row="1"
Margin="8"
BorderThickness="4"
CornerRadius="4"
Visibility="{Binding Results.Visbility}">
<Border.Effect>
<DropShadowEffect BlurRadius="12" Opacity="0.3" ShadowDepth="4" />
<DropShadowEffect BlurRadius="12" Opacity="0.4" ShadowDepth="4" />
</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>
</Grid>
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}"></KeyBinding>
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
</Window.InputBindings>
</Window>

0 comments on commit 9ae97de

Please sign in to comment.