@ -1377,11 +1377,17 @@ Item {
}
function updateAutomaticIconSize ( ) {
if ( ! block AutomaticUpdateIconSize. running && ! visibilityManager . inTempHiding
if ( ! doubleCall AutomaticUpdateIconSize. running && ! visibilityManager . inTempHiding
&& ( ( visibilityManager . normalState || root . editMode )
&& ( root . autoDecreaseIconSize || ( ! root . autoDecreaseIconSize && root . iconSize != root . maxIconSize ) ) )
&& ( iconSize === root . maxIconSize || iconSize === automaticIconSizeBasedSize ) ) {
blockAutomaticUpdateIconSize . start ( ) ;
/ / ! d o u b l e r t i m e r
if ( ! doubleCallAutomaticUpdateIconSize . secondTimeCallApplied ) {
doubleCallAutomaticUpdateIconSize . start ( ) ;
} else {
doubleCallAutomaticUpdateIconSize . secondTimeCallApplied = false ;
}
var layoutLength ;
var maxLength = root . maxLength ;
@ -1397,12 +1403,15 @@ Item {
layoutsContainer . startLayout . width + layoutsContainer . mainLayout . width + layoutsContainer.endLayout.width : layoutsContainer . mainLayout . width
}
var toShrinkLimit = maxLength - ( ( root . zoomFactor - 1 ) * ( iconSize + thickMargins ) ) ;
var toGrowLimit = maxLength - 1.5 * ( ( root . zoomFactor - 1 ) * ( iconSize + thickMargins ) ) ;
var toShrinkLimit = maxLength - ( ( 1 + ( root . zoomFactor - 1 ) ) * ( iconSize + lengthMargins ) ) ;
var toGrowLimit = maxLength - ( ( 1 + ( root . zoomFactor - 1 ) ) * ( iconSize + lengthMargins ) ) ;
/ / c o n s o l e . l o g ( " t o S h r i n k L i m i t : " + t o S h r i n k L i m i t ) ;
/ / c o n s o l e . l o g ( " t o G r o w L i m i t : " + t o G r o w L i m i t ) ;
var newIconSizeFound = false ;
if ( layoutLength > toShrinkLimit ) { / / m u s t s h r i n k
/ / co n s o l e . l o g ( " s t e p 3 " ) ;
/ / co n s o l e . l o g ( " s t e p 3 " ) ;
var nextIconSize = root . maxIconSize ;
do {
@ -1414,10 +1423,10 @@ Item {
automaticIconSizeBasedSize = nextIconSize ;
newIconSizeFound = true ;
console . log ( "Step 3 - found:" + automaticIconSizeBasedSize ) ;
/ / c o n s o l e . l o g ( " S t e p 3 - f o u n d : " + a u t o m a t i c I c o n S i z e B a s e d S i z e ) ;
} else if ( ( layoutLength < toGrowLimit
&& ( iconSize === automaticIconSizeBasedSize ) ) ) { / / m u s t g r o w p r o b a b l y
/ / co n s o l e . l o g ( " s t e p 4 " ) ;
/ / co n s o l e . l o g ( " s t e p 4 " ) ;
var nextIconSize2 = automaticIconSizeBasedSize ;
var foundGoodSize = - 1 ;
@ -1906,13 +1915,19 @@ Item {
}
}
/ / T h i s f u n c t i o n i s v e r y c o s t l y ! T h i s t i m e r m a k e s s u r e t h a t i t c a n b e c a l l e d
/ / o n l y o n c e e v e r y 1 s e c .
/ / ! T h i s f u n c t i o n s m a k e s s u r e t o c a l l t h e u p d a t e A u t o m a t i c I c o n S i z e ( ) ; f u n c t i o n w h i c h i s c o s t l y
/ / ! o n e m o r e t i m e a f t e r i t s l a s t c a l l t o c o n f i r m t h e a p p l i e d i c o n s i z e f o u n d
Timer {
id: block AutomaticUpdateIconSize
id: doubleCall AutomaticUpdateIconSize
interval: 1000
repeat: false
onTriggered: root . updateAutomaticIconSize ( ) ;
property bool secondTimeCallApplied: false
onTriggered: {
if ( ! secondTimeCallApplied ) {
secondTimeCallApplied = true ;
root . updateAutomaticIconSize ( ) ;
}
}
}
/ / ! I t i s u s e d i n o r d e r t o s l i d e - i n t h e l a t t e V i e w o n s t a r t u p