mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 17:54:45 +00:00
port to Kirigami.Icon
Part of https://invent.kde.org/plasma/plasma-workspace/-/issues/82 PlasmaCore.IconItem will be removed; now only the kirigami icon should be used.
This commit is contained in:
parent
f29299d9fc
commit
42cccf8e7f
21 changed files with 26 additions and 38 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import org.kde.kirigami 2.12 as Kirigami
|
import org.kde.kirigami 2.20 as Kirigami
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.plasma5support 2.0 as P5Support
|
import org.kde.plasma.plasma5support 2.0 as P5Support
|
||||||
|
|
@ -89,7 +89,7 @@ Item {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.leftMargin: Kirigami.Units.smallSpacing
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
|
|
@ -121,7 +121,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ QuickSettingsDelegate {
|
||||||
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ QuickSettingsDelegate {
|
||||||
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ Controls.AbstractButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
readonly property real side: Math.min(button.width, button.height)
|
readonly property real side: Math.min(button.width, button.height)
|
||||||
anchors {
|
anchors {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ Controls.ItemDelegate {
|
||||||
|
|
||||||
property string label
|
property string label
|
||||||
property alias listIcon: clientIcon.source
|
property alias listIcon: clientIcon.source
|
||||||
property alias iconUsesPlasmaTheme: clientIcon.usesPlasmaTheme
|
|
||||||
property string type // sink, source, source-output
|
property string type // sink, source, source-output
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
@ -49,7 +48,7 @@ Controls.ItemDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
// application icon
|
// application icon
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: clientIcon
|
id: clientIcon
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
|
|
|
||||||
|
|
@ -40,5 +40,4 @@ ListItemBase {
|
||||||
|
|
||||||
return "audio-volume-high"
|
return "audio-volume-high"
|
||||||
}
|
}
|
||||||
iconUsesPlasmaTheme: false
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ Item {
|
||||||
Item {
|
Item {
|
||||||
implicitHeight: queryField.height
|
implicitHeight: queryField.height
|
||||||
implicitWidth: height
|
implicitWidth: height
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Math.round(Kirigami.Units.smallSpacing)
|
anchors.margins: Math.round(Kirigami.Units.smallSpacing)
|
||||||
source: "start-here-symbolic"
|
source: "start-here-symbolic"
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,13 @@ RowLayout {
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
Layout.preferredHeight: Math.max(applicationNameLabel.implicitHeight, Kirigami.Units.iconSizes.small)
|
Layout.preferredHeight: Math.max(applicationNameLabel.implicitHeight, Kirigami.Units.iconSizes.small)
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: applicationIconItem
|
id: applicationIconItem
|
||||||
Layout.topMargin: Kirigami.Units.smallSpacing
|
Layout.topMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
||||||
source: notificationHeading.applicationIconSource
|
source: notificationHeading.applicationIconSource
|
||||||
usesPlasmaTheme: false
|
|
||||||
visible: valid
|
visible: valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,12 +127,11 @@ BaseNotificationItem {
|
||||||
|
|
||||||
visible: iconItem.active
|
visible: iconItem.active
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: iconItem
|
id: iconItem
|
||||||
// don't show two identical icons
|
// don't show two identical icons
|
||||||
readonly property bool active: valid && source != notificationItem.applicationIconSource
|
readonly property bool active: valid && source != notificationItem.applicationIconSource
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
usesPlasmaTheme: false
|
|
||||||
smooth: true
|
smooth: true
|
||||||
// don't show a generic "info" icon since this is a notification already
|
// don't show a generic "info" icon since this is a notification already
|
||||||
source: notificationItem.icon !== "dialog-information" ? notificationItem.icon : ""
|
source: notificationItem.icon !== "dialog-information" ? notificationItem.icon : ""
|
||||||
|
|
|
||||||
|
|
@ -92,11 +92,10 @@ MouseArea {
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: height
|
width: height
|
||||||
height: Kirigami.Units.iconSizes.roundedIconSize(parent.height)
|
height: Kirigami.Units.iconSizes.roundedIconSize(parent.height)
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: !thumbnailer.busy && !thumbnailer.hasPreview ? thumbnailer.iconName : ""
|
source: !thumbnailer.busy && !thumbnailer.hasPreview ? thumbnailer.iconName : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
}
|
}
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||||
|
|
@ -165,7 +165,6 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
Layout.minimumHeight: Math.min(Kirigami.Units.iconSizes.large, parent.height - delegate.reservedSpaceForLabel)
|
Layout.minimumHeight: Math.min(Kirigami.Units.iconSizes.large, parent.height - delegate.reservedSpaceForLabel)
|
||||||
Layout.preferredHeight: Layout.minimumHeight
|
Layout.preferredHeight: Layout.minimumHeight
|
||||||
|
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: modelData ? modelData.applicationIcon : ""
|
source: modelData ? modelData.applicationIcon : ""
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ MouseArea {
|
||||||
}
|
}
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||||
|
|
@ -116,7 +116,6 @@ MouseArea {
|
||||||
Layout.minimumHeight: Math.floor(parent.height - delegate.reservedSpaceForLabel)
|
Layout.minimumHeight: Math.floor(parent.height - delegate.reservedSpaceForLabel)
|
||||||
Layout.preferredHeight: Layout.minimumHeight
|
Layout.preferredHeight: Layout.minimumHeight
|
||||||
|
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: model.applicationIcon
|
source: model.applicationIcon
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ MouseArea {
|
||||||
}
|
}
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignLeft
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
|
@ -71,7 +71,6 @@ MouseArea {
|
||||||
Layout.minimumHeight: parent.height
|
Layout.minimumHeight: parent.height
|
||||||
Layout.preferredHeight: Layout.minimumHeight
|
Layout.preferredHeight: Layout.minimumHeight
|
||||||
|
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: model.applicationIcon
|
source: model.applicationIcon
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -270,10 +270,9 @@ Item {
|
||||||
opacity: delegate.dragFolderAnimationProgress
|
opacity: delegate.dragFolderAnimationProgress
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: delegate.isFolder ? 'document-open-folder' : delegate.applicationIcon
|
source: delegate.isFolder ? 'document-open-folder' : delegate.applicationIcon
|
||||||
|
|
||||||
transform: Scale {
|
transform: Scale {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ MouseArea {
|
||||||
}
|
}
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
Kirigami.Theme.inherit: false
|
Kirigami.Theme.inherit: false
|
||||||
|
|
|
||||||
|
|
@ -165,11 +165,10 @@ Item {
|
||||||
NumberAnimation { duration: Kirigami.Units.shortDuration }
|
NumberAnimation { duration: Kirigami.Units.shortDuration }
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
|
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
|
||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
usesPlasmaTheme: false
|
|
||||||
source: delegate.window.icon
|
source: delegate.window.icon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ FocusScope {
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
implicitWidth: Kirigami.Units.iconSizes.large
|
implicitWidth: Kirigami.Units.iconSizes.large
|
||||||
|
|
|
||||||
|
|
@ -174,13 +174,13 @@ Rectangle {
|
||||||
color: keypadRoot.buttonTextColor
|
color: keypadRoot.buttonTextColor
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
visible: modelData === "R"
|
visible: modelData === "R"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
source: "edit-clear"
|
source: "edit-clear"
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
visible: modelData === "E"
|
visible: modelData === "E"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
source: "go-next"
|
source: "go-next"
|
||||||
|
|
|
||||||
|
|
@ -169,13 +169,13 @@ Item {
|
||||||
anchors.bottomMargin: Kirigami.Units.gridUnit + flickable.position * 0.5
|
anchors.bottomMargin: Kirigami.Units.gridUnit + flickable.position * 0.5
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
sourceComponent: PlasmaCore.IconItem {
|
sourceComponent: Kirigami.Icon {
|
||||||
id: scrollUpIcon
|
id: scrollUpIcon
|
||||||
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
||||||
opacity: 1 - flickable.openFactor
|
opacity: 1 - flickable.openFactor
|
||||||
|
|
||||||
colorGroup: Kirigami.Theme.ComplementaryColorGroup
|
Kirigami.Theme.colorSet: Kirigami.Theme.ComplementaryColorGroup
|
||||||
source: "arrow-up"
|
source: "arrow-up"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -215,12 +215,12 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
// scroll down icon
|
// scroll down icon
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.bottomMargin: Kirigami.Units.gridUnit
|
Layout.bottomMargin: Kirigami.Units.gridUnit
|
||||||
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
||||||
colorGroup: Kirigami.Theme.ComplementaryColorGroup
|
Kirigami.Theme.colorSet: Kirigami.Theme.ComplementaryColorGroup
|
||||||
source: "arrow-down"
|
source: "arrow-down"
|
||||||
opacity: Math.sin((Math.PI / 2) * flickable.openFactor + 1.5 * Math.PI) + 1
|
opacity: Math.sin((Math.PI / 2) * flickable.openFactor + 1.5 * Math.PI) + 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
id: icon
|
id: icon
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: buttonRect.verticalCenter
|
verticalCenter: buttonRect.verticalCenter
|
||||||
|
|
@ -53,8 +53,6 @@ Item {
|
||||||
}
|
}
|
||||||
width: iconSize
|
width: iconSize
|
||||||
height: iconSize
|
height: iconSize
|
||||||
|
|
||||||
colorSet: Kirigami.Theme.colorSet
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents3.Label {
|
PlasmaComponents3.Label {
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ Controls.Drawer {
|
||||||
|
|
||||||
z: wallpapersView.currentIndex === index ? 2 : 0
|
z: wallpapersView.currentIndex === index ? 2 : 0
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
PlasmaCore.IconItem {
|
Kirigami.Icon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: Kirigami.Units.iconSizes.large
|
width: Kirigami.Units.iconSizes.large
|
||||||
height: width
|
height: width
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue