diff options
-rw-r--r-- | lumina-desktop/LDesktopPluginSpace.cpp | 8 | ||||
-rw-r--r-- | lumina-desktop/LDesktopPluginSpace.h | 20 |
2 files changed, 19 insertions, 9 deletions
diff --git a/lumina-desktop/LDesktopPluginSpace.cpp b/lumina-desktop/LDesktopPluginSpace.cpp index cb0cc75f..28ff94a6 100644 --- a/lumina-desktop/LDesktopPluginSpace.cpp +++ b/lumina-desktop/LDesktopPluginSpace.cpp @@ -83,9 +83,10 @@ void LDesktopPluginSpace::UpdateGeom(int oldgrid){ }else{ //NOTE: We are not doing the ValidGeometry() checks because we are only resizing existing plugin with pre-set & valid grid positions grid = gridToGeom(grid); //convert to pixels before saving/sizing - ITEMS[i]->setGeometry( grid ); + MovePlugin(ITEMS[i], grid); + /*ITEMS[i]->setGeometry( grid ); ITEMS[i]->setFixedSize(grid.size()); - ITEMS[i]->savePluginGeometry(grid); + ITEMS[i]->savePluginGeometry(grid);*/ } } //if(reload){ QTimer::singleShot(0,this, SLOT(reloadPlugins())); } @@ -121,7 +122,8 @@ void LDesktopPluginSpace::addDesktopPlugin(QString plugID){ }else{ if(DEBUG){ qDebug() << " - New Plugin Geometry (grid):" << geom; } //Now place the item in the proper spot/size - plug->setGeometry( gridToGeom(geom) ); + MovePlugin(plug, gridToGeom(geom)); + //plug->setGeometry( gridToGeom(geom) ); plug->show(); if(DEBUG){ qDebug() << " - New Plugin Geometry (px):" << plug->geometry(); } ITEMS << plug; diff --git a/lumina-desktop/LDesktopPluginSpace.h b/lumina-desktop/LDesktopPluginSpace.h index 6328b4de..b3c87ce4 100644 --- a/lumina-desktop/LDesktopPluginSpace.h +++ b/lumina-desktop/LDesktopPluginSpace.h @@ -141,6 +141,12 @@ private: return 0; } + void MovePlugin(LDPlugin* plug, QRect geom){ + plug->setGeometry( geom ); + plug->setFixedSize(geom.size()); //needed for some plugins + plug->savePluginGeometry(geom); + } + private slots: void reloadPlugins(bool ForceIconUpdate = false); @@ -196,10 +202,11 @@ protected: valid = ValidGeometry(act.section("::::",1,50), geom); } if(valid){ - item->setGeometry(geom); - item->setFixedSize(geom.size()); //needed due to resizing limitations and such for some plugins + MovePlugin(item, geom); + //item->setGeometry(geom); + //item->setFixedSize(geom.size()); //needed due to resizing limitations and such for some plugins ev->acceptProposedAction(); - item->savePluginGeometry(geom); //save in pixel coords + //item->savePluginGeometry(geom); //save in pixel coords }else{ ev->ignore(); } //invalid location }else{ @@ -221,10 +228,11 @@ protected: valid = ValidGeometry(act.section("::::",1,50), geom); } if(valid){ - item->setGeometry(geom); - item->setFixedSize(geom.size()); //needed due to resizing limitations and such for some plugins + MovePlugin(item, geom); + //item->setGeometry(geom); + //item->setFixedSize(geom.size()); //needed due to resizing limitations and such for some plugins ev->acceptProposedAction(); - item->savePluginGeometry(geom); //save in pixel coords + //item->savePluginGeometry(geom); //save in pixel coords }else{ ev->ignore(); } //invalid location } } |