Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ukui/ukui-sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
liushanwen1997 committed Jan 6, 2021
2 parents cf48fae + cf13e65 commit 37a872d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/plugins/ukui-notebook/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ void Widget::kyNoteInit()
setMouseTracking(true); //设置鼠标追踪
//窗口属性
//setWindowFlags(Qt::FramelessWindowHint); //开启窗口无边框
setAttribute(Qt::WA_TranslucentBackground); //设置窗口透明显示(毛玻璃效果)
//setAttribute(Qt::WA_TranslucentBackground); //设置窗口透明显示(毛玻璃效果)

QPainterPath blurPath;
blurPath.addRoundedRect(rect().adjusted(0, 0, -0, -0), 6, 6);
setProperty("useSystemStyleBlur", true);
setProperty("blurRegion", QRegion(blurPath.toFillPolygon().toPolygon()));//使用QPainterPath的api生成多边形Region
//QPainterPath blurPath;
//blurPath.addRoundedRect(rect().adjusted(0, 0, -0, -0), 6, 6);
//setProperty("useSystemStyleBlur", true);
//setProperty("blurRegion", QRegion(blurPath.toFillPolygon().toPolygon()));//使用QPainterPath的api生成多边形Region

//弹出位置
m_pSreenInfo = new adaptScreenInfo();
Expand Down Expand Up @@ -1087,7 +1087,8 @@ void Widget::paintEvent(QPaintEvent *event)
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing); // 反锯齿;
QPainterPath rectPath;
rectPath.addRoundedRect(this->rect(), 6, 6); // 左上右下
rectPath.addRect(this->rect());
//rectPath.addRoundedRect(this->rect(), 6, 6); // 左上右下

// 画一个黑底
//QPixmap pixmap(this->rect().size());
Expand Down

0 comments on commit 37a872d

Please sign in to comment.