Very early KDE 6 release.

This commit is contained in:
wackyideas 2024-08-09 03:20:25 +02:00
parent 7cc4ccabbc
commit 686046d4f7
6272 changed files with 140920 additions and 529657 deletions

View file

@ -0,0 +1,50 @@
import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import org.kde.plasma.plasma5support as Plasma5Support
import org.kde.plasma.plasmoid
Item {
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
property string version: "?"
property string metadataFilepath: Plasmoid.file("", "../metadata.desktop")
Plasma5Support.DataSource {
id: executable
engine: "executable"
connectedSources: []
onNewData: {
var exitCode = data["exit code"]
var exitStatus = data["exit status"]
var stdout = data["stdout"]
var stderr = data["stderr"]
exited(exitCode, exitStatus, stdout, stderr)
disconnectSource(sourceName) // cmd finished
}
function exec(cmd) {
connectSource(cmd)
}
signal exited(int exitCode, int exitStatus, string stdout, string stderr)
}
Connections {
target: executable
function onExited() {
version = stdout.replace('\n', ' ').trim()
}
}
Label {
id: label
text: i18n("<b>Version:</b> %1", version)
}
Component.onCompleted: {
var cmd = 'kreadconfig6 --file "' + metadataFilepath + '" --group "Desktop Entry" --key "X-KDE-PluginInfo-Version"'
executable.exec(cmd)
}
}

View file

@ -0,0 +1,18 @@
import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.plasmoid
import ".."
CheckBox {
id: configCheckBox
property string configKey: ''
checked: Plasmoid.configuration[configKey]
onClicked: Plasmoid.configuration[configKey] = !Plasmoid.configuration[configKey]
}

View file

@ -0,0 +1,110 @@
import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import QtQuick.Dialogs
import QtQuick.Window 2.12
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.kirigami as Kirigami
import org.kde.plasma.plasmoid
import ".."
RowLayout {
id: configColor
spacing: 2
// Layout.fillWidth: true
Layout.maximumWidth: 300
property alias label: label.text
property alias horizontalAlignment: label.horizontalAlignment
property string configKey: ''
property string defaultColor: ''
property string value: {
if (configKey) {
return Plasmoid.configuration[configKey]
} else {
return "#000"
}
}
readonly property color defaultColorValue: defaultColor
readonly property color valueColor: {
if (value == '' && defaultColor) {
return defaultColor
} else {
return value
}
}
onValueChanged: {
if (!textField.activeFocus) {
textField.text = configColor.value
}
if (configKey) {
if (value == defaultColorValue) {
Plasmoid.configuration[configKey] = ""
} else {
Plasmoid.configuration[configKey] = value
}
}
}
function setValue(newColor) {
textField.text = newColor
}
Label {
id: label
text: "Label"
Layout.fillWidth: horizontalAlignment == Text.AlignRight
horizontalAlignment: Text.AlignLeft
}
MouseArea {
id: mouseArea
width: textField.height
height: textField.height
hoverEnabled: true
onClicked: dialog.open()
Rectangle {
anchors.fill: parent
color: configColor.valueColor
border.width: 2
border.color: parent.containsMouse ? Kirigami.Theme.highlightColor : "#BB000000"
}
}
TextField {
id: textField
placeholderText: defaultColor ? defaultColor : "#AARRGGBB"
Layout.fillWidth: label.horizontalAlignment == Text.AlignLeft
onTextChanged: {
// Make sure the text is:
// Empty (use default)
// or #123 or #112233 or #11223344 before applying the color.
if (text.length === 0
|| (text.indexOf('#') === 0 && (text.length == 4 || text.length == 7 || text.length == 9))
) {
configColor.value = text
}
}
}
ColorDialog {
id: dialog
visible: false
modality: Qt.WindowModal
title: configColor.label
flags: ColorDialog.ShowAlphaChannel
selectedColor: configColor.valueColor
onAccepted: {
configColor.value = selectedColor
}
}
}

View file

@ -0,0 +1,39 @@
// Version 4
import QtQuick 2.15
import QtQuick.Layouts 1.3
import org.kde.kcmutils as KCM
KCM.SimpleKCM {
id: page
Layout.fillWidth: true
default property alias _contentChildren: content.data
implicitHeight: content.implicitHeight
ColumnLayout {
id: content
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
// Workaround for crash when using default on a Layout.
// https://bugreports.qt.io/browse/QTBUG-52490
// Still affecting Qt 5.7.0
Component.onDestruction: {
while (children.length > 0) {
children[children.length - 1].parent = page
}
}
}
property alias showAppletVersion: appletVersionLoader.active
Loader {
id: appletVersionLoader
active: false
visible: active
source: "AppletVersion.qml"
anchors.right: parent.right
anchors.bottom: parent.top
}
}

View file

@ -0,0 +1,24 @@
import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
GroupBox {
id: configSection
Layout.fillWidth: true
default property alias _contentChildren: content.data
ColumnLayout {
id: content
anchors.left: parent.left
anchors.right: parent.right
// Workaround for crash when using default on a Layout.
// https://bugreports.qt.io/browse/QTBUG-52490
// Still affecting Qt 5.7.0
Component.onDestruction: {
while (children.length > 0) {
children[children.length - 1].parent = configSection
}
}
}
}

View file

@ -0,0 +1,54 @@
import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import org.kde.plasma.plasmoid
RowLayout {
id: configSpinBox
property string configKey: ''
property alias to: spinBox.to
property alias from: spinBox.from
property alias prefix: spinBox.prefix
property alias stepSize: spinBox.stepSize
property alias suffix: spinBox.suffix
property alias value: spinBox.value
property alias before: labelBefore.text
property alias after: labelAfter.text
Label {
id: labelBefore
text: ""
visible: text
}
SpinBox {
id: spinBox
property string prefix
property string suffix
value: Plasmoid.configuration[configKey]
// onValueChanged: Plasmoid.configuration[configKey] = value
onValueChanged: serializeTimer.start()
to: 2147483647
textFromValue: function(value) {
return prefix + value + suffix;
}
}
Label {
id: labelAfter
text: ""
visible: text
}
Timer { // throttle
id: serializeTimer
interval: 300
onTriggered: Plasmoid.configuration[configKey] = value
}
}