Commit 959bc000 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Port mostly to PlasmaComponents3

The remaining things that cannot be easily ported yet are marked as such
in the import lines so you can run `grep "org.kde.plasma.components 2.0"`
in the repo to easily see what they are.

Everything is tested and there are no regressions.
parent 4854cd0e
......@@ -32,7 +32,6 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components
Item {
id: main
......
......@@ -26,7 +26,6 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.calendar 2.0 as PlasmaCalendar
......
......@@ -298,8 +298,8 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the clear button", "C");
onClicked: clearClicked();
}
......@@ -307,8 +307,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the division button", "÷");
onClicked: setOperator("/");
}
......@@ -316,8 +315,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the multiplication button", "×");
onClicked: setOperator("*");
}
......@@ -325,8 +323,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the all clear button", "AC");
onClicked: allClearClicked();
}
......@@ -335,8 +332,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "7";
onClicked: digitClicked(7);
}
......@@ -344,8 +340,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "8";
onClicked: digitClicked(8);
}
......@@ -353,8 +348,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "9";
onClicked: digitClicked(9);
}
......@@ -362,8 +356,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the minus button", "-");
onClicked: setOperator("-");
}
......@@ -372,8 +365,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "4";
onClicked: digitClicked(4);
}
......@@ -381,8 +373,8 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "5";
onClicked: digitClicked(5);
}
......@@ -390,8 +382,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "6";
onClicked: digitClicked(6);
}
......@@ -399,8 +390,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: i18nc("Text of the plus button", "+");
onClicked: setOperator("+");
}
......@@ -409,8 +399,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "1";
onClicked: digitClicked(1);
}
......@@ -418,8 +407,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "2";
onClicked: digitClicked(2);
}
......@@ -427,8 +415,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: "3";
onClicked: digitClicked(3);
}
......@@ -437,8 +424,7 @@ QQC2.Control {
id: ansButton;
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
Layout.rowSpan: 2
text: i18nc("Text of the equals button", "=");
onClicked: equalsClicked();
......@@ -447,8 +433,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
Layout.columnSpan: 2
text: "0";
onClicked: digitClicked(0);
......@@ -457,8 +442,7 @@ QQC2.Control {
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: minimumWidth
Layout.minimumHeight: minimumHeight
text: Qt.locale().decimalPoint;
onClicked: decimalClicked();
}
......
......@@ -23,7 +23,8 @@ import QtQuick.Dialogs 1.0 as QtDialogs
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for Highlight and ModelContextMenu and deficiencies with PC3 ToolButton+ToolTip (see inline TODOs)
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.draganddrop 2.0
......@@ -116,6 +117,9 @@ Item {
Layout.minimumWidth: isVertical ? units.iconSizes.small : ((height * 2) + spacer.width)
Layout.minimumHeight: isVertical ? ((width * 2) + spacer.height) : units.iconSizes.small
// TODO: Still PC2 for now because:
// - It never loses visible focus despite panel widgets never getting focus anyway: https://bugs.kde.org/show_bug.cgi?id=424446
// - PC3.ToolTip has visual glitches: https://bugs.kde.org/show_bug.cgi?id=424448
PlasmaComponents.ToolButton {
width: buttonSize
height: buttonSize
......@@ -178,6 +182,9 @@ Item {
containsAcceptableDrag = false
}
// TODO: Still PC2 for now because:
// - It never loses visible focus despite panel widgets never getting focus anyway: https://bugs.kde.org/show_bug.cgi?id=424446
// - PC3.ToolTip visual glitches: https://bugs.kde.org/show_bug.cgi?id=424448
PlasmaComponents.ToolButton {
id: colorButton
anchors.fill: parent
......@@ -266,7 +273,7 @@ Item {
highlight: PlasmaComponents.Highlight {}
highlightMoveDuration: 0
PlasmaComponents.Button {
PlasmaComponents3.Button {
anchors.centerIn: parent
text: i18nc("@action:button", "Pick Color")
visible: fullRoot.count === 0
......@@ -381,7 +388,7 @@ Item {
color: theme.backgroundColor
opacity: 0.8
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: colorLabel
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
......
......@@ -17,7 +17,7 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
Item {
id: root
......@@ -46,23 +46,23 @@ Item {
spacing: 4
//ToolButton or Button in C++ use PushButton?
PlasmaComponents.Button {
PlasmaComponents3.Button {
id: prevButton
iconSource: "arrow-left"
icon.name: "arrow-left"
enabled: (comicData.prev != undefined && comicData.prev.length > 0)
}
PlasmaComponents.Button {
PlasmaComponents3.Button {
id: zoomButton
iconSource: "zoom-original"
icon.name: "zoom-original"
}
PlasmaComponents.Button {
PlasmaComponents3.Button {
id: nextButton
iconSource: "arrow-right"
icon.name: "arrow-right"
enabled: (comicData.next != undefined && comicData.next.length > 0)
}
}
......
......@@ -17,7 +17,7 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kquickcontrolsaddons 2.0
Item {
......@@ -32,7 +32,7 @@ Item {
visible: (comicIdentifier.text.length > 0 || comicUrl.text.length > 0)
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: comicIdentifier
anchors {
......@@ -73,7 +73,7 @@ Item {
}
}
PlasmaComponents.Label {
PlasmaComponents3.Label {
id:comicUrl
anchors {
......
......@@ -17,7 +17,7 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kquickcontrolsaddons 2.0
Item {
......@@ -28,7 +28,7 @@ Item {
property variant comicData
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: arrowLeft
anchors {
......@@ -36,7 +36,7 @@ Item {
verticalCenter: root.verticalCenter
}
iconSource: "go-previous"
icon.name: "go-previous"
visible: (!plasmoid.nativeInterface.arrowsOnHover && (comicData.prev !== undefined))
onClicked: {
......@@ -120,7 +120,7 @@ Item {
}
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: arrowRight
anchors {
......@@ -128,7 +128,7 @@ Item {
verticalCenter: root.verticalCenter
}
iconSource: "go-next"
icon.name: "go-next"
visible: (!plasmoid.nativeInterface.arrowsOnHover && (comicData.next !== undefined))
onClicked: {
......
......@@ -17,7 +17,6 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kquickcontrolsaddons 2.0
import QtQuick.Layouts 1.1
......
......@@ -17,7 +17,6 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kquickcontrolsaddons 2.0
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // PC3 TabBar+TabButton need work first
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kquickcontrolsaddons 2.0
Item {
......@@ -128,7 +129,7 @@ Item {
}
}
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: topInfo
anchors {
......
......@@ -18,7 +18,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.core 2.0 as PlasmaCore
import QtWebEngine 1.1
......@@ -35,7 +35,7 @@ ColumnLayout {
RowLayout {
Layout.fillWidth: true
PlasmaComponents.TextField {
PlasmaComponents3.TextField {
id: input
placeholderText: i18nc("@info:placeholder", "Enter word to define here")
implicitWidth: units.gridUnit * 40
......@@ -48,8 +48,8 @@ ColumnLayout {
}
}
}
PlasmaComponents.Button {
iconSource: "configure"
PlasmaComponents3.Button {
icon.name: "configure"
onClicked: plasmoid.action("configure").trigger();
}
}
......
......@@ -20,11 +20,12 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.components 2.0 as PlasmaComponents // for ListItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.private.diskquota 1.0
Components.ListItem {
PlasmaComponents.ListItem {
id: quotaItem
property string mountPoint
property string details
......@@ -63,24 +64,22 @@ Components.ListItem {
RowLayout {
width: parent.width
Components.Label {
PlasmaComponents3.Label {
Layout.fillWidth: true
height: paintedHeight
text: details
}
Components.Label {
PlasmaComponents3.Label {
Layout.fillWidth: true
height: paintedHeight
horizontalAlignment: Text.AlignRight
text: freeString
opacity: 0.6
}
}
Components.ProgressBar {
PlasmaComponents3.ProgressBar {
width: parent.width
value: usage
minimumValue: 0
maximumValue: 100
from: 0
to: 100
// HACK to make progressbar clickable
MouseArea {
anchors.fill: parent
......@@ -89,8 +88,7 @@ Components.ListItem {
}
}
}
Components.Label {
height: paintedHeight
PlasmaComponents3.Label {
anchors.left: parent.left
text: usedString
opacity: 0.6
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.components 2.0 as PlasmaComponents // for Highlight
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.private.diskquota 1.0
......@@ -72,7 +73,7 @@ Item {
}
}
Components.Label {
PlasmaComponents3.Label {
visible: !diskQuota.quotaInstalled || listView.count == 0
anchors.fill: parent
text: diskQuota.quotaInstalled ? i18n("No quota restrictions found.") : i18n("Quota tool not found.\n\nPlease install 'quota'.")
......@@ -86,7 +87,7 @@ Item {
id: listView
model: diskQuota.model
boundsBehavior: Flickable.StopAtBounds
highlight: Components.Highlight { }
highlight: PlasmaComponents.Highlight { }
highlightMoveDuration: 0
highlightResizeDuration: 0
currentIndex: -1
......
......@@ -18,7 +18,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kcoreaddons 1.0 as KCoreAddons
Item {
......@@ -186,15 +186,15 @@ Item {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
}
Components.Button {
PlasmaComponents3.Button {
id: button
Layout.fillWidth: true
iconName: "roll"
icon.name: "roll"
text: i18nc("@action:button", "Shuffle");
onClicked: main.shuffleBoard();
}
Components.Label {
PlasmaComponents3.Label {
id: timeLabel
Layout.fillWidth: true
text: main.timerText()
......@@ -223,7 +223,7 @@ Item {
}
}
Components.Label {
PlasmaComponents3.Label {
id: solvedLabel
anchors.centerIn: parent
color: theme.textColor
......
......@@ -18,7 +18,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.components 3.0 as PlasmaComponents3
Rectangle {
id: piece
......@@ -64,7 +64,7 @@ Rectangle {
}
}
Components.Label {
PlasmaComponents3.Label {
id: pieceNumeral
anchors.centerIn: parent
text: piece.number
......
......@@ -22,7 +22,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.components 3.0 as PlasmaComponents3
Item {
id: main
......@@ -259,7 +259,7 @@ Item {
}
}
Components.Label {
PlasmaComponents3.Label {
id: timeLabel
font {
weight: plasmoid.configuration.boldText ? Font.Bold : Font.Normal
......
......@@ -21,7 +21,6 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.calendar 2.0 as PlasmaCalendar
......
......@@ -21,7 +21,6 @@ import QtQuick.Layouts 1.1
import QtQuick.Window 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
PlasmaCore.ToolTipArea {
......
......@@ -19,16 +19,18 @@ import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for Highlight
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
FocusScope {
id: konsoleProfiles
Plasmoid.switchWidth: units.gridUnit * 11
Plasmoid.switchHeight: units.gridUnit * 11
Plasmoid.switchHeight: units.gridUnit * 9