make all heights in the calendar header to be even

the layout engine has a bug
https://bugreports.qt.io/browse/QTBUG-58307
that if some items have an odd height, some an even height,
the smallest items are resized by half pixel to try to
really center it, breaking rendering
BUG:375318

Reviewed-by:David Edmundson
This commit is contained in:
Marco Martin 2017-01-20 14:30:16 +01:00
parent 1d12abf334
commit b629bdcf08

View File

@ -103,6 +103,9 @@ Item {
level: 1
elide: Text.ElideRight
font.capitalization: Font.Capitalize
//SEE QTBUG-58307
//try to make all heights an even number, otherwise the layout engine gets confused
Layout.preferredHeight: implicitHeight + implicitHeight%2
MouseArea {
id: monthMouse
@ -145,6 +148,8 @@ Item {
iconName: Qt.application.layoutDirection === Qt.RightToLeft ? "go-next" : "go-previous"
onClicked: daysCalendar.previous()
Accessible.name: tooltip
//SEE QTBUG-58307
Layout.preferredHeight: implicitHeight + implicitHeight%2
}
Components.ToolButton {
@ -153,6 +158,8 @@ Item {
tooltip: i18ndc("libplasma5", "Reset calendar to today", "Today")
Accessible.name: tooltip
Accessible.description: i18nd("libplasma5", "Reset calendar to today")
//SEE QTBUG-58307
Layout.preferredHeight: implicitHeight + implicitHeight%2
}
Components.ToolButton {
@ -160,6 +167,8 @@ Item {
iconName: Qt.application.layoutDirection === Qt.RightToLeft ? "go-previous" : "go-next"
onClicked: daysCalendar.next()
Accessible.name: tooltip
//SEE QTBUG-58307
Layout.preferredHeight: implicitHeight + implicitHeight%2
}
}