Skip to content

Commit

Permalink
Improve the user interactions over plot: zooming and range dragging.
Browse files Browse the repository at this point in the history
The rectangle selection is no longer possible. Control+click can be used
for selecting a range of items.

This allows more freedom for performing customisations as requested in
issue "Change axis limits #838".

The "Load all data" button tool-tip and icon have been readjusted so they
hint the additional use pattern of resetting the plot to the original
zoom and range limits.

New and more appropriate icon for the "Save Plot" button. Icon from the
Silk set from famfamfam.com.
  • Loading branch information
mgrojo committed Dec 2, 2017
1 parent bbe460c commit cef1e90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/PlotDock.cpp
Expand Up @@ -197,8 +197,10 @@ void PlotDock::updatePlot(SqliteTableModel* model, BrowseDataTableSettings* sett

graph->setPen(QPen(item->backgroundColor(PlotColumnY)));
graph->setSelectable (QCP::stDataRange);
ui->plotWidget->setInteractions(QCP::iSelectPlottables);
ui->plotWidget->setSelectionRectMode(QCP::srmSelect);
// Enable: click on items to select them, Ctrl+Click for multi-selection, mouse-wheel for zooming and mouse drag for
// changing the visible range.
ui->plotWidget->setInteractions(QCP::iSelectPlottables | QCP::iMultiSelect | QCP::iRangeZoom | QCP::iRangeDrag);
ui->plotWidget->setSelectionRectMode(QCP::srmNone);

// prepare the data vectors for qcustomplot
// possible improvement might be a QVector subclass that directly
Expand Down
7 changes: 4 additions & 3 deletions src/PlotDock.ui
Expand Up @@ -246,7 +246,7 @@
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/save_table</normaloff>:/icons/save_table</iconset>
<normaloff>:/icons/image_save</normaloff>:/icons/image_save</iconset>
</property>
<property name="checkable">
<bool>false</bool>
Expand All @@ -265,11 +265,12 @@
<item>
<widget class="QToolButton" name="buttonLoadAllData">
<property name="toolTip">
<string>Load all data. This has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
<string>Load all data and redraw plot.
Data loading has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/keyword</normaloff>:/icons/keyword</iconset>
<normaloff>:/icons/refresh</normaloff>:/icons/refresh</iconset>
</property>
</widget>
</item>
Expand Down
1 change: 1 addition & 0 deletions src/icons/icons.qrc
Expand Up @@ -61,5 +61,6 @@
<file alias="close">cross.png</file>
<file alias="special_copy">page_white_copy.png</file>
<file alias="text_replace">text_replace.png</file>
<file alias="image_save">picture_save.png</file>
</qresource>
</RCC>
Binary file added src/icons/picture_save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cef1e90

Please sign in to comment.