Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jan 13, 2020
1 parent 292c892 commit 302700f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
27 changes: 12 additions & 15 deletions src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp
Expand Up @@ -1575,7 +1575,7 @@ GraphPanelPlotWidget::GraphPanelPlotWidget(const GraphPanelPlotWidgets &pNeighbo

setAutoFillBackground(true);
setBackgroundColor(Qt::white);
setFontSize(10, true); //---ISSUE2271--- IS THAT REALLY NEEDED?...
setFontSize(10);
setForegroundColor(Qt::black);

QColor pointCoordinatesColor = Qt::darkCyan;
Expand Down Expand Up @@ -1618,8 +1618,8 @@ GraphPanelPlotWidget::GraphPanelPlotWidget(const GraphPanelPlotWidgets &pNeighbo
setAxisAutoScale(QwtPlot::xBottom, false);
setAxisAutoScale(QwtPlot::yLeft, false);

setFontSizeAxisX(10, true); //---ISSUE2271--- IS THAT REALLY NEEDED?...
setFontSizeAxisY(10, true); //---ISSUE2271--- IS THAT REALLY NEEDED?...
setFontSizeAxisX(10);
setFontSizeAxisY(10);

// Attach a grid to ourselves

Expand All @@ -1638,7 +1638,7 @@ GraphPanelPlotWidget::GraphPanelPlotWidget(const GraphPanelPlotWidgets &pNeighbo

insertLegend(mLegend);

setLegendFontSize(10, true); //---ISSUE2271--- IS THAT REALLY NEEDED?...
setLegendFontSize(10);

connect(mLegend, &GraphPanelPlotLegendWidget::graphToggled,
this, &GraphPanelPlotWidget::graphToggled);
Expand Down Expand Up @@ -2096,11 +2096,11 @@ int GraphPanelPlotWidget::fontSize() const

//==============================================================================

void GraphPanelPlotWidget::setFontSize(int pFontSize, bool pForceSetting)
void GraphPanelPlotWidget::setFontSize(int pFontSize)
{
// Set our font size

if (pForceSetting || (pFontSize != fontSize())) {
if (pFontSize != fontSize()) {
QFont newFont = font();

newFont.setPointSize(pFontSize);
Expand Down Expand Up @@ -2228,12 +2228,11 @@ int GraphPanelPlotWidget::legendFontSize() const

//==============================================================================

void GraphPanelPlotWidget::setLegendFontSize(int pLegendFontSize,
bool pForceSetting)
void GraphPanelPlotWidget::setLegendFontSize(int pLegendFontSize)
{
// Set our legend font size

if (pForceSetting || (pLegendFontSize != legendFontSize())) {
if (pLegendFontSize != legendFontSize()) {
mLegend->setFontSize(pLegendFontSize);

// To change the font size of our legen may have some effects on the
Expand Down Expand Up @@ -2482,12 +2481,11 @@ int GraphPanelPlotWidget::fontSizeAxisX() const

//==============================================================================

void GraphPanelPlotWidget::setFontSizeAxisX(int pFontSizeAxisX,
bool pForceSetting)
void GraphPanelPlotWidget::setFontSizeAxisX(int pFontSizeAxisX)
{
// Set our X axis font size

if (pForceSetting || (pFontSizeAxisX != fontSizeAxisX())) {
if (pFontSizeAxisX != fontSizeAxisX()) {
QFont fontAxisX = axisFont(QwtPlot::xBottom);

fontAxisX.setPointSize(pFontSizeAxisX);
Expand Down Expand Up @@ -2556,12 +2554,11 @@ int GraphPanelPlotWidget::fontSizeAxisY() const

//==============================================================================

void GraphPanelPlotWidget::setFontSizeAxisY(int pFontSizeAxisY,
bool pForceSetting)
void GraphPanelPlotWidget::setFontSizeAxisY(int pFontSizeAxisY)
{
// Set our Y axis font size

if (pForceSetting || (pFontSizeAxisY != fontSizeAxisY())) {
if (pFontSizeAxisY != fontSizeAxisY()) {
QFont fontAxisY = axisFont(QwtPlot::yLeft);

fontAxisY.setPointSize(pFontSizeAxisY);
Expand Down
Expand Up @@ -434,7 +434,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,
void setBackgroundColor(const QColor &pBackgroundColor);

int fontSize() const;
void setFontSize(int pFontSize, bool pForceSetting = false);
void setFontSize(int pFontSize);

QColor foregroundColor() const;
void setForegroundColor(const QColor &pForegroundColor);
Expand All @@ -449,7 +449,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,
void setGridLinesColor(const QColor &pGridLinesColor);

int legendFontSize() const;
void setLegendFontSize(int pLegendFontSize, bool pForceSetting = false);
void setLegendFontSize(int pLegendFontSize);

bool isLegendVisible() const;
void setLegendVisible(bool pLegendVisible);
Expand Down Expand Up @@ -478,7 +478,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,
void setTitle(const QString &pTitle);

int fontSizeAxisX() const;
void setFontSizeAxisX(int pFontSizeAxisX, bool pForceSetting = false);
void setFontSizeAxisX(int pFontSizeAxisX);

bool logAxisX() const;
void setLogAxisX(bool pLogAxisX);
Expand All @@ -487,7 +487,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,
void setTitleAxisX(const QString &pTitleAxisX);

int fontSizeAxisY() const;
void setFontSizeAxisY(int pFontSizeAxisY, bool pForceSetting = false);
void setFontSizeAxisY(int pFontSizeAxisY);

bool logAxisY() const;
void setLogAxisY(bool pLogAxisY);
Expand Down

0 comments on commit 302700f

Please sign in to comment.