🐛 修复通过任务栏图标打开拾色器, 菜单消失问题
This commit is contained in:
@@ -81,15 +81,25 @@ namespace GeekDesk.Control.Windows
|
||||
if (window == null || !window.Activate())
|
||||
{
|
||||
window = new GlobalColorPickerWindow();
|
||||
window.Opacity = 0;
|
||||
App.DoEvents();
|
||||
window.Show();
|
||||
}
|
||||
window.Hide();
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window;
|
||||
if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate())
|
||||
{
|
||||
thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker);
|
||||
}
|
||||
thisWindow.colorPickerWindow.Show();
|
||||
});
|
||||
}).Start();
|
||||
|
||||
}
|
||||
|
||||
public static void Show()
|
||||
@@ -98,6 +108,7 @@ namespace GeekDesk.Control.Windows
|
||||
{
|
||||
window = new GlobalColorPickerWindow();
|
||||
}
|
||||
window.Opacity = 1;
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
}
|
||||
|
||||
@@ -141,10 +141,8 @@
|
||||
TextChanged="SearchBox_TextChanged"
|
||||
/>
|
||||
|
||||
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
||||
|
||||
<hc:NotifyIcon Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
||||
MouseRightButtonDown="BarIcon_MouseRightButtonDown"
|
||||
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<hc:NotifyIcon.ContextMenu>
|
||||
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
|
||||
@@ -158,8 +156,10 @@
|
||||
<MenuItem Header="退出" Click="ExitApp"/>
|
||||
</ContextMenu>
|
||||
</hc:NotifyIcon.ContextMenu>
|
||||
|
||||
</hc:NotifyIcon>
|
||||
|
||||
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
||||
|
||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -718,20 +718,10 @@ namespace GeekDesk
|
||||
/// <param name="e"></param>
|
||||
private void ColorPicker(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TaskbarContextMenu.Visibility = Visibility.Collapsed;
|
||||
App.DoEvents();
|
||||
TaskbarContextMenu.IsOpen = false;
|
||||
GlobalColorPickerWindow.CreateNoShow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 防止点击拾色器后无法显示菜单的问题
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void BarIcon_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
TaskbarContextMenu.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void Window_GotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -742,5 +732,6 @@ namespace GeekDesk
|
||||
{
|
||||
AppWindowLostFocus();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user