#4341 Make docked plots follow font size preferences (but subtract 1 in point size)

* The docked plots have much less space available than most plots
This commit is contained in:
Gaute Lindkvist
2019-04-15 15:01:58 +02:00
parent 93f76d9739
commit edf46496b7
15 changed files with 193 additions and 17 deletions

View File

@@ -19,7 +19,9 @@
#include "RiuResultQwtPlot.h"
#include "RiaApplication.h"
#include "RiaCurveDataTools.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
#include "RimContextCommandBuilder.h"
@@ -50,7 +52,7 @@
///
//--------------------------------------------------------------------------------------------------
RiuResultQwtPlot::RiuResultQwtPlot(QWidget* parent)
: QwtPlot(parent)
: RiuDockedQwtPlot(parent)
{
setDefaults();
}
@@ -84,6 +86,7 @@ void RiuResultQwtPlot::addCurve(const RimCase* rimCase, const QString& curveName
m_plotCurves.push_back(plotCurve);
this->setAxisScale( QwtPlot::xTop, QwtDate::toDouble(dateTimes.front()), QwtDate::toDouble(dateTimes.back()));
this->applyFontSizes(false);
this->replot();
@@ -185,6 +188,8 @@ void RiuResultQwtPlot::setDefaults()
setAxisMaxMinor(QwtPlot::xBottom, 2);
setAxisMaxMinor(QwtPlot::yLeft, 3);
applyFontSizes(false);
// The legend will be deleted in the destructor of the plot or when
// another legend is inserted.
QwtLegend* legend = new QwtLegend(this);