[Fix] There still will be rounder corner when kwin effect disabled.

This commit is contained in:
iaom 2021-03-31 11:04:31 +08:00
parent 544ac24fdd
commit e5cc7c3131
2 changed files with 6 additions and 3 deletions

View File

@ -85,7 +85,8 @@ MainWindow::MainWindow(QWidget *parent) :
QPainterPath path;
auto rect = this->rect();
rect.adjust(1, 1, -1, -1);
path.addRoundedRect(rect, 6, 6);
// path.addRoundedRect(rect, 0, 0);
path.addRect(rect);
setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
@ -484,7 +485,8 @@ void MainWindow::paintEvent(QPaintEvent *event) {
p.setBrush(opt.palette.color(QPalette::Base));
p.setOpacity(trans);
p.setPen(Qt::NoPen);
p.drawRoundedRect(rect, 6, 6);
// p.drawRoundedRect(rect, 6, 6);
p.drawRect(rect);
return QWidget::paintEvent(event);
}

View File

@ -439,7 +439,8 @@ void SettingsWidget::paintEvent(QPaintEvent *event) {
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
QPainterPath rectPath;
rectPath.addRoundedRect(this->rect(), 6, 6);
// rectPath.addRoundedRect(this->rect(), 6, 6);
rectPath.addRect(this->rect());
// // 画一个黑底
// QPixmap pixmap(this->rect().size());