Skip to content

Commit

Permalink
Place 'c', plot marker mode, in contect menu.
Browse files Browse the repository at this point in the history
This way, it will possible to discover.
  • Loading branch information
netterfield committed May 3, 2016
1 parent 9ed4859 commit 4727220
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
11 changes: 11 additions & 0 deletions src/libkstapp/plotitem.cpp
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
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
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
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

0 comments on commit 4727220

Please sign in to comment.