[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - vcl/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 20 03:29:07 UTC 2019


 vcl/source/window/toolbox.cxx |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

New commits:
commit a42bc2e56f935bb3caa22bd3f6ff27720939cb29
Author:     Jim Raykowski <raykowj at gmail..com>
AuthorDate: Tue Oct 22 18:24:07 2019 -0800
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Dec 20 04:28:23 2019 +0100

    tdf#127552 Make toolbox highlighting behave as intended
    
    This patch provides intended highlight behavior to my understanding of
    comments found in the toolbox source code.
    
     *only highlight when the focus is not inside a child window of a
    toolbox eg, in an edit control
     *do not highlight when focus is in a different toolbox
     *only clear highlight when focus is not in toolbar
    
    Change-Id: Ia18d35c4255ed0940bce5f0c6d9448ed2c85c6fe
    Reviewed-on: https://gerrit.libreoffice.org/81356
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>
    (cherry picked from commit 800b6f095f95ccfb8a7ba9755292332bf97f97ad)
    Reviewed-on: https://gerrit.libreoffice.org/83446
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 7d0f56c9e804..3b0d6b5a5f7e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3068,8 +3068,24 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
     // eg, in an edit control
     // and do not highlight when focus is in a different toolbox
     bool bDrawHotSpot = true;
-    vcl::Window *pWin = Application::GetFocusWindow();
-    if( pWin && pWin->ImplGetWindowImpl()->mbToolBox && pWin != this )
+    vcl::Window *pFocusWin = Application::GetFocusWindow();
+
+    bool bFocusWindowIsAToolBoxChild = false;
+    if (pFocusWin)
+    {
+        vcl::Window *pWin = pFocusWin->GetParent();
+        while (pWin)
+        {
+            if(pWin->ImplGetWindowImpl()->mbToolBox)
+            {
+                bFocusWindowIsAToolBoxChild = true;
+                break;
+            }
+            pWin = pWin->GetParent();
+        }
+    }
+
+    if( bFocusWindowIsAToolBoxChild || (pFocusWin && pFocusWin->ImplGetWindowImpl()->mbToolBox && pFocusWin != this) )
         bDrawHotSpot = false;
 
     if ( mbSelection && bDrawHotSpot )
@@ -3204,7 +3220,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
 
         // only clear highlight when focus is not in toolbar
         bool bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos ) && ImplHasClippedItems();
-        if ( bClearHigh || bMenuButtonHit )
+        if ( !HasFocus() && (bClearHigh || bMenuButtonHit) )
         {
             if ( !bMenuButtonHit && mpData->mbMenubuttonSelected )
             {


More information about the Libreoffice-commits mailing list