[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source
Rafael Dominguez
venccsralph at gmail.com
Thu Mar 28 05:23:59 PDT 2013
sfx2/source/control/thumbnailview.cxx | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
New commits:
commit 82a320dbb30e843ef5e69ec82be7179a8fba28bc
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Mon Mar 25 22:32:32 2013 -0430
Fix template manager item selection behaviour with mouse.
Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
(cherry picked from commit 28d5ced7f9982257d263ffc3e550bd479a9542f8)
Reviewed-on: https://gerrit.libreoffice.org/3090
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
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 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
{
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 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
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()))
More information about the Libreoffice-commits
mailing list