晚安, 还在功能性开发
This commit is contained in:
@@ -105,7 +105,7 @@
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel MouseLeftButtonDown="MenuClick" Tag="{Binding}">
|
||||
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||
<hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||
HorizontalAlignment="Left"
|
||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
|
||||
FontSize="15"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}" Unchecked="CheckBox_Unchecked">
|
||||
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
@@ -56,6 +56,14 @@
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,193,0,-180.337" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="当前热键:"/>
|
||||
<hc:TextBox HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
IsReadOnly="True"
|
||||
IsReadOnlyCaretVisible="True"
|
||||
Width="80"
|
||||
Text="{Binding HotkeyStr}"
|
||||
KeyDown="HotKeyDown"
|
||||
Margin="12.967,-7.38,-12.967,0"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:SimplePanel>
|
||||
|
||||
|
||||
@@ -23,16 +23,40 @@ namespace GeekDesk.Control.UserControls
|
||||
/// </summary>
|
||||
public partial class MotionControl : UserControl
|
||||
{
|
||||
private static bool controlKeyDown = false;
|
||||
private static AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||
|
||||
public MotionControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
|
||||
/// <summary>
|
||||
/// 热键按下
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void HotKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
|
||||
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Windows)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Alt)
|
||||
|| (e.Key >= Key.A && e.Key <= Key.Z))
|
||||
{
|
||||
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Windows)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Alt))
|
||||
{
|
||||
appConfig.HotkeyStr = "Ctrl + ";
|
||||
} else if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Windows)
|
||||
|| e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Alt)
|
||||
&& (e.Key >= Key.A && e.Key <= Key.Z))
|
||||
{
|
||||
appConfig.HotkeyStr += e.Key.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user