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