2023-11-20 11:23:26 +01:00
|
|
|
<ui:FluentWindow
|
|
|
|
|
x:Class="PowerLauncher.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:local="clr-namespace:PowerLauncher"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:p="clr-namespace:PowerLauncher.Properties"
|
|
|
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
|
|
|
xmlns:vm="clr-namespace:PowerLauncher.ViewModel"
|
|
|
|
|
Title="PowerToys Run"
|
|
|
|
|
Width="640"
|
2023-12-08 14:57:42 +01:00
|
|
|
MinHeight="0"
|
2023-11-20 11:23:26 +01:00
|
|
|
d:DataContext="{d:DesignInstance vm:MainViewModel}"
|
|
|
|
|
ui:ExtendsContentIntoTitleBar="True"
|
|
|
|
|
AllowDrop="True"
|
|
|
|
|
Closed="OnClosed"
|
|
|
|
|
Closing="OnClosing"
|
|
|
|
|
Deactivated="OnDeactivated"
|
|
|
|
|
IsVisibleChanged="OnVisibilityChanged"
|
|
|
|
|
Loaded="OnLoaded"
|
|
|
|
|
LocationChanged="OnLocationChanged"
|
|
|
|
|
ResizeMode="NoResize"
|
|
|
|
|
ShowInTaskbar="False"
|
|
|
|
|
SizeToContent="Height"
|
|
|
|
|
SourceInitialized="OnSourceInitialized"
|
|
|
|
|
Topmost="True"
|
|
|
|
|
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
WindowStartupLocation="Manual"
|
|
|
|
|
WindowStyle="None"
|
2023-12-08 14:57:42 +01:00
|
|
|
mc:Ignorable="d">
|
2020-06-01 12:35:37 -07:00
|
|
|
|
2023-11-20 11:23:26 +01:00
|
|
|
<Grid x:Name="RootGrid" MouseDown="OnMouseDown">
|
|
|
|
|
<!-- We set the background here because the Acrylic can be too translucent / background too bright on Light theme -->
|
|
|
|
|
<Grid.Background>
|
|
|
|
|
<SolidColorBrush Opacity="0.8" Color="{DynamicResource ApplicationBackgroundColor}" />
|
|
|
|
|
</Grid.Background>
|
2020-04-20 19:53:20 -07:00
|
|
|
<Grid.RowDefinitions>
|
2023-11-20 11:23:26 +01:00
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="*" MaxHeight="{Binding Results.MaxHeight}" />
|
2020-04-20 19:53:20 -07:00
|
|
|
</Grid.RowDefinitions>
|
2023-11-20 11:23:26 +01:00
|
|
|
<Border
|
|
|
|
|
x:Name="SearchBoxBorder"
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Margin="12,12,12,0"
|
|
|
|
|
Background="{DynamicResource LayerFillColorDefaultBrush}"
|
|
|
|
|
BorderBrush="{DynamicResource SurfaceStrokeColorDefaultBrush}"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="8">
|
|
|
|
|
<local:LauncherControl x:Name="SearchBox" />
|
|
|
|
|
</Border>
|
|
|
|
|
<local:ResultList
|
|
|
|
|
x:Name="ListBox"
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
|
PreviewMouseDown="ListBox_PreviewMouseDown"
|
|
|
|
|
Visibility="{Binding Results.Visibility}" />
|
|
|
|
|
|
|
|
|
|
<!-- Have to use a Grid instead of a StackPanel for scrolling to work? -->
|
|
|
|
|
<Grid
|
|
|
|
|
x:Name="KeywordsOverviewGrid"
|
2020-08-20 21:45:55 -07:00
|
|
|
Grid.Row="1"
|
2023-11-20 11:23:26 +01:00
|
|
|
Margin="12,0,0,0"
|
|
|
|
|
Visibility="{Binding PluginsOverviewVisibility}">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<TextBlock
|
|
|
|
|
Margin="10,16,0,8"
|
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
|
Style="{StaticResource CaptionTextBlockStyle}"
|
|
|
|
|
Text="{x:Static p:Resources.PluginKeywords}" />
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
ItemContainerStyle="{StaticResource PluginsListViewItemStyle}"
|
|
|
|
|
ItemsSource="{Binding Plugins}"
|
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
|
SelectionMode="Single">
|
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Grid Height="36">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Border
|
|
|
|
|
Width="32"
|
|
|
|
|
Height="32"
|
|
|
|
|
Margin="4,0,10,0"
|
|
|
|
|
Background="{DynamicResource ControlFillColorDefaultBrush}"
|
|
|
|
|
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="4">
|
|
|
|
|
<TextBlock
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
|
|
|
Text="{Binding Metadata.ActionKeyword}" />
|
|
|
|
|
</Border>
|
|
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
|
|
|
Text="{Binding Plugin.Description}"
|
|
|
|
|
TextTrimming="CharacterEllipsis" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
2020-08-20 21:45:55 -07:00
|
|
|
</Grid>
|
2023-11-20 11:23:26 +01:00
|
|
|
</Grid>
|
|
|
|
|
<ui:FluentWindow.InputBindings>
|
|
|
|
|
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
|
|
|
|
|
<KeyBinding Key="Enter" Command="{Binding OpenResultWithKeyboardCommand}" />
|
|
|
|
|
<KeyBinding
|
|
|
|
|
Key="F4"
|
|
|
|
|
Command="{Binding IgnoreCommand}"
|
|
|
|
|
Modifiers="Alt" />
|
|
|
|
|
</ui:FluentWindow.InputBindings>
|
|
|
|
|
</ui:FluentWindow>
|