mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-10-06 09:17:07 +02:00
Check Widget for min height and width
This commit is contained in:
parent
231ee32488
commit
f0161ffc35
@ -8,5 +8,6 @@
|
||||
<link rel="stylesheet" href="">
|
||||
</head>
|
||||
<body>
|
||||
<h1>This is my HTML Wallpaper 🚀</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,5 +8,6 @@
|
||||
<link rel="stylesheet" href="">
|
||||
</head>
|
||||
<body>
|
||||
<h1>This is my HTML Widget 🚀</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -2,6 +2,8 @@ import QtQuick
|
||||
|
||||
Item {
|
||||
id: root
|
||||
// This is the default size of the widget.
|
||||
// These implicit width and height values are required!
|
||||
implicitWidth: 300
|
||||
implicitHeight: 200
|
||||
|
||||
|
@ -73,6 +73,12 @@ Item {
|
||||
}
|
||||
onStatusChanged: {
|
||||
if (loader.status == Loader.Ready && loader.source !== "") {
|
||||
if( loader.item.implicitWidth === 0 || loader.item.implicitHeight === 0){
|
||||
print("Implicit size is 0, using root size")
|
||||
loader.item.implicitWidth = root.width
|
||||
loader.item.implicitHeight = root.height
|
||||
}
|
||||
|
||||
// Resize to loaded widget size
|
||||
// Note: We must use implicit* here to not
|
||||
// break the set values.
|
||||
|
Loading…
Reference in New Issue
Block a user