Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3090

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/90/3090/1

Fix template manager item selection behaviour with mouse.

Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
(cherry picked from commit 28d5ced7f9982257d263ffc3e550bd479a9542f8)
---
M sfx2/source/control/thumbnailview.cxx
1 file changed, 14 insertions(+), 9 deletions(-)



diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b3b1251..8b2840d 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -609,15 +609,22 @@
         {
             if ( rMEvt.GetClicks() == 1 )
             {
-                if (pItem->isSelected() && rMEvt.IsMod1())
-                    pItem->setSelection(false);
+                if (rMEvt.IsMod1())
+                {
+                    //Keep selected item group state and just invert current desired one state
+                    pItem->setSelection(!pItem->isSelected());
+                }
                 else
                 {
-                    if (!pItem->isSelected() && !rMEvt.IsMod1())
-                        deselectItems( );
-
+                    //If we got a group of selected items deselect the rest and only keep the 
desired one
+                    //mark items as not selected to not fire unnecessary change state events.
+                    pItem->setSelection(false);
+                    deselectItems();
                     pItem->setSelection(true);
+                }
 
+                if (pItem->isSelected())
+                {
                     bool bClickOnTitle = pItem->getTextArea().IsInside(rMEvt.GetPosPixel());
                     pItem->setEditTitle(bClickOnTitle);
                 }
@@ -626,13 +633,11 @@
                     DrawItem(pItem);
 
                 maItemStateHdl.Call(pItem);
+
+                //fire accessible event??
             }
             else if ( rMEvt.GetClicks() == 2 )
             {
-                // The mouse button down event 1 click right before is pointless
-                pItem->setSelection(false);
-                maItemStateHdl.Call(pItem);
-
                 Rectangle aRect(pItem->getDrawArea());
 
                 if (aRect.IsInside(rMEvt.GetPosPixel()))

-- 
To view, visit https://gerrit.libreoffice.org/3090
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Gerrit-Reviewer: Rafael Dominguez <venccsralph@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.