Showing with 23 additions and 12 deletions.
  1. +1 −0 src/libkst/vector.cpp
  2. +11 −0 src/libkstapp/plotitem.cpp
  3. +7 −0 src/libkstapp/plotitem.h
  4. +4 −10 src/libkstapp/plotrenderitem.cpp
  5. +0 −2 src/libkstapp/plotrenderitem.h
1 change: 1 addition & 0 deletions src/libkst/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ bool Vector::resize(int sz, bool init) {
}
}
_size = sz;
_v_out = _v_raw;
updateScalars();
}
return true;
Expand Down
11 changes: 11 additions & 0 deletions src/libkstapp/plotitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@ void PlotItem::createActions() {
connect(_copyYCoord, SIGNAL(triggered()), this, SLOT(copyYCoord()));

createCopyMenu();

referenceMode = new QAction(tr("Place Reference Marker"), this);
referenceMode->setShortcut(Qt::Key_C);
registerShortcut(referenceMode);

referenceModeDisabled = new QAction(tr("Remove Reference Marker"), this);
referenceModeDisabled->setShortcut(Qt::SHIFT + Qt::Key_C);
registerShortcut(referenceModeDisabled);

}

void PlotItem::createCopyMenu() {
Expand Down Expand Up @@ -740,6 +749,8 @@ void PlotItem::addToMenuForContextEvent(QMenu &menu) {
_plotMaximize->setChecked(_plotMaximized);
menu.addSeparator();
menu.addAction(_plotMaximize);
menu.addAction(referenceMode);
menu.addAction(referenceModeDisabled);
}

_zoomLogX->setChecked(xAxis()->axisLog());
Expand Down
7 changes: 7 additions & 0 deletions src/libkstapp/plotitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,13 @@ class PlotItem : public ViewItem, public PlotItemInterface
friend class ZoomYLocalMaximumCommand;
friend class ZoomYMaximumCommand;
friend class ViewGridLayout;

protected:
QAction *referenceMode;
QAction *referenceModeDisabled;

friend class PlotRenderItem;

};

class CreatePlotCommand : public CreateCommand
Expand Down
14 changes: 4 additions & 10 deletions src/libkstapp/plotrenderitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,14 @@ PlotRenderItem::PlotRenderItem(PlotItem *parentItem)
this, SLOT(updateGeometry()));
connect(parentItem->view(), SIGNAL(viewModeChanged(View::ViewMode)),
this, SLOT(updateViewMode()));
connect(parentItem->referenceModeDisabled, SIGNAL(triggered()),
this, SLOT(referenceModeDisabled()));
connect(parentItem->referenceMode, SIGNAL(triggered()),
this, SLOT(referenceMode()));

updateGeometry(); //the initial rect
updateViewMode(); //the initial view

_referenceMode = new QAction(tr("Reference Mode"), this);
_referenceMode->setShortcut(Qt::Key_C);
registerShortcut(_referenceMode);
connect(_referenceMode, SIGNAL(triggered()), this, SLOT(referenceMode()));

_referenceModeDisabled = new QAction(tr("Reference Mode"), this);
_referenceModeDisabled->setShortcut(Qt::SHIFT + Qt::Key_C);
registerShortcut(_referenceModeDisabled);
connect(_referenceModeDisabled, SIGNAL(triggered()), this, SLOT(referenceModeDisabled()));

disconnect(this, SIGNAL(geometryChanged()), view(), SLOT(viewChanged()));
}

Expand Down
2 changes: 0 additions & 2 deletions src/libkstapp/plotrenderitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ class PlotRenderItem : public ViewItem
bool _highlightPointActive;
bool _invertHighlight;
QPointF _highlightPoint;
QAction *_referenceMode;
QAction *_referenceModeDisabled;

RelationList _relationList;
SelectionRect _selectionRect;
Expand Down