diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-05 15:35:21 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-05 15:35:21 -0400 |
commit | 0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca (patch) | |
tree | 17a15c5628bd2ee74330f1d2a0e1f703021d232e /lumina-desktop/LDesktop.cpp | |
parent | Merge branch 'master' of github.com:pcbsd/lumina (diff) | |
download | lumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.tar.gz lumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.tar.bz2 lumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.zip |
Finish up the desktop re-scaling routines for ensure the same interface if you switch out monitors/systems with a different resolution. Also add a quick check to ensure that we don't create duplicate desktops in the same location on the X screen.
Diffstat (limited to 'lumina-desktop/LDesktop.cpp')
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 86db3fc6..8040c18b 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -116,7 +116,7 @@ void LDesktop::SystemApplication(QAction* act){ void LDesktop::checkResolution(){ //Compare the current screen resolution with the last one used/saved and adjust config values *only* - + //NOTE: This is only run the first time this desktop is created (before loading all the interface) - not on each desktop change int oldWidth = settings->value(DPREFIX+"screen/lastWidth",-1).toInt(); int oldHeight = settings->value(DPREFIX+"screen/lastHeight",-1).toInt(); QRect scrn = LSession::desktop()->screenGeometry(desktopnumber); @@ -152,9 +152,22 @@ void LDesktop::checkResolution(){ } } //Update any desktop plugins - /*for(int i=0; i<PLUGINS.length(); i++){ - PLUGINS[i]->scalePlugin(xscale, yscale); - }*/ + QStringList plugs = settings->value(DPREFIX+"pluginlist").toStringList(); + QString pspath = QDir::homePath()+"/.lumina/desktop-plugins/%1.conf"; + for(int i=0; i<plugs.length(); i++){ + if(QFile::exists( pspath.arg(plugs[i]) )){ + //Has existing settings file - need to adjust this as well + QSettings pset(QSettings::UserScope, "desktop-plugins",plugs[i]); + if(pset.contains("location/height")){ pset.setValue( "location/height", qRound(pset.value("location/height").toInt()*yscale) ); } + if(pset.contains("location/width")){ pset.setValue( "location/width", qRound(pset.value("location/width").toInt()*xscale) ); } + if(pset.contains("location/x")){ pset.setValue( "location/x", qRound(pset.value("location/x").toInt()*xscale) ); } + if(pset.contains("location/y")){ pset.setValue( "location/y", qRound(pset.value("location/y").toInt()*yscale) ); } + if(pset.contains("IconSize")){ pset.setValue( "IconSize", qRound(pset.value("IconSize").toInt()*yscale) ); } + if(pset.contains("iconsize")){ pset.setValue( "iconsize", qRound(pset.value("iconsize").toInt()*yscale) ); } + pset.sync(); //make sure it gets saved to disk right away + } + } + } issyncing = false; } |