From: <sv...@op...> - 2024-07-25 20:45:57
|
Author: sagamusix Date: Thu Jul 25 22:45:45 2024 New Revision: 21289 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21289 Log: [Fix] Tree view: Remove keyboard focus if tree view is about to be hidden (https://bugs.openmpt.org/view.php?id=1802). Modified: trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Mainbar.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp Thu Jul 25 22:27:42 2024 (r21288) +++ trunk/OpenMPT/mptrack/Mainbar.cpp Thu Jul 25 22:45:45 2024 (r21289) @@ -1,7 +1,7 @@ /* * Mainbar.cpp * ----------- - * Purpose: Implementation of OpenMPT's window toolbar. + * Purpose: Implementation of OpenMPT's window toolbar and parent container of the tree view. * Notes : (currently none) * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. @@ -892,6 +892,14 @@ } +void CModTreeBar::DelayShow(BOOL show) +{ + if(!show && IsChild(GetFocus())) + CMainFrame::GetMainFrame()->SetFocus(); + CDialogBar::DelayShow(show); +} + + void CModTreeBar::RefreshDlsBanks() { if(m_pModTree) m_pModTree->RefreshDlsBanks(); Modified: trunk/OpenMPT/mptrack/Mainbar.h ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h Thu Jul 25 22:27:42 2024 (r21288) +++ trunk/OpenMPT/mptrack/Mainbar.h Thu Jul 25 22:45:45 2024 (r21289) @@ -1,7 +1,7 @@ /* * Mainbar.h * --------- - * Purpose: Implementation of OpenMPT's window toolbar. + * Purpose: Implementation of OpenMPT's window toolbar and parent container of the tree view. * Notes : (currently none) * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. @@ -156,6 +156,8 @@ CModTreeBar(); ~CModTreeBar() override; + void DelayShow(BOOL show) override; + public: void Init(); void RecalcLayout(); |