From 40848f141a3ef1a0edfd1b3802481ac9a8ea94fd Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 24 Jun 2015 00:01:33 +0200 Subject: [PATCH] Make room for scale on scope display --- sdrbase/gui/glscope.cpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/sdrbase/gui/glscope.cpp b/sdrbase/gui/glscope.cpp index 6e56aa219..1be4d9e15 100644 --- a/sdrbase/gui/glscope.cpp +++ b/sdrbase/gui/glscope.cpp @@ -452,31 +452,38 @@ void GLScope::applyConfig() { m_configChanged = false; + int topMargin = 5; + int botMargin = 20; + int leftMargin = 20; + int rightMargin = 5; + + // QRectF(x, y, w, h); (x, y) = top left corner + if(m_orientation == Qt::Vertical) { m_glScopeRect1 = QRectF( - (float)10 / (float)width(), - (float)10 / (float)height(), - (float)(width() - 10 - 10) / (float)width(), - (float)((height() - 10 - 10 - 10) / 2) / (float)height() + (float)leftMargin / (float)width(), + (float)topMargin / (float)height(), + (float)(width() - leftMargin - rightMargin) / (float)width(), + (float)((height() - botMargin - botMargin - topMargin) / 2) / (float)height() ); m_glScopeRect2 = QRectF( - (float)10 / (float)width(), - (float)(10 + 10 + (height() - 10 - 10 - 10) / 2) / (float)height(), - (float)(width() - 10 - 10) / (float)width(), - (float)((height() - 10 - 10 - 10) / 2) / (float)height() + (float)leftMargin / (float)width(), + (float)(botMargin + topMargin + (height() - botMargin - botMargin - topMargin) / 2) / (float)height(), + (float)(width() - leftMargin - rightMargin) / (float)width(), + (float)((height() - botMargin - botMargin - topMargin) / 2) / (float)height() ); } else { m_glScopeRect1 = QRectF( - (float)10 / (float)width(), - (float)10 / (float)height(), - (float)((width() - 10 - 10 - 10) / 2) / (float)width(), - (float)(height() - 10 - 10) / (float)height() + (float)leftMargin / (float)width(), + (float)topMargin / (float)height(), + (float)((width() - leftMargin - leftMargin - rightMargin) / 2) / (float)width(), + (float)(height() - topMargin - botMargin) / (float)height() ); m_glScopeRect2 = QRectF( - (float)(10 + 10 + ((width() - 10 - 10 - 10) / 2)) / (float)width(), - (float)10 / (float)height(), - (float)((width() - 10 - 10 - 10) / 2) / (float)width(), - (float)(height() - 10 - 10) / (float)height() + (float)(leftMargin + leftMargin + ((width() - leftMargin - leftMargin - rightMargin) / 2)) / (float)width(), + (float)topMargin / (float)height(), + (float)((width() - leftMargin - leftMargin - rightMargin) / 2) / (float)width(), + (float)(height() - topMargin - botMargin) / (float)height() ); } }