diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-17 10:49:31 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-17 10:49:31 -0400 |
commit | 232b9a154772d9a75dce1c2c3ecae72f75e41302 (patch) | |
tree | b0b8f8b3908aff671e9658746656d28092c2874f | |
parent | Comment out the "valid symbols" line in lumina-calculator. (diff) | |
parent | Turn off some debugging and fix the repaint of the entire wallpaper on change. (diff) | |
download | lumina-232b9a154772d9a75dce1c2c3ecae72f75e41302.tar.gz lumina-232b9a154772d9a75dce1c2c3ecae72f75e41302.tar.bz2 lumina-232b9a154772d9a75dce1c2c3ecae72f75e41302.zip |
Merge branch 'master' of github.com:trueos/lumina
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | 7 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LPanel.cpp | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp index 3d33db71..c3d67117 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -7,12 +7,13 @@ #include "LDesktopBackground.h" #include <QPainter> +#include <QPaintEvent> -void LDesktopBackground::paintEvent(QPaintEvent *) { +void LDesktopBackground::paintEvent(QPaintEvent *ev) { if (bgPixmap != NULL) { QPainter painter(this); painter.setBrush(*bgPixmap); - painter.drawRect(0, 0, width(), height()); + painter.drawRect(ev->rect()); } } @@ -66,7 +67,7 @@ void LDesktopBackground::setBackground(const QString& bgFile, const QString& for painter.setBrushOrigin(dx, dy); painter.drawRect(dx, dy, drawWidth, drawHeight); } - update(); + this->repaint(this->geometry()); //make sure the entire thing gets repainted right away show(); } diff --git a/src-qt5/core/lumina-desktop/LPanel.cpp b/src-qt5/core/lumina-desktop/LPanel.cpp index b0abf498..1308d61f 100644 --- a/src-qt5/core/lumina-desktop/LPanel.cpp +++ b/src-qt5/core/lumina-desktop/LPanel.cpp @@ -324,12 +324,12 @@ void LPanel::paintEvent(QPaintEvent *event){ QPainter *painter = new QPainter(this); //qDebug() << "Paint Panel:" << PPREFIX; //Make sure the base background of the event rectangle is the associated rectangle from the BGWindow - QRect rec = this->geometry(); //start with the global geometry of the panel + QRect rec = event->rect();//this->geometry(); //start with the global geometry of the panel //Need to translate that rectangle to the background image coordinates - //qDebug() << " - Rec:" << rec << hidden << this->geometry(); - rec.moveTo( rec.x()-LSession::handle()->screenGeom(screennum).x(), rec.y()-LSession::handle()->screenGeom(screennum).y() ); - //qDebug() << " - Adjusted Global Rec:" << rec; - painter->drawPixmap(QRect(0,0,this->width(), this->height()), bgWindow->grab(rec) ); + //qDebug() << " - Rec:" << rec << hidden << this->geometry() << bgWindow->geometry(); + rec.moveTo( bgWindow->mapFromGlobal( this->mapToGlobal(rec.topLeft()) ) ); //(rec.x()-LSession::handle()->screenGeom(screennum).x(), rec.y()-LSession::handle()->screenGeom(screennum).y() ); + //qDebug() << " - Adjusted Window Rec:" << rec; + painter->drawPixmap(event->rect(), bgWindow->grab(rec) ); } QWidget::paintEvent(event); //now pass the event along to the normal painting event } |