Adding new properties for optimalWidth/Height

This commit is contained in:
Martin Gräßlin 2011-10-30 19:19:13 +01:00
parent 98b843e51f
commit a38c0e31ca
5 changed files with 20 additions and 10 deletions

View file

@ -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) {

View file

@ -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

View file

@ -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

View file

@ -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) {

View file

@ -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