plasmoid: Fix setting initial size
Some change in Qt or Plasma prevents the old way of setting it to work (using onVisibleChanged). Using a Loader and onLoaded seems to work better.
This commit is contained in:
parent
326f03b604
commit
e475454c2d
|
@ -16,7 +16,7 @@ ColumnLayout {
|
|||
Layout.minimumHeight: units.gridUnit * 15
|
||||
|
||||
// define function to update the size according to the settings
|
||||
// when "floating" (shown as popup)
|
||||
// when "floating" (shown as popup) or tied to an edge
|
||||
function updateSize() {
|
||||
switch (plasmoid.location) {
|
||||
case PlasmaCore.Types.Floating:
|
||||
|
@ -33,13 +33,6 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
// update the size when becoming visible
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
updateSize()
|
||||
}
|
||||
}
|
||||
|
||||
// update the size when settings changed
|
||||
Connections {
|
||||
target: plasmoid.nativeInterface
|
||||
|
|
|
@ -11,8 +11,9 @@ Item {
|
|||
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
|
||||
Plasmoid.compactRepresentation: CompactRepresentation {
|
||||
}
|
||||
Plasmoid.fullRepresentation: FullRepresentation {
|
||||
focus: true
|
||||
Plasmoid.fullRepresentation: Loader {
|
||||
source: "FullRepresentation.qml"
|
||||
onLoaded: item.updateSize()
|
||||
}
|
||||
|
||||
Plasmoid.icon: "syncthingtray"
|
||||
|
|
Loading…
Reference in New Issue