From 6b310daff4fbd1ba9080ea340b3e9cea72770f06 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 7 Oct 2015 12:50:20 -0400 Subject: Couple more updates for lumina-desktop: 1) Implement the file dropping on the desktop 2) Fix the panel painting routine to ensure the proper "fake" transparency is applied. 3) Add a missing include line in the panel "applauncher" plugin. 4) Fix the initial desktop icon size setting. --- lumina-desktop/LDesktop.cpp | 2 +- lumina-desktop/LDesktopPluginSpace.cpp | 2 +- lumina-desktop/LDesktopPluginSpace.h | 12 +++++++++++- lumina-desktop/LPanel.cpp | 16 +++++++--------- .../panel-plugins/applauncher/AppLaunchButton.cpp | 1 + 5 files changed, 21 insertions(+), 12 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index a1aaac67..8204de29 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -224,7 +224,7 @@ 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(qRound(bgDesktop->height()/14.0)); // (For 1600x900 screens - this comes out to 64 pixel icons) + bgDesktop->SetIconSize(qRound(bgWindow->height()/14.0)); // (For 1600x900 screens - this comes out to 64 pixel icons) connect(bgDesktop, SIGNAL(PluginRemovedByUser(QString)), this, SLOT(RemoveDeskPlugin(QString)) ); if(DEBUG){ qDebug() << " - Desktop Init Done:" << desktopnumber; } //Start the update processes diff --git a/lumina-desktop/LDesktopPluginSpace.cpp b/lumina-desktop/LDesktopPluginSpace.cpp index 116c4207..21ed3f46 100644 --- a/lumina-desktop/LDesktopPluginSpace.cpp +++ b/lumina-desktop/LDesktopPluginSpace.cpp @@ -193,7 +193,7 @@ void LDesktopPluginSpace::reloadPlugins(){ else if(ITEMS[i]->whatsThis().contains("---dlink") && items.contains(ITEMS[i]->whatsThis().section("---",0,0).section("::",1,50)) ){ //Account for the variation in the Plugin ID for desktop files items.removeAll(ITEMS[i]->whatsThis().section("---",0,0).section("::",1,50)); - }else{ ITEMS[i]->Cleanup(); delete ITEMS.takeAt(i); i--; } + }else{ ITEMS[i]->removeSettings(true); delete ITEMS.takeAt(i); i--; } //this is considered a permanent removal (cleans settings) } //Now create any new items diff --git a/lumina-desktop/LDesktopPluginSpace.h b/lumina-desktop/LDesktopPluginSpace.h index 353543d9..bf623b68 100644 --- a/lumina-desktop/LDesktopPluginSpace.h +++ b/lumina-desktop/LDesktopPluginSpace.h @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "desktop-plugins/LDPlugin.h" @@ -217,7 +219,15 @@ protected: qDebug() << "Desktop Drop Event:" << urls; for(int i=0; igeometry().contains(QCursor::pos()) ){ //Move the panel back to it's "hiding" spot - if(hidden){ this->move(hidepoint); } + if(hidden){ this->move(hidepoint); this->update(); } //Re-active the old window if(LSession::handle()->activeWindow()!=0){ LSession::handle()->XCB->ActivateWindow(LSession::handle()->activeWindow()); @@ -313,17 +313,14 @@ void LPanel::checkPanelFocus(){ //=========== void LPanel::paintEvent(QPaintEvent *event){ QPainter *painter = new QPainter(this); + qDebug() << "Paint Tray:"; //Make sure the base background of the event rectangle is the associated rectangle from the BGWindow - QRect rec(event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height()); //already in global coords? (translating to bgWindow coords crashes Lumina) + QRect rec = this->geometry(); //start with the global geometry of the panel //Need to translate that rectangle to the background image coordinates - //qDebug() << "Rec:" << rec.x() << rec.y(); - //Need to change to global coords for the main window - if(hidden && (this->pos()==hidepoint) ){ rec.moveTo( this->mapToGlobal(rec.topLeft()-hidepoint+showpoint) ); } - else{ rec.moveTo( this->mapToGlobal(rec.topLeft()) ); } - //qDebug() << "Global Rec:" << rec.x() << rec.y() << screennum; + //qDebug() << " - Rec:" << rec << hidden << this->geometry(); rec.moveTo( rec.x()-LSession::handle()->screenGeom(screennum).x(), rec.y() ); - //qDebug() << "Adjusted Global Rec:" << rec.x() << rec.y(); - painter->drawPixmap(event->rect(), bgWindow->grab(rec) ); + //qDebug() << " - Adjusted Global Rec:" << rec; + painter->drawPixmap(QRect(0,0,this->width(), this->height()), bgWindow->grab(rec) ); QWidget::paintEvent(event); //now pass the event along to the normal painting event } @@ -332,6 +329,7 @@ void LPanel::enterEvent(QEvent *event){ if(hidden){ //Move the panel out so it is fully available this->move(showpoint); + this->update(); } this->activateWindow(); event->accept(); //just to quiet the compile warning diff --git a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp index 5bd7fa96..321970ed 100644 --- a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp +++ b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -8,6 +8,7 @@ #include "../../LSession.h" #include +#include AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ button = new QToolButton(this); -- cgit