Adjust window radius

This commit is contained in:
cutefishd 2021-04-18 21:23:47 +08:00
parent bc32f34ed5
commit 0e30a04a3e
2 changed files with 11 additions and 8 deletions

View file

@ -11,7 +11,7 @@ Item {
visible: true visible: true
property bool isHorizontal: Settings.direction === DockSettings.Bottom property bool isHorizontal: Settings.direction === DockSettings.Bottom
property real windowRadius: isHorizontal ? root.height * 0.35 : root.width * 0.35 property real windowRadius: isHorizontal ? root.height * 0.3 : root.width * 0.3
DropArea { DropArea {
anchors.fill: parent anchors.fill: parent
@ -39,12 +39,12 @@ Item {
} }
} }
FishUI.WindowShadow { FishUI.WindowShadow {
view: mainWindow view: mainWindow
geometry: Qt.rect(root.x, root.y, root.width, root.height) geometry: Qt.rect(root.x, root.y, root.width, root.height)
strength: 1 strength: 1
radius: root.windowRadius radius: root.windowRadius
} }
FishUI.WindowBlur { FishUI.WindowBlur {
view: mainWindow view: mainWindow

View file

@ -26,7 +26,8 @@
DockBackground::DockBackground() DockBackground::DockBackground()
: m_radius(0) : m_radius(0)
{ {
setSmooth(true);
setAntialiasing(true);
} }
QColor DockBackground::color() const QColor DockBackground::color() const
@ -64,6 +65,7 @@ void DockBackground::paint(QPainter *painter)
// Enable antialiasing. // Enable antialiasing.
painter->setRenderHint(QPainter::Antialiasing); painter->setRenderHint(QPainter::Antialiasing);
painter->save();
QRectF rect = boundingRect(); QRectF rect = boundingRect();
QPainterPath path; QPainterPath path;
@ -97,6 +99,7 @@ void DockBackground::paint(QPainter *painter)
painter->setPen(pen); painter->setPen(pen);
painter->setBrush(Qt::NoBrush); painter->setBrush(Qt::NoBrush);
painter->drawPath(path); painter->drawPath(path);
painter->restore();
} }
void DockBackground::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) void DockBackground::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)