mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
120 lines
5.6 KiB
XML
120 lines
5.6 KiB
XML
<UserControl
|
|
x:Class="Flow.Launcher.HotkeyControl"
|
|
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:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
d:DesignWidth="300"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<Popup
|
|
x:Name="popup"
|
|
AllowDrop="True"
|
|
AllowsTransparency="True"
|
|
IsOpen="{Binding IsKeyboardFocused, ElementName=tbHotkey, Mode=OneWay}"
|
|
Placement="Top"
|
|
PlacementTarget="{Binding ElementName=tbHotkey}"
|
|
PopupAnimation="Fade"
|
|
StaysOpen="True"
|
|
VerticalOffset="-5">
|
|
<Border
|
|
Width="140"
|
|
Height="30"
|
|
Background="{DynamicResource Color01B}"
|
|
BorderBrush="{DynamicResource Color21B}"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<TextBlock
|
|
x:Name="tbMsg"
|
|
Margin="0,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="13"
|
|
FontWeight="SemiBold"
|
|
Foreground="{DynamicResource Color05B}"
|
|
Text="{DynamicResource flowlauncherPressHotkey}"
|
|
Visibility="Visible" />
|
|
</Border>
|
|
</Popup>
|
|
|
|
<ToggleButton
|
|
x:Name="HotkeyBtn"
|
|
Click="OnButtonClicked"
|
|
FontSize="13"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource Color01B}">
|
|
<ToggleButton.Template>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Border
|
|
x:Name="MenuBorder"
|
|
Grid.Column="0"
|
|
Padding="5,0,5,0"
|
|
Background="{DynamicResource Color12B}"
|
|
BorderBrush="{DynamicResource ButtonInsideBorder}"
|
|
BorderThickness="1"
|
|
CornerRadius="5">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Button Content="Reset" />
|
|
<Button Content="Delete" />
|
|
<Button Content="Stop Rec" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border
|
|
x:Name="ButtonBorder"
|
|
Grid.Column="1"
|
|
Padding="5,0,5,0"
|
|
Background="{DynamicResource Color12B}"
|
|
BorderBrush="{DynamicResource ButtonInsideBorder}"
|
|
BorderThickness="1"
|
|
CornerRadius="5">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource CustomContextHover}" />
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource ButtonMousePressed}" />
|
|
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource ButtonMousePressedInsideBorder}" />
|
|
</Trigger>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="MenuBorder" Property="Visibility" Value="Visible" />
|
|
</Trigger>
|
|
<Trigger Property="IsChecked" Value="False">
|
|
<Setter TargetName="MenuBorder" Property="Visibility" Value="Collapsed" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</ToggleButton.Template>
|
|
<ToggleButton.Content>
|
|
<ItemsControl ItemsSource="{Binding Path=KeysToDisplay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border
|
|
Margin="2,5,2,5"
|
|
Padding="10,5,10,5"
|
|
Background="{DynamicResource SystemAccentColorLight2Brush}"
|
|
BorderThickness="1"
|
|
CornerRadius="5">
|
|
<TextBlock Text="{Binding}" />
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ToggleButton.Content>
|
|
</ToggleButton>
|
|
</Grid>
|
|
</UserControl>
|