mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-05 07:24:47 -04:00
Save font scale in global settings
This commit is contained in:
+16
-2
@@ -811,8 +811,7 @@ void GLFont::setScale(GLFontScale scale) {
|
||||
//0) Normal:
|
||||
std::lock_guard<std::mutex> lock(g_userFontZoomMappingMutex);
|
||||
|
||||
currentScaleFactor = scale;
|
||||
|
||||
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE12] = GLFont::GLFONT_SIZE12;
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE16] = GLFont::GLFONT_SIZE16;
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE18] = GLFont::GLFONT_SIZE18;
|
||||
@@ -824,6 +823,14 @@ void GLFont::setScale(GLFontScale scale) {
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE64] = GLFont::GLFONT_SIZE64;
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE72] = GLFont::GLFONT_SIZE72;
|
||||
userFontZoomMapping[GLFont::GLFONT_SIZE96] = GLFont::GLFONT_SIZE96;
|
||||
|
||||
currentScaleFactor = scale;
|
||||
|
||||
//safety vs. inputs
|
||||
if (currentScaleFactor < GLFONT_SCALE_NORMAL || currentScaleFactor > GLFONT_SCALE_LARGE) {
|
||||
|
||||
currentScaleFactor = GLFontScale::GLFONT_SCALE_NORMAL;
|
||||
}
|
||||
|
||||
//override depending of zoom level:
|
||||
//Medium : more or less 1.5 x
|
||||
@@ -877,3 +884,10 @@ double GLFont::getScaleFactor() {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
GLFont::GLFontScale GLFont::getScale() {
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_userFontZoomMappingMutex);
|
||||
|
||||
return currentScaleFactor;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,8 @@ public:
|
||||
//Called to change the scale of the rendered fonts
|
||||
static void setScale(GLFontScale scale);
|
||||
|
||||
static GLFontScale getScale();
|
||||
|
||||
//Return the current scale factor in use (1.0 for normal, 1.5 for medium, 2.0 for large for ex.)
|
||||
static double getScaleFactor();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user