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/3053

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/53/3053/1

Fix template manager item selection behaviour with mouse.

Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
---
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 2ba5ea6..62d4670 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -605,15 +605,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);
                 }
@@ -622,13 +629,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/3053
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: 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.