Quellcode durchsuchen

UI-调整顶部菜单栏显示逻辑

ZhouJieSheng vor 1 Jahr
Ursprung
Commit
563fe15873
1 geänderte Dateien mit 16 neuen und 11 gelöschten Zeilen
  1. 16 11
      PDF Office/Views/ViewContent.xaml.cs

+ 16 - 11
PDF Office/Views/ViewContent.xaml.cs

@@ -456,10 +456,12 @@ namespace PDF_Master.Views
 
             //默认展开子工具栏
             //单击工具栏工具展开子工具栏;再次单击工具栏工具则收起子工具栏
-            if (item.IsSelected)
+            if (item.IsSelected&&item.Name!= "TabItemPageEdit")
             {
                 expandToolRow = !expandToolRow;
                 ToolRow.Height = expandToolRow ? new GridLength(40) : new GridLength(0);
+                //取消选中
+                item.IsSelected = false;
             }
             else
             {
@@ -468,20 +470,23 @@ namespace PDF_Master.Views
                     //点击其他菜单栏时,之前为折叠状态时,自动展开
                     expandToolRow = !expandToolRow;
                     ToolRow.Height = new GridLength(40);
-                }
+                }
+                //取消选中
+                item.IsSelected = true;
             }
         }
 
         private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
         {
-            if ((bool)e.NewValue)
-            {
-                //显示后自动聚焦,解决切换页签或者刚打开后直接按快捷键没响应的问题
-                System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
-                {
-                    ToolTabControl.Focus();
-                }));
-            }
+            //疑似无效事件,暂时注释掉,上线前确认没问题后删除
+            //if ((bool)e.NewValue)
+            //{
+            //    //显示后自动聚焦,解决切换页签或者刚打开后直接按快捷键没响应的问题
+            //    System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+            //    {
+            //        ToolTabControl.Focus();
+            //    }));
+            //}
         }
 
         private void AddTabCommand_Executed(object sender, ExecutedRoutedEventArgs e)
@@ -502,7 +507,7 @@ namespace PDF_Master.Views
                 viewModel.bottom?.NextViewCommnad.Execute();
             }
             else if (e.ChangedButton == MouseButton.XButton1)
-            {
+            {
                 viewModel.bottom?.PreViewCommand.Execute();
             }
         }