Skip to content

Commit

Permalink
Merge pull request #45 from BookerLiu/2.4.16
Browse files Browse the repository at this point in the history
2.4.16
  • Loading branch information
BookerLiu committed May 27, 2022
2 parents efb8c53 + f868eb7 commit d72ea7a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
2 changes: 1 addition & 1 deletion App.config
Expand Up @@ -49,7 +49,7 @@
</assemblyBinding>
</runtime>
<appSettings>
<add key="Version" value="2.4.15" />
<add key="Version" value="2.4.16" />
<add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
<add key="GiteeUrl" value="https://gitee.com/BookerLiu/GeekDesk/tree/master" />
<add key="GitHubUpdateUrl" value="https://raw.githubusercontent.com/BookerLiu/GeekDesk/master/Update.json" />
Expand Down
7 changes: 5 additions & 2 deletions Control/UserControls/PannelCard/LeftCardControl.xaml.cs
Expand Up @@ -25,7 +25,7 @@ public partial class LeftCardControl : UserControl


//是否正在修改菜单
private static bool IS_EDIT = false;
public bool IS_EDIT = false;

public LeftCardControl()
{
Expand Down Expand Up @@ -205,9 +205,9 @@ private void CreateMenu(object sender, RoutedEventArgs e)
/// <param name="e"></param>
private void RenameMenu(object sender, RoutedEventArgs e)
{
IS_EDIT = true;
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
menuInfo.MenuEdit = (int)Visibility.Visible;
IS_EDIT = true;
}

/// <summary>
Expand Down Expand Up @@ -276,6 +276,8 @@ private void LostFocusOrEnterDown(object sender, EventArgs e)
menuInfo.MenuEdit = Visibility.Collapsed;
}
IS_EDIT = false;
//为了解决无法修改菜单的问题
MainWindow.mainWindow.SearchBox.Focus();
MenuListBox.SelectedIndex = menuSelectIndexTemp;
}
}
Expand Down Expand Up @@ -309,6 +311,7 @@ private void EditMenuGeometry(object sender, RoutedEventArgs e)

private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (IS_EDIT) return;
//设置对应菜单的图标列表
if (MenuListBox.SelectedIndex == -1)
{
Expand Down
21 changes: 16 additions & 5 deletions Control/Windows/GlobalColorPickerWindow.xaml.cs
Expand Up @@ -81,15 +81,25 @@ public static void CreateNoShow()
if (window == null || !window.Activate())
{
window = new GlobalColorPickerWindow();
window.Opacity = 0;
App.DoEvents();
window.Show();
}
window.Hide();
GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window;
if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate())
new Thread(() =>
{
thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker);
}
thisWindow.colorPickerWindow.Show();
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()
Expand All @@ -98,6 +108,7 @@ public static void Show()
{
window = new GlobalColorPickerWindow();
}
window.Opacity = 1;
window.Show();
Keyboard.Focus(window);
}
Expand Down
12 changes: 6 additions & 6 deletions MainWindow.xaml
Expand Up @@ -125,7 +125,7 @@
</DockPanel>


<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>

<!--分割线-->
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
Expand All @@ -141,11 +141,9 @@
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 Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
<hc:NotifyIcon.ContextMenu>
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
<MenuItem Header="打开面板" Click="ShowApp"/>
Expand All @@ -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>
Expand Down
20 changes: 8 additions & 12 deletions MainWindow.xaml.cs
@@ -1,5 +1,6 @@
using GeekDesk.Constant;
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Control.UserControls.PannelCard;
using GeekDesk.Control.Windows;
using GeekDesk.Interface;
using GeekDesk.MyThread;
Expand Down Expand Up @@ -718,29 +719,24 @@ private void MainWindow_MouseEnter(object sender, MouseEventArgs e)
/// <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)
{
Keyboard.Focus(SearchBox);
if (!LeftCard.IS_EDIT)
{
//if判断是为了能够使修改菜单时 菜单能够获得焦点
Keyboard.Focus(SearchBox);
}
}

private void AppWindow_Deactivated(object sender, EventArgs e)
{
AppWindowLostFocus();
}

}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Expand Up @@ -49,5 +49,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.1.5")]
[assembly: AssemblyFileVersion("2.4.1.5")]
[assembly: AssemblyVersion("2.4.1.6")]
[assembly: AssemblyFileVersion("2.4.1.6")]

0 comments on commit d72ea7a

Please sign in to comment.