This commit is contained in:
zhuzichu 2023-08-31 18:06:05 +08:00
parent 5b3834ed8f
commit 1be9103412
5 changed files with 36 additions and 29 deletions

View File

@ -31,7 +31,7 @@ FluTheme::FluTheme(QObject *parent)
}); });
primaryColor(FluColors::getInstance()->Blue()); primaryColor(FluColors::getInstance()->Blue());
nativeText(false); nativeText(false);
enableAnimation(false); enableAnimation(true);
darkMode(FluThemeType::DarkMode::Light); darkMode(FluThemeType::DarkMode::Light);
_systemDark = systemDark(); _systemDark = systemDark();
qApp->installEventFilter(this); qApp->installEventFilter(this);

View File

@ -752,7 +752,12 @@ Item {
id:nav_stack2 id:nav_stack2
anchors.fill: nav_stack anchors.fill: nav_stack
clip: true clip: true
visible: FluPageType.SingleInstance === nav_stack.currentItem.launchMode visible: {
if(!nav_stack.currentItem){
return false
}
return FluPageType.SingleInstance === nav_stack.currentItem.launchMode
}
} }
function navStack(){ function navStack(){
return nav_stack return nav_stack

View File

@ -96,24 +96,22 @@ Popup{
ctx.globalCompositeOperation = 'destination-out' ctx.globalCompositeOperation = 'destination-out'
ctx.fillStyle = 'black' ctx.fillStyle = 'black'
var rect = Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2) var rect = Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2)
ctx.fillRect(rect.x,rect.y,rect.width,rect.height) drawRoundedRect(rect,2,ctx)
ctx.restore() ctx.restore()
} }
//Todo
function drawRoundedRect(rect, r, ctx) { function drawRoundedRect(rect, r, ctx) {
var ptA = Qt.point(rect.x + r, rect.y) ctx.beginPath();
var ptB = Qt.point(rect.x + rect.width, rect.y) ctx.moveTo(rect.x + r, rect.y);
var ptC = Qt.point(rect.x + rect.width, rect.y + rect.height) ctx.lineTo(rect.x + rect.width - r, rect.y);
var ptD = Qt.point(rect.x, rect.y + rect.height) ctx.arcTo(rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + r, r);
var ptE = Qt.point(rect.x, rect.y) ctx.lineTo(rect.x + rect.width, rect.y + rect.height - r);
ctx.beginPath() ctx.arcTo(rect.x + rect.width, rect.y + rect.height, rect.x + rect.width - r, rect.y + rect.height, r);
ctx.moveTo(ptA.x, ptA.y) ctx.lineTo(rect.x + r, rect.y + rect.height);
ctx.arcTo(ptB.x, ptB.y, ptC.x, ptC.y, r) ctx.arcTo(rect.x, rect.y + rect.height, rect.x, rect.y + rect.height - r, r);
ctx.arcTo(ptC.x, ptC.y, ptD.x, ptD.y, r) ctx.lineTo(rect.x, rect.y + r);
ctx.arcTo(ptD.x, ptD.y, ptE.x, ptE.y, r) ctx.arcTo(rect.x, rect.y, rect.x + r, rect.y, r);
ctx.arcTo(ptE.x, ptE.y, ptA.x, ptA.y, r) ctx.closePath();
ctx.fill() ctx.fill()
ctx.closePath()
} }
} }
FluArea{ FluArea{

View File

@ -753,7 +753,12 @@ Item {
id:nav_stack2 id:nav_stack2
anchors.fill: nav_stack anchors.fill: nav_stack
clip: true clip: true
visible: FluPageType.SingleInstance === nav_stack.currentItem.launchMode visible: {
if(!nav_stack.currentItem){
return false
}
return FluPageType.SingleInstance === nav_stack.currentItem.launchMode
}
} }
function navStack(){ function navStack(){
return nav_stack return nav_stack

View File

@ -89,19 +89,18 @@ Popup{
ctx.restore() ctx.restore()
} }
function drawRoundedRect(rect, r, ctx) { function drawRoundedRect(rect, r, ctx) {
var ptA = Qt.point(rect.x + r, rect.y) ctx.beginPath();
var ptB = Qt.point(rect.x + rect.width, rect.y) ctx.moveTo(rect.x + r, rect.y);
var ptC = Qt.point(rect.x + rect.width, rect.y + rect.height) ctx.lineTo(rect.x + rect.width - r, rect.y);
var ptD = Qt.point(rect.x, rect.y + rect.height) ctx.arcTo(rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + r, r);
var ptE = Qt.point(rect.x, rect.y) ctx.lineTo(rect.x + rect.width, rect.y + rect.height - r);
ctx.beginPath() ctx.arcTo(rect.x + rect.width, rect.y + rect.height, rect.x + rect.width - r, rect.y + rect.height, r);
ctx.moveTo(ptA.x, ptA.y) ctx.lineTo(rect.x + r, rect.y + rect.height);
ctx.arcTo(ptB.x, ptB.y, ptC.x, ptC.y, r) ctx.arcTo(rect.x, rect.y + rect.height, rect.x, rect.y + rect.height - r, r);
ctx.arcTo(ptC.x, ptC.y, ptD.x, ptD.y, r) ctx.lineTo(rect.x, rect.y + r);
ctx.arcTo(ptD.x, ptD.y, ptE.x, ptE.y, r) ctx.arcTo(rect.x, rect.y, rect.x + r, rect.y, r);
ctx.arcTo(ptE.x, ptE.y, ptA.x, ptA.y, r) ctx.closePath();
ctx.fill() ctx.fill()
ctx.closePath()
} }
} }
FluArea{ FluArea{