diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-19 09:58:35 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-19 09:58:35 -0400 |
commit | edd8ceaf76756efcd05d50bc5074afae9d668e3c (patch) | |
tree | 3ab318cf088e717a6ec1ffc778ea66592b7bbfc1 /lumina-desktop/LDesktop.cpp | |
parent | Fix up the automatic re-sizing of desktop plugins along the bottom/right scre... (diff) | |
download | lumina-edd8ceaf76756efcd05d50bc5074afae9d668e3c.tar.gz lumina-edd8ceaf76756efcd05d50bc5074afae9d668e3c.tar.bz2 lumina-edd8ceaf76756efcd05d50bc5074afae9d668e3c.zip |
Add a scaling rule for the desktop plugin grid size:
If the screen height is more than 2000 pixels high (4K screen), then set the initial icon size to 200 pixels. Otherwise use the normal 100 pixel default.
Diffstat (limited to 'lumina-desktop/LDesktop.cpp')
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 15b09b8a..d76b688a 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -224,7 +224,10 @@ void LDesktop::InitDesktop(){ connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu(const QPoint&)) ); if(DEBUG){ qDebug() << "Create bgDesktop"; } bgDesktop = new LDesktopPluginSpace(bgWindow); //new QMdiArea(bgWindow); - bgDesktop->SetIconSize( settings->value(DPREFIX+"GridSize",100).toInt() ); + int grid = settings->value(DPREFIX+"GridSize",-1).toInt(); + if(grid<0 && bgWindow->height() > 2000){ grid = 200; } + else if(grid<0){ grid = 100; } + bgDesktop->SetIconSize( grid ); connect(bgDesktop, SIGNAL(PluginRemovedByUser(QString)), this, SLOT(RemoveDeskPlugin(QString)) ); connect(bgDesktop, SIGNAL(IncreaseIcons()), this, SLOT(IncreaseDesktopPluginIcons()) ); connect(bgDesktop, SIGNAL(DecreaseIcons()), this, SLOT(DecreaseDesktopPluginIcons()) ); @@ -372,7 +375,9 @@ void LDesktop::RemoveDeskPlugin(QString ID){ } void LDesktop::IncreaseDesktopPluginIcons(){ - int cur = settings->value(DPREFIX+"GridSize",100).toInt(); + int cur = settings->value(DPREFIX+"GridSize",-1).toInt(); + if(cur<0 && bgWindow->height() > 2000){ cur = 200; } + else if(cur<0){ cur = 100; } cur+=16; issyncing=true; //don't let the change cause a refresh settings->setValue(DPREFIX+"GridSize",cur); @@ -382,7 +387,9 @@ void LDesktop::IncreaseDesktopPluginIcons(){ } void LDesktop::DecreaseDesktopPluginIcons(){ - int cur = settings->value(DPREFIX+"GridSize",100).toInt(); + int cur = settings->value(DPREFIX+"GridSize",-1).toInt(); + if(cur<0 && bgWindow->height() > 2000){ cur = 200; } + else if(cur<0){ cur = 100; } if(cur<32){ return; } //cannot get smaller than 16x16 cur-=16; issyncing=true; //don't let the change cause a refresh |