[Fix] There still will be rounder corner when kwin effect disabled.
This commit is contained in:
parent
544ac24fdd
commit
e5cc7c3131
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue