1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 13:51:47 -05:00

Make room for scale on scope display

This commit is contained in:
f4exb 2015-06-24 00:01:33 +02:00
parent b7ed6bd0ce
commit 40848f141a

View File

@ -452,31 +452,38 @@ void GLScope::applyConfig()
{ {
m_configChanged = false; 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) { if(m_orientation == Qt::Vertical) {
m_glScopeRect1 = QRectF( m_glScopeRect1 = QRectF(
(float)10 / (float)width(), (float)leftMargin / (float)width(),
(float)10 / (float)height(), (float)topMargin / (float)height(),
(float)(width() - 10 - 10) / (float)width(), (float)(width() - leftMargin - rightMargin) / (float)width(),
(float)((height() - 10 - 10 - 10) / 2) / (float)height() (float)((height() - botMargin - botMargin - topMargin) / 2) / (float)height()
); );
m_glScopeRect2 = QRectF( m_glScopeRect2 = QRectF(
(float)10 / (float)width(), (float)leftMargin / (float)width(),
(float)(10 + 10 + (height() - 10 - 10 - 10) / 2) / (float)height(), (float)(botMargin + topMargin + (height() - botMargin - botMargin - topMargin) / 2) / (float)height(),
(float)(width() - 10 - 10) / (float)width(), (float)(width() - leftMargin - rightMargin) / (float)width(),
(float)((height() - 10 - 10 - 10) / 2) / (float)height() (float)((height() - botMargin - botMargin - topMargin) / 2) / (float)height()
); );
} else { } else {
m_glScopeRect1 = QRectF( m_glScopeRect1 = QRectF(
(float)10 / (float)width(), (float)leftMargin / (float)width(),
(float)10 / (float)height(), (float)topMargin / (float)height(),
(float)((width() - 10 - 10 - 10) / 2) / (float)width(), (float)((width() - leftMargin - leftMargin - rightMargin) / 2) / (float)width(),
(float)(height() - 10 - 10) / (float)height() (float)(height() - topMargin - botMargin) / (float)height()
); );
m_glScopeRect2 = QRectF( m_glScopeRect2 = QRectF(
(float)(10 + 10 + ((width() - 10 - 10 - 10) / 2)) / (float)width(), (float)(leftMargin + leftMargin + ((width() - leftMargin - leftMargin - rightMargin) / 2)) / (float)width(),
(float)10 / (float)height(), (float)topMargin / (float)height(),
(float)((width() - 10 - 10 - 10) / 2) / (float)width(), (float)((width() - leftMargin - leftMargin - rightMargin) / 2) / (float)width(),
(float)(height() - 10 - 10) / (float)height() (float)(height() - topMargin - botMargin) / (float)height()
); );
} }
} }