mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-27 06:08:37 -05:00
MISC: Position labels better according to font scale
This commit is contained in:
parent
d3db510643
commit
2b0a2822a7
@ -391,16 +391,26 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
|
||||
// demodStr = demodStr + " UnLock";
|
||||
// }
|
||||
|
||||
//Shift the user label from the modem label more for the bigger
|
||||
//font sizes so they do not step on each other...
|
||||
double heightShiftFactor = 1.3;
|
||||
|
||||
if (GLFont::getScale() == GLFont::GLFONT_SCALE_MEDIUM) {
|
||||
heightShiftFactor = 1.7;
|
||||
} else if (GLFont::getScale() == GLFont::GLFONT_SCALE_LARGE) {
|
||||
heightShiftFactor = 2.3;
|
||||
}
|
||||
|
||||
//demodulator user label if present: type is displayed above the label, which is at the bottom of the screen.
|
||||
if (!demod->getDemodulatorUserLabel().empty()) {
|
||||
hPos += 1.3 * labelHeight;
|
||||
hPos += heightShiftFactor * labelHeight;
|
||||
}
|
||||
|
||||
drawSingleDemodLabel(demodStr.ToStdWstring(), uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
|
||||
|
||||
//revert...
|
||||
if (!demod->getDemodulatorUserLabel().empty()) {
|
||||
hPos -= 1.3 * labelHeight;
|
||||
hPos -= heightShiftFactor * labelHeight;
|
||||
drawSingleDemodLabel(demod->getDemodulatorUserLabel(), uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,17 @@ void ScopeContext::DrawTunerTitles(bool ppmMode) {
|
||||
|
||||
GLFont::Drawer refDrawingFont = GLFont::getFont(12, GLFont::getScaleFactor());
|
||||
|
||||
refDrawingFont.drawString(ppmMode?"Device PPM":"Frequency", -0.66f, -1.0+hPos, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
refDrawingFont.drawString("Bandwidth", 0.0, -1.0+hPos, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
refDrawingFont.drawString("Center Frequency", 0.66f, -1.0+hPos, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
//better position frequency/bandwith labels according to font scale
|
||||
double shiftFactor = 1.0;
|
||||
if (GLFont::getScaleFactor() == GLFont::GLFONT_SCALE_MEDIUM) {
|
||||
shiftFactor = 1.5;
|
||||
} else if (GLFont::getScaleFactor() == GLFont::GLFONT_SCALE_LARGE) {
|
||||
shiftFactor = 2.0;
|
||||
}
|
||||
|
||||
refDrawingFont.drawString(ppmMode?"Device PPM":"Frequency", -0.66f, -1.0 +hPos*shiftFactor, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
refDrawingFont.drawString("Bandwidth", 0.0, -1.0 +hPos*shiftFactor, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
refDrawingFont.drawString("Center Frequency", 0.66f, -1.0 +hPos*shiftFactor, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||
}
|
||||
|
||||
void ScopeContext::DrawDeviceName(std::string deviceName) {
|
||||
|
Loading…
Reference in New Issue
Block a user