diff --git a/tabbox/qml/big_icons.qml b/tabbox/qml/big_icons.qml index 4d8162d5d1..fa39827be2 100644 --- a/tabbox/qml/big_icons.qml +++ b/tabbox/qml/big_icons.qml @@ -26,8 +26,10 @@ Item { property int screenWidth : 0 property int screenHeight : 0 property int imagePathPrefix: (new Date()).getTime() - width: Math.min(Math.max(screenWidth * 0.3, (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom), screenWidth * 0.9) - height: Math.min(Math.max(screenHeight * 0.05, icons.iconSize + icons.margins.top + icons.margins.bottom + background.margins.top + background.margins.bottom), screenHeight * 0.5) + property int optimalWidth: (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom + property int optimalHeight: icons.iconSize + icons.margins.top + icons.margins.bottom + background.margins.top + background.margins.bottom + width: Math.min(Math.max(screenWidth * 0.3, optimalWidth), screenWidth * 0.9) + height: Math.min(Math.max(screenHeight * 0.05, optimalHeight), screenHeight * 0.5) function setModel(model) { diff --git a/tabbox/qml/compact.qml b/tabbox/qml/compact.qml index ee2dee67ea..0e9f4dd8c0 100644 --- a/tabbox/qml/compact.qml +++ b/tabbox/qml/compact.qml @@ -27,8 +27,10 @@ Item { property int screenHeight : 0 property string longestCaption: "" property int imagePathPrefix: (new Date()).getTime() - width: Math.min(Math.max(screenWidth * 0.2, compactListView.maxRowWidth), screenWidth * 0.8) - height: Math.min(Math.max(screenHeight * 0.2, compactListView.rowHeight * compactListView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8) + property int optimalWidth: compactListView.maxRowWidth + property int optimalHeight: compactListView.rowHeight * compactListView.count + background.margins.top + background.margins.bottom + width: Math.min(Math.max(screenWidth * 0.2, optimalWidth), screenWidth * 0.8) + height: Math.min(Math.max(screenHeight * 0.2, optimalHeight), screenHeight * 0.8) property int textMargin: 2 diff --git a/tabbox/qml/informative.qml b/tabbox/qml/informative.qml index 1078cca2b0..5b165af3fc 100644 --- a/tabbox/qml/informative.qml +++ b/tabbox/qml/informative.qml @@ -28,8 +28,10 @@ Item { property bool allDesktops: true property string longestCaption: "" property int imagePathPrefix: (new Date()).getTime() - width: Math.min(Math.max(screenWidth * 0.2, listView.maxRowWidth), screenWidth * 0.8) - height: Math.min(Math.max(screenHeight * 0.2, listView.rowHeight * listView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8) + property int optimalWidth: listView.maxRowWidth + property int optimalHeight: listView.rowHeight * listView.count + background.margins.top + background.margins.bottom + width: Math.min(Math.max(screenWidth * 0.2, optimalWidth), screenWidth * 0.8) + height: Math.min(Math.max(screenHeight * 0.2, optimalHeight), screenHeight * 0.8) property int textMargin: 2 diff --git a/tabbox/qml/small_icons.qml b/tabbox/qml/small_icons.qml index 8d8c6c40cf..8bab5ba0af 100644 --- a/tabbox/qml/small_icons.qml +++ b/tabbox/qml/small_icons.qml @@ -26,8 +26,10 @@ Item { property int screenWidth : 0 property int screenHeight : 0 property int imagePathPrefix: (new Date()).getTime() - width: Math.min(Math.max(screenWidth * 0.1, (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom), screenWidth * 0.9) - height: Math.min(Math.max(screenHeight * 0.05, icons.iconSize + icons.margins.top + icons.margins.bottom + background.margins.top + background.margins.bottom), screenHeight * 0.5) + property int optimalWidth: (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom + property int optimalHeight: icons.iconSize + icons.margins.top + icons.margins.bottom + background.margins.top + background.margins.bottom + width: Math.min(Math.max(screenWidth * 0.1, optimalWidth), screenWidth * 0.9) + height: Math.min(Math.max(screenHeight * 0.05, optimalHeight), screenHeight * 0.5) function setModel(model) { diff --git a/tabbox/qml/text.qml b/tabbox/qml/text.qml index 900173c390..9cdc7ef6b9 100644 --- a/tabbox/qml/text.qml +++ b/tabbox/qml/text.qml @@ -26,8 +26,10 @@ Item { property int screenWidth : 0 property int screenHeight : 0 property string longestCaption: "" - width: Math.min(Math.max(screenWidth * 0.2, textListView.maxRowWidth), screenWidth * 0.8) - height: Math.min(Math.max(screenHeight * 0.2, textListView.rowHeight * textListView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8) + property int optimalWidth: textListView.maxRowWidth + property int optimalHeight: textListView.rowHeight * textListView.count + background.margins.top + background.margins.bottom + width: Math.min(Math.max(screenWidth * 0.2, optimalWidth), screenWidth * 0.8) + height: Math.min(Math.max(screenHeight * 0.2, optimalHeight), screenHeight * 0.8) property int textMargin: 2