square button if icon only

This commit is contained in:
Marco Martin 2011-11-10 14:29:39 +01:00
parent 63eb84ce80
commit 9303301e83

View File

@ -35,7 +35,13 @@ Item {
signal clicked()
width: Math.max(theme.defaultFont.mSize.width*12, icon.width + label.paintedWidth + surfaceNormal.margins.left + surfaceNormal.margins.right) + ((icon.valid) ? surfaceNormal.margins.left : 0);
width: {
if (label.paintedWidth == 0) {
return height
} else {
return Math.max(theme.defaultFont.mSize.width*12, icon.width + label.paintedWidth + surfaceNormal.margins.left + surfaceNormal.margins.right) + ((icon.valid) ? surfaceNormal.margins.left : 0)
}
}
height: Math.max(theme.defaultFont.mSize.height*1.8, Math.max(icon.height, label.paintedHeight) + surfaceNormal.margins.top + surfaceNormal.margins.bottom)
// TODO: needs to define if there will be specific graphics for