This commit is contained in:
朱子楚\zhuzi 2023-07-05 21:34:08 +08:00
parent ff93a6204a
commit ad4d077480
5 changed files with 11 additions and 9 deletions

View File

@ -175,12 +175,6 @@ CustomWindow {
displayMode:MainEvent.displayMode displayMode:MainEvent.displayMode
logo: "qrc:/example/res/image/favicon.ico" logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI" title:"FluentUI"
Behavior on rotation {
NumberAnimation{
duration: 167
}
}
transformOrigin: Item.Center
onLogoClicked:{ onLogoClicked:{
clickCount += 1 clickCount += 1
if(clickCount === 1){ if(clickCount === 1){

View File

@ -5,6 +5,7 @@
CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent)
{ {
setVisible(false);
_anim = new QPropertyAnimation(this, "radius", this); _anim = new QPropertyAnimation(this, "radius", this);
_anim->setDuration(333); _anim->setDuration(333);
_anim->setEasingCurve(QEasingCurve::OutCubic); _anim->setEasingCurve(QEasingCurve::OutCubic);
@ -19,6 +20,7 @@ CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent)
void CircularReveal::paint(QPainter* painter) void CircularReveal::paint(QPainter* painter)
{ {
painter->save(); painter->save();
painter->eraseRect(boundingRect());
painter->drawImage(QRect(0, 0, static_cast<int>(width()), static_cast<int>(height())), _source); painter->drawImage(QRect(0, 0, static_cast<int>(width()), static_cast<int>(height())), _source);
QPainterPath path; QPainterPath path;
path.moveTo(_center.x(),_center.y()); path.moveTo(_center.x(),_center.y());

View File

@ -31,7 +31,6 @@ Item{
var y = 0; var y = 0;
var w = control.width; var w = control.width;
var h = control.height; var h = control.height;
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.save(); ctx.save();
ctx.beginPath(); ctx.beginPath();

View File

@ -56,7 +56,6 @@ Rectangle {
renderTarget: Canvas.Image renderTarget: Canvas.Image
onPaint: { onPaint: {
var ctx = canvas.getContext("2d") var ctx = canvas.getContext("2d")
ctx.setTransform(1, 0, 0, 1, 0, 0)
ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.clearRect(0, 0, canvas.width, canvas.height)
ctx.save() ctx.save()
ctx.lineWidth = linWidth ctx.lineWidth = linWidth

View File

@ -9,6 +9,15 @@ Item{
property bool shadow: true property bool shadow: true
default property alias contentItem: container.data default property alias contentItem: container.data
id:control id:control
onWidthChanged: {
canvas.requestPaint()
}
onHeightChanged: {
canvas.requestPaint()
}
onRadiusChanged: {
canvas.requestPaint()
}
FluShadow{ FluShadow{
anchors.fill: container anchors.fill: container
radius: control.radius[0] radius: control.radius[0]
@ -36,7 +45,6 @@ Item{
var y = 0; var y = 0;
var w = control.width; var w = control.width;
var h = control.height; var h = control.height;
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.save(); ctx.save();
ctx.beginPath(); ctx.beginPath();