From 6291c4852fdf8f18578a17eb329bd1530e0ed5e1 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 21 Mar 2018 18:37:11 +0000 Subject: [PATCH] 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 --- src/declarativeimports/plasmastyle/ButtonStyle.qml | 3 +-- src/declarativeimports/plasmastyle/ToolButtonStyle.qml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index 5de2e2b38..7ca4bfdda 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml index 77bc169de..3e9ce302a 100644 --- a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml @@ -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