Skip to content

Commit

Permalink
Merge 42eab3c into ae0acbe
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Aug 27, 2018
2 parents ae0acbe + 42eab3c commit dcd29f4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/downloads/index.js
Expand Up @@ -40,7 +40,7 @@ var jsonData = { "versions": [
{ "change": "<strong>General:</strong> Clang code model related cleaning up (see issue <a href=\"https://github.com/opencor/opencor/issues/1747\">#1747</a>). Allow the use of another Qt style (see issue <a href=\"https://github.com/opencor/opencor/issues/1761\">#1761</a>). Improved HiDPI support (see issue <a href=\"https://github.com/opencor/opencor/issues/1763\">#1763</a>)." },
{ "change": "<strong>Graph Panel widget:</strong> only reset axes when needed (see issue <a href=\"https://github.com/opencor/opencor/issues/1777\">#1777</a>). Added support for pinch gestures (see issue <a href=\"https://github.com/opencor/opencor/issues/1783\">#1783</a>)." },
{ "change": "<strong>Core plugin:</strong> fixed a problem with the menu items for recently opened files potentially appearing as disabled on macOS (see issue <a href=\"https://github.com/opencor/opencor/issues/1633\">#1633</a>)." },
{ "change": "<strong>Simulation Experiment view:</strong> added some basic preferences for graph panels and graphs (see issue <a href=\"https://github.com/opencor/opencor/issues/1772\">#1772</a>)." },
{ "change": "<strong>Simulation Experiment view:</strong> added some basic preferences for graph panels and graphs (see issue <a href=\"https://github.com/opencor/opencor/issues/1772\">#1772</a>). Fixed an issue with the loading/reloading of a SED-ML file / COMBINE archive potentially resulting in some legends being hidden / of the wrong width (see issue <a href=\"https://github.com/opencor/opencor/issues/1786\">#1786</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded the <a href=\"http://computation.llnl.gov/projects/sundials\">SUNDIALS</a> library to version 3.1.2 (see issue <a href=\"https://github.com/opencor/opencor/issues/1743\">#1743</a>). Renamed our BioSignalML plugin to libBioSignalML (see issue <a href=\"https://github.com/opencor/opencor/issues/1754\">#1754</a>). Upgraded <a href=\"https://www.openssl.org/\">OpenSSL</a> to version 1.0.2p (see issue <a href=\"https://github.com/opencor/opencor/issues/1767\">#1767</a>)." }
]
},
Expand Down
Expand Up @@ -3098,7 +3098,7 @@ bool SimulationExperimentViewSimulationWidget::furtherInitialize()

graphPanelsWidget->setActiveGraphPanel(graphPanelsWidget->graphPanels().first());

// Initialise our trackers, so we know if a SED-ML file or COMBINE archive
// Initialise our trackers, so we know if a SED-ML file or a COMBINE archive
// has been modified

initializeTrackers();
Expand Down
33 changes: 33 additions & 0 deletions src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp
Expand Up @@ -1570,6 +1570,15 @@ GraphPanelPlotWidget::GraphPanelPlotWidget(const GraphPanelPlotWidgets &pNeighbo
mContextMenu->addSeparator();
mContextMenu->addAction(mResetZoomAction);

// Set our axes' values
// Note: we are not all initialised yet, so we don't want setAxes() to
// replot ourselves...

setAxes(DefaultMinAxis, DefaultMaxAxis, DefaultMinAxis, DefaultMaxAxis,
false, false, false, true, false, false);

mDirtyAxes = false;

// We want our legend to be active by default

setLegendActive(true);
Expand Down Expand Up @@ -2885,6 +2894,16 @@ void GraphPanelPlotWidget::setTitleAxis(int pAxisId, const QString &pTitleAxis)

void GraphPanelPlotWidget::doUpdateGui()
{
// Only update our GUI, if we (or one of our neighbours) are not already
// updating it

static bool canUpdateGui = true;

if (!canUpdateGui)
return;

canUpdateGui = false;

// Resize our legend and that of our neighbours

GraphPanelPlotWidgets selfPlusNeighbors = GraphPanelPlotWidgets() << this << mNeighbors;
Expand All @@ -2909,6 +2928,20 @@ void GraphPanelPlotWidget::doUpdateGui()
legendWidth);
}

// Small hack to force ourselves (and our neighbours) to resize

foreach (GraphPanelPlotWidget *plot, selfPlusNeighbors) {
plot->setUpdatesEnabled(false);
int plotWidth = plot->width();
int plotHeight = plot->height();

plot->resize(plotWidth+1, plotHeight+1);
plot->resize(plotWidth, plotHeight);
plot->setUpdatesEnabled(true);
}

canUpdateGui = true;

// Reenable updates for our legend
// Note: see addGraph() for the reasoning behind it...

Expand Down
Expand Up @@ -641,10 +641,9 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,
void logarithmicXAxisToggled();
void logarithmicYAxisToggled();

public slots:
private slots:
void doUpdateGui();

private slots:
void cannotUpdateActions();

void exportTo();
Expand Down

0 comments on commit dcd29f4

Please sign in to comment.