fix:中等一般未确认【平板】【显示器】接入双屏后图标出现重叠

This commit is contained in:
wangguixi 2022-11-25 17:23:18 +08:00 committed by yan wang
parent 20b84a533d
commit 34b61a2dcf
2 changed files with 18 additions and 13 deletions

View File

@ -25,7 +25,6 @@ AppWidget {
property bool qmleffect: false
property bool qmlenable: true
Timer {
id: gettime;
interval: 100;
@ -56,12 +55,12 @@ AppWidget {
}
if(appwidget.hournumber < 10) {
time1rec.width = 244
time1.width = 244
time1rec.width = 244*appwidget.scalefactor
time1.width = 244*appwidget.scalefactor
// console.log("=12 =",time1rec.width);
}else {
time1rec.width = 294
time1.width = 294
time1rec.width = 294*appwidget.scalefactor
time1.width = 294*appwidget.scalefactor
// console.log("=12 =",time1rec.width);
}
@ -96,11 +95,6 @@ AppWidget {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
visible: !v
Component.onCompleted:{
console.log("===aaaa=======",twelverec.width,twelverec.height)
console.log("=====",appwidget.scalefactor)
}
Rectangle {
id :time1rec
color: "transparent"
@ -249,7 +243,6 @@ AppWidget {
anchors.verticalCenter: parent.verticalCenter
anchors.left: spacing2.right
ColumnLayout{
width: 87*appwidget.scalefactor
height: 112*appwidget.scalefactor
@ -309,6 +302,16 @@ AppWidget {
}
console.log("当前gsetting为", timeformat, dateformat);
}
onWidthChanged: {
console.log("qml 窗口宽度改变,重新计算缩放比");
initScalefactor()
}
onHeightChanged: {
console.log("qml 窗口高度改变,重新计算缩放比");
initScalefactor()
}
function onupdate()
{
for (var i in appwidget.datavalue)
@ -340,7 +343,7 @@ AppWidget {
{
//,
//
console.log("父类窗口大小", appwidget.parent.width,appwidget.parent.height);
//console.log("", appwidget.parent.width,appwidget.parent.height);
if(appwidget.parent.width == 0 || appwidget.parent.height == 0) {
appwidget.scalefactor = 1.0
console.log("父类窗口大小为 0 默认缩放比为1.0")
@ -365,7 +368,6 @@ AppWidget {
appwidget.qmlenable = false;
}
}
}

View File

@ -16,6 +16,9 @@ Window {
color: "transparent"
border.color: "green"
Loader{
width: 220
height: 118
anchors.centerIn: parent
source: "/data/time.qml"
}
}