View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015477 | Scribus | Canvas | public | 2018-11-07 03:20 | 2019-06-04 20:56 |
Reporter | Gibbz | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.4 | ||||
Fixed in Version | 1.5.5.svn | ||||
Summary | 0015477: Add Alt selection mode | ||||
Description | I have made a patch which adds and Alt modifier key to the selection mode. This method will uses intersecting rectangle instead of the standard contains rectangle. Really useful to save zooming in and out of the page to select large items. | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
modifier_key.patch (1,974 bytes)
diff --git a/scribus/canvasmode_normal.cpp b/scribus/canvasmode_normal.cpp index 7ec28b361..7ae9524c8 100644 --- a/scribus/canvasmode_normal.cpp +++ b/scribus/canvasmode_normal.cpp @@ -1173,16 +1173,34 @@ void CanvasMode_Normal::mouseReleaseEvent(QMouseEvent *m) if (docItemCount != 0) { m_doc->m_Selection->delaySignalsOn(); + // loop over all items and select + bool alt_pressed = m->modifiers() & Qt::AltModifier; + bool shift_pressed = 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))) + if (((docItem->LayerID == m_doc->activeLayer()) || (m_doc->layerSelectable(docItem->LayerID))) && (!m_doc->layerLocked(docItem->LayerID))) { bool redrawSelection=false; - m_view->SelectItemNr(a, redrawSelection); + bool select = false; + + // alt modifier + // intersects rectangle + if (alt_pressed){ + select = localSele.intersects(apr2); + } + // contains rectangle + // no modifiers/default + else { + select = localSele.contains(apr2); + } + + if (select) + m_view->SelectItemNr(a, redrawSelection); } } m_doc->m_Selection->delaySignalsOff(); diff --git a/scribus/iconmanager.cpp b/scribus/iconmanager.cpp index 83fd11025..db4718da5 100644 --- a/scribus/iconmanager.cpp +++ b/scribus/iconmanager.cpp @@ -54,7 +54,7 @@ bool IconManager::setup() if (!initIcons()) { qDebug()<<"No icons found :("; - return false; + //return false; } return true; } |
|
Committed with some cosmetic modifications. Thanks! |
|
Hi Gibbz and Jean. What does this patch do? |
|
peter, currently, only the items which are completely in the selection area are indeed selected. with this patch, when you press the alt key, all the items that are at least touched by the selection area will be selected. for me, not 100% a necessary feature in dtp (while it's more useful in vector graphics)... but nice to have : - ) |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-11-07 03:20 | Gibbz | New Issue | |
2018-11-07 03:20 | Gibbz | File Added: modifier_key.patch | |
2018-11-07 23:50 | jghali | Summary | [Patch] Add Alt Selection mode => Add Alt selection mode |
2018-11-07 23:51 | jghali | Assigned To | => jghali |
2018-11-07 23:51 | jghali | Status | new => resolved |
2018-11-07 23:51 | jghali | Resolution | open => fixed |
2018-11-07 23:51 | jghali | Fixed in Version | => 1.5.5.svn |
2018-11-07 23:51 | jghali | Note Added: 0045589 | |
2018-11-09 07:34 | PeterBenedek | Note Added: 0045599 | |
2018-11-09 15:21 | ale | Note Added: 0045600 | |
2019-06-04 20:56 | cbradney | Status | resolved => closed |