Skip to content

Commit

Permalink
refactor: port to PlasmaComponents3
Browse files Browse the repository at this point in the history
  • Loading branch information
romangg committed Feb 26, 2024
1 parent 067ccdf commit 82eecc0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
Expand Up @@ -21,17 +21,17 @@
*
*/

import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick 2.15
import QtQuick.Layouts 1.15

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.plasma.extras 2.0 as PlasmaExtras

ColumnLayout {
spacing: units.smallSpacing

PlasmaComponents.CheckBox {
PlasmaComponents3.CheckBox {
id: checkBox
Layout.fillWidth: true
// Remove spacing between checkbox and the explanatory label below
Expand Down Expand Up @@ -71,7 +71,7 @@ ColumnLayout {
}

// so we can align the labels below with the checkbox
PlasmaComponents.CheckBox {
PlasmaComponents3.CheckBox {
id: checkBoxMetrics
visible: false
}
Expand All @@ -96,7 +96,7 @@ ColumnLayout {
visible: valid
}

PlasmaComponents.Label {
PlasmaComponents3.Label {
Layout.fillWidth: true
Layout.maximumWidth: Math.min(units.gridUnit * 20, implicitWidth)
font.pointSize: theme.smallestFont.pointSize
Expand Down
Expand Up @@ -21,12 +21,12 @@
*
*/

import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick 2.15
import QtQuick.Layouts 1.15

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 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras

ColumnLayout {
Expand Down Expand Up @@ -65,13 +65,14 @@ ColumnLayout {
id: screenLayoutRepeater
model: root.screenLayouts

PlasmaComponents.Button {
PlasmaComponents3.Button {
width: screenLayoutRow.buttonSize
height: width
tooltip: modelData.label
Accessible.name: tooltip
onClicked: plasmoid.nativeInterface.applyLayoutPreset(modelData.action)

Accessible.name: modelData.label
PlasmaComponents3.ToolTip { text: modelData.label }

// HACK otherwise the icon won't expand to full button size
PlasmaCore.IconItem {
anchors.centerIn: parent
Expand Down
8 changes: 2 additions & 6 deletions plasma-integration/plasmoid/package/contents/ui/main.qml
Expand Up @@ -21,13 +21,11 @@
*
*/

import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick 2.15
import QtQuick.Layouts 1.15

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.plasma5support 2.0 as P5Support
import org.kde.kquickcontrolsaddons 2.0

Expand Down Expand Up @@ -122,7 +120,5 @@ Item {
Item {
Layout.fillHeight: true
}


}
}
6 changes: 3 additions & 3 deletions plasma-integration/po/plasma_applet_org.kwinft.kdisplay.pot
Expand Up @@ -95,19 +95,19 @@ msgstr ""
msgid "Display Layout"
msgstr ""

#: plasma-integration/plasmoid/package/contents/ui/ScreenLayoutSelection.qml:93
#: plasma-integration/plasmoid/package/contents/ui/ScreenLayoutSelection.qml:94
#, kde-format
msgid ""
"You can only apply a different display layout when there is more than one "
"display device plugged in."
msgstr ""

#: plasma-integration/plasmoid/package/contents/ui/main.qml:41
#: plasma-integration/plasmoid/package/contents/ui/main.qml:39
#, kde-format
msgid "Presentation mode is enabled"
msgstr ""

#: plasma-integration/plasmoid/package/contents/ui/main.qml:102
#: plasma-integration/plasmoid/package/contents/ui/main.qml:100
#, kde-format
msgid "Configure Display Settings…"
msgstr ""

0 comments on commit 82eecc0

Please sign in to comment.