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