Adding new properties for optimalWidth/Height
parent
98b843e51f
commit
a38c0e31ca
|
@ -26,8 +26,10 @@ Item {
|
||||||
property int screenWidth : 0
|
property int screenWidth : 0
|
||||||
property int screenHeight : 0
|
property int screenHeight : 0
|
||||||
property int imagePathPrefix: (new Date()).getTime()
|
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)
|
property int optimalWidth: (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom
|
||||||
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 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) {
|
function setModel(model) {
|
||||||
|
|
|
@ -27,8 +27,10 @@ Item {
|
||||||
property int screenHeight : 0
|
property int screenHeight : 0
|
||||||
property string longestCaption: ""
|
property string longestCaption: ""
|
||||||
property int imagePathPrefix: (new Date()).getTime()
|
property int imagePathPrefix: (new Date()).getTime()
|
||||||
width: Math.min(Math.max(screenWidth * 0.2, compactListView.maxRowWidth), screenWidth * 0.8)
|
property int optimalWidth: compactListView.maxRowWidth
|
||||||
height: Math.min(Math.max(screenHeight * 0.2, compactListView.rowHeight * compactListView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8)
|
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
|
property int textMargin: 2
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,10 @@ Item {
|
||||||
property bool allDesktops: true
|
property bool allDesktops: true
|
||||||
property string longestCaption: ""
|
property string longestCaption: ""
|
||||||
property int imagePathPrefix: (new Date()).getTime()
|
property int imagePathPrefix: (new Date()).getTime()
|
||||||
width: Math.min(Math.max(screenWidth * 0.2, listView.maxRowWidth), screenWidth * 0.8)
|
property int optimalWidth: listView.maxRowWidth
|
||||||
height: Math.min(Math.max(screenHeight * 0.2, listView.rowHeight * listView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8)
|
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
|
property int textMargin: 2
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@ Item {
|
||||||
property int screenWidth : 0
|
property int screenWidth : 0
|
||||||
property int screenHeight : 0
|
property int screenHeight : 0
|
||||||
property int imagePathPrefix: (new Date()).getTime()
|
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)
|
property int optimalWidth: (icons.iconSize + icons.margins.left + icons.margins.right) * icons.count + background.margins.left + background.margins.bottom
|
||||||
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 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) {
|
function setModel(model) {
|
||||||
|
|
|
@ -26,8 +26,10 @@ Item {
|
||||||
property int screenWidth : 0
|
property int screenWidth : 0
|
||||||
property int screenHeight : 0
|
property int screenHeight : 0
|
||||||
property string longestCaption: ""
|
property string longestCaption: ""
|
||||||
width: Math.min(Math.max(screenWidth * 0.2, textListView.maxRowWidth), screenWidth * 0.8)
|
property int optimalWidth: textListView.maxRowWidth
|
||||||
height: Math.min(Math.max(screenHeight * 0.2, textListView.rowHeight * textListView.count + background.margins.top + background.margins.bottom), screenHeight * 0.8)
|
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
|
property int textMargin: 2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue