From ac30fe6b98cdb59de5cf7cc943af93db9ab6d39b Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 16 Aug 2023 16:55:36 +1000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=8A=E5=A4=A9=E6=A1=86?= =?UTF-8?q?=E6=89=93=E5=AD=97=E6=97=B6=E8=87=AA=E5=8A=A8=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/ToolBar.xaml.cs | 14 +++++++++++--- VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs | 12 ++++++++++++ .../WinDesign/TalkBoxAPI.xaml.cs | 12 ++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml.cs b/VPet-Simulator.Core/Display/ToolBar.xaml.cs index c7138de..9a85a23 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml.cs +++ b/VPet-Simulator.Core/Display/ToolBar.xaml.cs @@ -354,17 +354,25 @@ namespace VPet_Simulator.Core return FindResource("DangerProgressBarForeground") as Brush; } } - - private void MenuPanel_MouseEnter(object sender, MouseEventArgs e) + public void MenuPanel_MouseEnter() { BdrPanel.Visibility = Visibility.Visible; M_TimeUIHandle(m); } - private void MenuPanel_MouseLeave(object sender, MouseEventArgs e) + public void MenuPanel_MouseLeave() { closePanelTimer.Start(); } + private void MenuPanel_MouseEnter(object sender, MouseEventArgs e) + { + MenuPanel_MouseEnter(); + } + + private void MenuPanel_MouseLeave(object sender, MouseEventArgs e) + { + MenuPanel_MouseLeave(); + } public void Dispose() { diff --git a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs index ab22323..182ea5d 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs @@ -273,5 +273,17 @@ namespace VPet_Simulator.Windows lastopeningtime = DateTime.Now; Task.Run(TalkChatInfoDisplay); } + + private void tbTalk_TextChanged(object sender, TextChangedEventArgs e) + { + if (tbTalk.Text.Length > 0) + { + mw.Main.ToolBar.MenuPanel_MouseEnter(); + } + else + { + mw.Main.ToolBar.MenuPanel_MouseLeave(); + } + } } } diff --git a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs index da9d786..28c0adb 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs @@ -83,5 +83,17 @@ namespace VPet_Simulator.Windows e.Handled = true; } } + + private void tbTalk_TextChanged(object sender, TextChangedEventArgs e) + { + if (tbTalk.Text.Length > 0) + { + mw.Main.ToolBar.MenuPanel_MouseEnter(); + } + else + { + mw.Main.ToolBar.MenuPanel_MouseLeave(); + } + } } }