@ -55,12 +55,9 @@ Item {
plasmoid . removeAction ( "configure" ) ;
}
property real leftItemsSizeHint: 0
property real rightItemsSizeHint: 0
property real middleItemsSizeHint: {
/ / E v e r y t i m e t h i s b i n d i n g g e t s r e e v a l u a t e d w e w a n t t o q u e u e a r e c o m p u t a t i o n o f t h e s i z e h i n t s
Qt . callLater ( root . updateHints )
if ( ! twinSpacer || ! panelLayout || ! leftTwin || ! rightTwin ) {
optimalSize = horizontal ? plasmoid.nativeInterface.containment.width : plasmoid . nativeInterface . containment . height ;
return 0 ;
}
@ -105,8 +102,13 @@ Item {
}
}
rightItemsSizeHint = rightItemsHint ;
leftItemsSizeHint = leftItemsHint ;
var halfContainment = root . horizontal ? plasmoid . nativeInterface . containment . width / 2 : plasmoid . nativeInterface . containment . height / 2 ;
if ( leftTwin == plasmoid ) {
optimalSize = Math . max ( PlasmaCore . Units . smallSpacing , halfContainment - middleItemsHint / 2 - leftItemsHint )
} else {
optimalSize = Math . max ( PlasmaCore . Units . smallSpacing , halfContainment - middleItemsHint / 2 - rightItemsHint )
}
return middleItemsHint ;
}
@ -134,22 +136,6 @@ Item {
}
}
function updateHints ( ) {
if ( ! twinSpacer || ! panelLayout || ! leftTwin || ! rightTwin ) {
root . optimalSize = root . horizontal ? plasmoid.nativeInterface.containment.width : plasmoid . nativeInterface . containment . height ;
return ;
}
var halfContainment = root . horizontal ? plasmoid . nativeInterface . containment . width / 2 : plasmoid . nativeInterface . containment . height / 2 ;
if ( leftTwin == plasmoid ) {
root . optimalSize = Math . max ( PlasmaCore . Units . smallSpacing , halfContainment - middleItemsSizeHint / 2 - leftItemsSizeHint )
} else {
root . optimalSize = Math . max ( PlasmaCore . Units . smallSpacing , halfContainment - middleItemsSizeHint / 2 - rightItemsSizeHint )
}
}
Rectangle {
anchors.fill: parent
color: PlasmaCore . Theme . highlightColor