Port to upstream QML components where possible

Basically:
- PlasmaExtras.Heading -> Kirigami.Heading
- PlasmaComponents3.Label -> QQC2.label

We can do this because these components only existed in the past to use
special Plasma colors, but no visual styling. And the color stuff is
obsolete because Kirigami colors work correctly in Plasma now.

Everything was tested with a dark Plasma theme and a light color scheme
to ensure no regressions.
This commit is contained in:
Nate Graham 2023-07-27 10:25:15 -06:00
parent a2df0707a9
commit fd04fe04c0
9 changed files with 21 additions and 18 deletions

View file

@ -10,7 +10,7 @@ import QtQuick
import QtQuick.Window
import org.kde.plasma.core as PlasmaCore
import org.kde.ksvg 1.0 as KSvg
import org.kde.plasma.extras as PlasmaExtras
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin
PlasmaCore.Dialog {
@ -66,7 +66,7 @@ PlasmaCore.Dialog {
width: dialogItem.showGrid ? view.itemWidth * view.columns : Math.ceil(textElement.implicitWidth)
height: dialogItem.showGrid ? view.itemHeight * view.rows + textElement.height : textElement.height
PlasmaExtras.Heading {
Kirigami.Heading {
id: textElement
anchors.top: dialogItem.showGrid ? parent.top : undefined
anchors.left: parent.left

View file

@ -7,10 +7,10 @@
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kwin as KWinComponents
import org.kde.kwin.private.effects
import org.kde.kirigami 2.20 as Kirigami
import org.kde.plasma.components 3.0 as PC3
import org.kde.kwin.private.desktopgrid
FocusScope {
@ -173,7 +173,7 @@ FocusScope {
cursorShape: dragHandler.active ? Qt.ClosedHandCursor : Qt.ArrowCursor
}
PC3.Control {
QQC2.Control {
id: desktopLabel
anchors.margins: Kirigami.Units.gridUnit
z: 9999
@ -293,7 +293,7 @@ FocusScope {
scale: 1 / desktopView.parent.scale
leftPadding: Kirigami.Units.smallSpacing
rightPadding: Kirigami.Units.smallSpacing
contentItem: PC3.Label {
contentItem: QQC2.Label {
text: desktopView.desktop.name
}
background: Rectangle {

View file

@ -5,7 +5,7 @@
*/
import QtQuick
import org.kde.plasma.components 3.0 as PlasmaComponents3
import QtQuick.Controls as QQC2
import org.kde.kirigami 2 as Kirigami
Rectangle {
@ -20,7 +20,7 @@ Rectangle {
implicitWidth: childrenRect.width + 2 * childrenRect.x
implicitHeight: childrenRect.height + 2 * childrenRect.y
PlasmaComponents3.Label {
QQC2.Label {
id: displayName
x: Kirigami.Units.largeSpacing * 2
y: Kirigami.Units.largeSpacing
@ -30,7 +30,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter;
}
PlasmaComponents3.Label {
QQC2.Label {
id: modeLabel;
anchors {
horizontalCenter: displayName.horizontalCenter

View file

@ -194,7 +194,7 @@ Item {
height: Kirigami.Units.gridUnit
state: "normal"
PC3.Label {
Label {
anchors.fill: parent
elide: Text.ElideRight
text: delegate.desktop.name

View file

@ -6,6 +6,7 @@
*/
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Window
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin as KWinComponents
@ -146,7 +147,7 @@ Item {
}
}
PC3.Label {
QQC2.Label {
anchors.fill: thumbSource
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
@ -166,7 +167,7 @@ Item {
anchors.bottomMargin: -Math.round(height / 4)
visible: !thumb.activeHidden && !activeDragHandler.active
PC3.Label {
QQC2.Label {
id: caption
visible: thumb.windowTitleVisible
width: Math.min(implicitWidth, thumbSource.width)

View file

@ -5,6 +5,7 @@
*/
import QtQuick
import QtQuick.Controls as QQC2
import Qt5Compat.GraphicalEffects
import QtQuick.Layouts
import org.kde.kwin as KWinComponents
@ -125,7 +126,7 @@ FocusScope {
}
}
PlasmaComponents.Control {
QQC2.Control {
z: 2
anchors.right: parent.right
y: root.active ? 0 : -height
@ -147,7 +148,7 @@ FocusScope {
}
}
contentItem: RowLayout {
PlasmaComponents.Label {
QQC2.Label {
text: i18nd("kwin","Padding:")
}
PlasmaComponents.SpinBox {

View file

@ -6,12 +6,12 @@
*/
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.plasma.core as PlasmaCore
import org.kde.kirigami 2.20 as Kirigami
import org.kde.ksvg 1.0 as KSvg
import org.kde.plasma.components 3.0 as PlasmaComponents
Item {
id: root
@ -49,7 +49,7 @@ Item {
source: root.effectFrame.icon
}
PlasmaComponents.Label {
QQC2.Label {
id: label
Layout.fillWidth: true
textFormat: Text.PlainText

View file

@ -6,12 +6,12 @@
*/
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import QtQuick.Window
import org.kde.plasma.core as PlasmaCore
import org.kde.kirigami 2.20 as Kirigami
import org.kde.plasma.components 3.0 as PlasmaComponents3
PlasmaCore.Dialog {
location: PlasmaCore.Types.Floating
@ -28,7 +28,7 @@ PlasmaCore.Dialog {
source: osd.iconName
visible: osd.iconName !== ""
}
PlasmaComponents3.Label {
QQC2.Label {
text: osd.message
}
}

View file

@ -9,6 +9,7 @@
*/
import QtQuick 2.0
import QtQuick.Controls as QQC2
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.ksvg 1.0 as KSvg
@ -185,7 +186,7 @@ KWin.TabBoxSwitcher {
}
}
PlasmaComponents3.Label {
QQC2.Label {
Layout.fillWidth: true
text: model.caption
font.weight: thumbnailGridItem.isCurrentItem ? Font.Bold : Font.Normal