remove anchors of item in a layout

Summary:
Having an anchor is undefined, and emits a warning in Qt5.11

Mostly it's used to vertically centre items. Some cases already had a
Layout.alignment property. In some cases it was added.

Reviewers: #plasma

Subscribers: #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D11557
This commit is contained in:
David Edmundson 2018-03-21 18:37:11 +00:00
parent 33ddaaa23f
commit 6291c4852f
2 changed files with 2 additions and 4 deletions

View File

@ -59,7 +59,6 @@ QtQuickControlStyle.ButtonStyle {
PlasmaCore.IconItem {
id: icon
source: control.iconName || control.iconSource
anchors.verticalCenter: parent.verticalCenter
Layout.minimumWidth: valid ? units.iconSizes.tiny : 0
Layout.preferredWidth: valid ? units.iconSizes.small : 0
visible: valid
@ -72,7 +71,7 @@ QtQuickControlStyle.ButtonStyle {
PlasmaComponents.Label {
id: label
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
text: Util.stylizeEscapedMnemonics(Util.toHtmlEscaped(control.text))
textFormat: Text.StyledText
font: control.font || theme.defaultFont

View File

@ -69,7 +69,6 @@ QtQuickControlStyle.ButtonStyle {
PlasmaCore.IconItem {
id: icon
source: control.iconName || control.iconSource
anchors.verticalCenter: parent.verticalCenter
implicitHeight: label.implicitHeight
implicitWidth: implicitHeight
@ -94,8 +93,8 @@ QtQuickControlStyle.ButtonStyle {
PlasmaComponents.Label {
id: label
anchors.verticalCenter: parent.verticalCenter
Layout.minimumWidth: implicitWidth
Layout.alignment: Qt.AlignVCenter
text: Util.stylizeEscapedMnemonics(Util.toHtmlEscaped(control.text))
textFormat: Text.StyledText
font: control.font || theme.defaultFont