Commit ae555055 authored by David Edmundson's avatar David Edmundson

[kcm] Don't transform button to show rotated icon

Summary:
Rotating a button leads to tooltips being broken, it will lead to
shadows being broken on a theme that uses shadows and is generally not
great.

This patch sets the contentItem explicitly and rotates that

BUG: 412092

Reviewers: #plasma, ngraham, romangg

Reviewed By: #plasma, ngraham, romangg

Subscribers: romangg, mart, ngraham, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24488
parent ba20c56a
......@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.4 as Controls
import org.kde.kirigami 2.4 as Kirigami
import org.kde.private.kcm.kscreen 1.0 as KScreen
Controls.ToolButton {
......@@ -29,13 +30,17 @@ Controls.ToolButton {
Layout.fillWidth: true
height: childrenRect.height
icon.name: "view-preview"
checked: element.rotation === rot
Controls.ToolTip {
text: tooltip
}
contentItem: Kirigami.Icon {
source: "view-preview"
rotation: root.value
}
onClicked: {
if (element.rotation === rot) {
return;
......@@ -45,16 +50,9 @@ Controls.ToolButton {
screen.resetTotalSize();
}
implicitWidth: 45
implicitHeight: 45
implicitWidth: contentItem.implicitWidth + 2 * Kirigami.Units.smallSpacing
implicitHeight: contentItem.implicitHeight + 2 * Kirigami.Units.smallSpacing
transform: Rotation {
origin {
x: root.width / 2
y: root.height / 2
}
angle: root.value
}
Component.onCompleted: {
switch(value) {
case 90:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment