better logic for text elide
This commit is contained in:
parent
2d297c1f6e
commit
13cba92e54
@ -87,14 +87,14 @@ Item {
|
|||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
implicitWidth: {
|
implicitWidth:
|
||||||
if (label.paintedWidth == 0) {
|
if (label.implicitWidth == 0) {
|
||||||
return height
|
height
|
||||||
} else {
|
} else {
|
||||||
//return Math.max(theme.defaultFont.mSize.width*12, label.paintedWidth)
|
//return Math.max(theme.defaultFont.mSize.width*12, label.paintedWidth)
|
||||||
return Math.max(theme.defaultFont.mSize.width*12, icon.width + label.paintedWidth + surfaceNormal.margins.left + surfaceNormal.margins.right) + ((icon.valid) ? surfaceNormal.margins.left : 0)
|
Math.max(theme.defaultFont.mSize.width*12, icon.width + label.implicitWidth + surfaceNormal.margins.left + surfaceNormal.margins.right) + ((icon.valid) ? surfaceNormal.margins.left : 0)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitHeight: Math.max(theme.defaultFont.mSize.height*1.6, Math.max(icon.height, label.paintedHeight) + surfaceNormal.margins.top/2 + surfaceNormal.margins.bottom/2)
|
implicitHeight: Math.max(theme.defaultFont.mSize.height*1.6, Math.max(icon.height, label.paintedHeight) + surfaceNormal.margins.top/2 + surfaceNormal.margins.bottom/2)
|
||||||
|
|
||||||
// TODO: needs to define if there will be specific graphics for
|
// TODO: needs to define if there will be specific graphics for
|
||||||
@ -249,6 +249,7 @@ Item {
|
|||||||
color: theme.buttonTextColor
|
color: theme.buttonTextColor
|
||||||
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
elide: button.width < button.implicitWidth ? Text.ElideRight : Text.ElideNone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user