forked from openkylin/ukui-system-appwidget
fix:中等一般未确认【平板】【显示器】接入双屏后图标出现重叠
This commit is contained in:
parent
20b84a533d
commit
34b61a2dcf
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@ Window {
|
|||
color: "transparent"
|
||||
border.color: "green"
|
||||
Loader{
|
||||
width: 220
|
||||
height: 118
|
||||
anchors.centerIn: parent
|
||||
source: "/data/time.qml"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue