diff options
author | Ken Moore <ken@ixsystems.com> | 2017-05-31 13:52:35 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-05-31 13:52:35 -0400 |
commit | c0dce5cc8acc9335554be9c5d96e9366c91a47e4 (patch) | |
tree | 87da6459720bd2d8853b8153ed52e9ec48576daf | |
parent | Another quick adjustment to the clock plugin sizing routine - seems to be wor... (diff) | |
download | lumina-c0dce5cc8acc9335554be9c5d96e9366c91a47e4.tar.gz lumina-c0dce5cc8acc9335554be9c5d96e9366c91a47e4.tar.bz2 lumina-c0dce5cc8acc9335554be9c5d96e9366c91a47e4.zip |
Fix up the desktop plugin "move" operation so it saves the proper grid coordinates for next session.
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktopPluginSpace.cpp | 2 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktopPluginSpace.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.cpp b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.cpp index f4cf2cfe..41a1017d 100644 --- a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.cpp @@ -125,9 +125,11 @@ void LDesktopPluginSpace::addDesktopPlugin(QString plugID){ //Now get the saved geometry for the plugin QRect geom = plug->gridGeometry(); //grid coordinates if(geom.isNull()){ + //Try the old format (might be slight drift between sessions if the grid size changes) geom = plug->loadPluginGeometry(); //in pixel coords if(!geom.isNull()){ geom = geomToGrid(geom); } //convert to grid coordinates } + if(DEBUG){ qDebug() << "Saved plugin geom:" << geom << plugID; } //Now determine the position to put it if(geom.isNull()){ //No previous location - need to calculate initial geom diff --git a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h index 8e768631..8781e2cb 100644 --- a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h +++ b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h @@ -161,6 +161,7 @@ private: void MovePlugin(LDPlugin* plug, QRect geom){ plug->savePluginGeometry(geom); //save the un-adjusted geometry + plug->setGridGeometry(geomToGrid(geom)); //save the actual grid location plug->setGeometry( geom ); plug->setFixedSize(geom.size()); //needed for some plugins } |