diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-17 11:09:05 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-17 11:09:05 -0400 |
commit | c7967eb9b1a25767ec29290bebb782a70a45251a (patch) | |
tree | c97d2ea356c5bd2296986c8bf8d1662f5f65f594 /src-qt5/core | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-c7967eb9b1a25767ec29290bebb782a70a45251a.tar.gz lumina-c7967eb9b1a25767ec29290bebb782a70a45251a.tar.bz2 lumina-c7967eb9b1a25767ec29290bebb782a70a45251a.zip |
Some more painting cleanup for the wallpaper/panels.
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | 10 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LPanel.cpp | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp index c3d67117..ed12bcf0 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -8,13 +8,17 @@ #include <QPainter> #include <QPaintEvent> +#include <QDebug> void LDesktopBackground::paintEvent(QPaintEvent *ev) { if (bgPixmap != NULL) { + //qDebug() << "Wallpaper paint Event:" << ev->rect(); QPainter painter(this); painter.setBrush(*bgPixmap); - painter.drawRect(ev->rect()); - } + painter.drawRect(ev->rect().adjusted(-1,-1,2,2)); + }else{ + QWidget::paintEvent(ev); + } } void LDesktopBackground::setBackground(const QString& bgFile, const QString& format) { @@ -67,7 +71,7 @@ void LDesktopBackground::setBackground(const QString& bgFile, const QString& for painter.setBrushOrigin(dx, dy); painter.drawRect(dx, dy, drawWidth, drawHeight); } - this->repaint(this->geometry()); //make sure the entire thing gets repainted right away + this->repaint(); //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 1308d61f..67cba7f4 100644 --- a/src-qt5/core/lumina-desktop/LPanel.cpp +++ b/src-qt5/core/lumina-desktop/LPanel.cpp @@ -325,11 +325,12 @@ void LPanel::paintEvent(QPaintEvent *event){ //qDebug() << "Paint Panel:" << PPREFIX; //Make sure the base background of the event rectangle is the associated rectangle from the BGWindow QRect rec = event->rect();//this->geometry(); //start with the global geometry of the panel + rec.adjust(-1,-1,2,2); //add 1 more pixel on each side //Need to translate that rectangle to the background image coordinates //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) ); + painter->drawPixmap(event->rect().adjusted(-1,-1,2,2), bgWindow->grab(rec) ); } QWidget::paintEvent(event); //now pass the event along to the normal painting event } |