aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaUtils.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 4c90c9ef..6172a49b 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -610,8 +610,12 @@ void LUtils::LoadSystemDefaults(bool skipOS){
//Now parse the variable and put the value in the proper file
if(var==(panvar+"_pixelsize")){
//qDebug() << "Panel Size:" << val;
- if(val.endsWith("%h")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen
- else if(val.endsWith("%w")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen
+ if(val.contains("%")){
+ QString last = val.section("%",1,1).toLower(); //last character
+ val = val.section("%",0,0);
+ if(last=="h"){ val = QString::number( (screenGeom.height()*val.toDouble())/100 ); }//adjust value to a percentage of the height of the screen
+ else if(last=="w"){ val = QString::number( (screenGeom.width()*val.toDouble())/100 ); }//adjust value to a percentage of the width of the screen
+ }
//qDebug() << " -- Adjusted:" << val;
deskset << "height="+val;
}
bgstack15