r22754 by jghali - #15477: Add Alt selection mode
scribus-commit
scribus-commit at lists.scribus.net
Wed Nov 7 23:50:27 UTC 2018
Author: jghali
Date: Wed Nov 7 23:50:27 2018
New Revision: 22754
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22754
Log:
#15477: Add Alt selection mode
Modified:
trunk/Scribus/scribus/canvasmode_normal.cpp
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22754&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Wed Nov 7 23:50:27 2018
@@ -1173,16 +1173,23 @@
if (docItemCount != 0)
{
m_doc->m_Selection->delaySignalsOn();
+ // loop over all items and select
+ bool altPressed = m->modifiers() & Qt::AltModifier;
+ bool shiftPressed = m->modifiers() & Qt::ShiftModifier;
+
for (int a = 0; a < docItemCount; ++a)
{
PageItem* docItem = m_doc->Items->at(a);
if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
continue;
QRect apr2 = m_canvas->canvasToLocal( docItem->getCurrentBoundingRect(docItem->lineWidth()) );
- if ((localSele.contains(apr2)) && ((docItem->LayerID == m_doc->activeLayer()) || (m_doc->layerSelectable(docItem->LayerID))) && (!m_doc->layerLocked(docItem->LayerID)))
- {
- bool redrawSelection=false;
- m_view->SelectItemNr(a, redrawSelection);
+ if (((docItem->LayerID == m_doc->activeLayer()) || (m_doc->layerSelectable(docItem->LayerID))) && (!m_doc->layerLocked(docItem->LayerID)))
+ {
+ bool redrawSelection = false;
+ bool select = altPressed ? localSele.intersects(apr2) :
+ localSele.contains(apr2);
+ if (select)
+ m_view->SelectItemNr(a, redrawSelection);
}
}
m_doc->m_Selection->delaySignalsOff();
More information about the scribus-commit
mailing list