Update
This commit is contained in:
parent
3c696a710e
commit
fc34808a9d
|
@ -6,6 +6,4 @@ Show desktop plasmoid
|
||||||
|
|
||||||
[YooMoney](https://yoomoney.ru/to/4100115921160758)
|
[YooMoney](https://yoomoney.ru/to/4100115921160758)
|
||||||
|
|
||||||
[Qiwi](https://qiwi.com/n/VALERIAFADEEVA)
|
|
||||||
|
|
||||||
Etherium 0x981FBf878fe451BDB83BEaF68078394d4B13213f
|
Etherium 0x981FBf878fe451BDB83BEaF68078394d4B13213f
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,16 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: config
|
|
||||||
|
|
||||||
// Colors
|
|
||||||
function alpha(c, newAlpha) {
|
|
||||||
return Qt.rgba(c.r, c.g, c.b, newAlpha)
|
|
||||||
}
|
|
||||||
property color defaultEdgeColor: alpha(theme.textColor, 0.4)
|
|
||||||
property color defaultHoveredColor: theme.buttonBackgroundColor
|
|
||||||
property color defaultPressedColor: theme.buttonHoverColor
|
|
||||||
property color edgeColor: plasmoid.configuration.edgeColor || defaultEdgeColor
|
|
||||||
property color hoveredColor: plasmoid.configuration.hoveredColor || defaultHoveredColor
|
|
||||||
property color pressedColor: plasmoid.configuration.pressedColor || defaultPressedColor
|
|
||||||
}
|
|
|
@ -1,226 +0,0 @@
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.kirigami 2.3 as Kirigami
|
|
||||||
|
|
||||||
import ".."
|
|
||||||
import "../lib"
|
|
||||||
|
|
||||||
ConfigPage {
|
|
||||||
id: page
|
|
||||||
showAppletVersion: true
|
|
||||||
|
|
||||||
property string cfg_click_action: 'showdesktop'
|
|
||||||
property alias cfg_click_command: click_command.text
|
|
||||||
|
|
||||||
property string cfg_mousewheel_action: 'run_commands'
|
|
||||||
property alias cfg_mousewheel_up: mousewheel_up.text
|
|
||||||
property alias cfg_mousewheel_down: mousewheel_down.text
|
|
||||||
|
|
||||||
property bool showDebug: false
|
|
||||||
property int indentWidth: 24
|
|
||||||
|
|
||||||
AppletConfig {
|
|
||||||
id: config
|
|
||||||
}
|
|
||||||
|
|
||||||
function setClickCommand(command) {
|
|
||||||
cfg_click_action = 'run_command'
|
|
||||||
clickGroup_runcommand.checked = true
|
|
||||||
cfg_click_command = command
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMouseWheelCommands(up, down) {
|
|
||||||
cfg_mousewheel_action = 'run_commands'
|
|
||||||
mousewheelGroup_runcommands.checked = true
|
|
||||||
cfg_mousewheel_up = up
|
|
||||||
cfg_mousewheel_down = down
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigSection {
|
|
||||||
title: i18n("Look")
|
|
||||||
|
|
||||||
Kirigami.FormLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
ConfigSpinBox {
|
|
||||||
Kirigami.FormData.label: i18n("Size:")
|
|
||||||
configKey: 'size'
|
|
||||||
suffix: i18n("px")
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigColor {
|
|
||||||
Kirigami.FormData.label: i18n("Edge Color:")
|
|
||||||
configKey: "edgeColor"
|
|
||||||
defaultColor: config.defaultEdgeColor
|
|
||||||
label: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigColor {
|
|
||||||
Kirigami.FormData.label: i18n("Hovered Color:")
|
|
||||||
configKey: "hoveredColor"
|
|
||||||
defaultColor: config.defaultHoveredColor
|
|
||||||
label: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigColor {
|
|
||||||
Kirigami.FormData.label: i18n("Pressed Color:")
|
|
||||||
configKey: "pressedColor"
|
|
||||||
defaultColor: config.defaultPressedColor
|
|
||||||
label: ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ExclusiveGroup { id: clickGroup }
|
|
||||||
ConfigSection {
|
|
||||||
title: i18n("Click")
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: cfg_click_action == 'showdesktop'
|
|
||||||
text: i18nd("plasma_applet_org.kde.plasma.showdesktop", "Show Desktop")
|
|
||||||
onClicked: {
|
|
||||||
cfg_click_action = 'showdesktop'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: cfg_click_action == 'minimizeall'
|
|
||||||
text: i18ndc("plasma_applet_org.kde.plasma.showdesktop", "@action", "Minimize All Windows")
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
cfg_click_action = 'minimizeall'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
id: clickGroup_runcommand
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: cfg_click_action == 'run_command'
|
|
||||||
text: i18n("Run Command")
|
|
||||||
onClicked: {
|
|
||||||
cfg_click_action = 'run_command'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Text { width: indentWidth } // indent
|
|
||||||
TextField {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: click_command
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: false
|
|
||||||
text: i18nd("kwin_effects", "Toggle Present Windows (All desktops)")
|
|
||||||
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ExposeAll"'
|
|
||||||
onClicked: setClickCommand(command)
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: false
|
|
||||||
text: i18nd("kwin_effects", "Toggle Present Windows (Current desktop)")
|
|
||||||
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Expose"'
|
|
||||||
onClicked: setClickCommand(command)
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: clickGroup
|
|
||||||
checked: false
|
|
||||||
text: i18nd("kwin_effects", "Toggle Present Windows (Window class)")
|
|
||||||
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ExposeClass"'
|
|
||||||
onClicked: setClickCommand(command)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ExclusiveGroup { id: mousewheelGroup }
|
|
||||||
ConfigSection {
|
|
||||||
title: i18n("Mouse Wheel")
|
|
||||||
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
id: mousewheelGroup_runcommands
|
|
||||||
exclusiveGroup: mousewheelGroup
|
|
||||||
checked: cfg_mousewheel_action == 'run_commands'
|
|
||||||
text: i18n("Run Commands")
|
|
||||||
onClicked: {
|
|
||||||
cfg_mousewheel_action = 'run_commands'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Text { width: indentWidth } // indent
|
|
||||||
Label {
|
|
||||||
text: i18n("Scroll Up:")
|
|
||||||
}
|
|
||||||
TextField {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: mousewheel_up
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Text { width: indentWidth } // indent
|
|
||||||
Label {
|
|
||||||
text: i18n("Scroll Down:")
|
|
||||||
}
|
|
||||||
TextField {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: mousewheel_down
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: mousewheelGroup
|
|
||||||
checked: false
|
|
||||||
text: i18n("Volume (No UI) (amixer)")
|
|
||||||
onClicked: setMouseWheelCommands('amixer -q sset Master 10%+', 'amixer -q sset Master 10%-')
|
|
||||||
}
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: mousewheelGroup
|
|
||||||
checked: false
|
|
||||||
text: i18n("Volume (UI) (qdbus)")
|
|
||||||
property string upCommand: 'qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "increase_volume"'
|
|
||||||
property string downCommand: 'qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"'
|
|
||||||
onClicked: setMouseWheelCommands(upCommand, downCommand)
|
|
||||||
}
|
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
exclusiveGroup: mousewheelGroup
|
|
||||||
checked: false
|
|
||||||
text: i18n("Switch Desktop (qdbus)")
|
|
||||||
property string upCommand: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Left"'
|
|
||||||
property string downCommand: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Right"'
|
|
||||||
onClicked: setMouseWheelCommands(upCommand, downCommand)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigSection {
|
|
||||||
title: i18n("Peek")
|
|
||||||
|
|
||||||
Kirigami.FormLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
ConfigCheckBox {
|
|
||||||
Kirigami.FormData.label: i18n("Show desktop on hover:")
|
|
||||||
configKey: "peekingEnabled"
|
|
||||||
text: i18n("Enable")
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigSpinBox {
|
|
||||||
Kirigami.FormData.label: i18n("Peek threshold:")
|
|
||||||
configKey: 'peekingThreshold'
|
|
||||||
suffix: i18n("ms")
|
|
||||||
stepSize: 50
|
|
||||||
minimumValue: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
implicitWidth: label.implicitWidth
|
|
||||||
implicitHeight: label.implicitHeight
|
|
||||||
|
|
||||||
property string version: "?"
|
|
||||||
property string metadataFilepath: plasmoid.file("", "../metadata.desktop")
|
|
||||||
|
|
||||||
PlasmaCore.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
|
|
||||||
onExited: {
|
|
||||||
version = stdout.replace('\n', ' ').trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: label
|
|
||||||
text: i18n("<b>Version:</b> %1", version)
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
var cmd = 'kreadconfig5 --file "' + metadataFilepath + '" --group "Desktop Entry" --key "X-KDE-PluginInfo-Version"'
|
|
||||||
executable.exec(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
import ".."
|
|
||||||
|
|
||||||
CheckBox {
|
|
||||||
id: configCheckBox
|
|
||||||
|
|
||||||
property string configKey: ''
|
|
||||||
checked: plasmoid.configuration[configKey]
|
|
||||||
onClicked: plasmoid.configuration[configKey] = !plasmoid.configuration[configKey]
|
|
||||||
}
|
|
|
@ -1,109 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import QtQuick.Dialogs 1.2
|
|
||||||
import QtQuick.Window 2.2
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
import ".."
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: configColor
|
|
||||||
spacing: 2
|
|
||||||
// Layout.fillWidth: true
|
|
||||||
Layout.maximumWidth: 300 * units.devicePixelRatio
|
|
||||||
|
|
||||||
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 ? 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
|
|
||||||
showAlphaChannel: true
|
|
||||||
color: configColor.valueColor
|
|
||||||
onCurrentColorChanged: {
|
|
||||||
if (visible && color != currentColor) {
|
|
||||||
configColor.value = currentColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
// Version 4
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: configSpinBox
|
|
||||||
|
|
||||||
property string configKey: ''
|
|
||||||
property alias decimals: spinBox.decimals
|
|
||||||
property alias horizontalAlignment: spinBox.horizontalAlignment
|
|
||||||
property alias maximumValue: spinBox.maximumValue
|
|
||||||
property alias minimumValue: spinBox.minimumValue
|
|
||||||
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
|
|
||||||
|
|
||||||
value: plasmoid.configuration[configKey]
|
|
||||||
// onValueChanged: plasmoid.configuration[configKey] = value
|
|
||||||
onValueChanged: serializeTimer.start()
|
|
||||||
maximumValue: 2147483647
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: labelAfter
|
|
||||||
text: ""
|
|
||||||
visible: text
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer { // throttle
|
|
||||||
id: serializeTimer
|
|
||||||
interval: 300
|
|
||||||
onTriggered: plasmoid.configuration[configKey] = value
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,507 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2019 Chris Holland <zrenfire@gmail.com>
|
|
||||||
Copyright (C) 2014 Ashish Madeti <ashishmadeti@gmail.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along
|
|
||||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
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.private.showdesktop 0.1
|
|
||||||
|
|
||||||
import org.kde.draganddrop 2.0 as DragAndDrop
|
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: widget
|
|
||||||
|
|
||||||
Layout.minimumWidth: Layout.maximumWidth
|
|
||||||
Layout.minimumHeight: Layout.maximumHeight
|
|
||||||
|
|
||||||
// In Latte, widgets are always Mutable.
|
|
||||||
property bool isInLatte: false // Latte v8
|
|
||||||
// Latte will set inEditMode=true when editing the dock.
|
|
||||||
// https://techbase.kde.org/LatteDock#latteBridge
|
|
||||||
property QtObject latteBridge: null // Latte v9
|
|
||||||
readonly property bool inLatte: latteBridge !== null
|
|
||||||
|
|
||||||
readonly property bool isWidgetUnlocked: {
|
|
||||||
if (isInLatte) { // Latte v8
|
|
||||||
return false
|
|
||||||
} else if (inLatte) { // Latte v9
|
|
||||||
return latteBridge.inEditMode
|
|
||||||
} else if (plasmoid.immutability != PlasmaCore.Types.Mutable) { // Plasma 5.17 and below
|
|
||||||
return false
|
|
||||||
} else { // Plasma 5.18
|
|
||||||
return widget.editMode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--- containment.editMode detector
|
|
||||||
property var containmentInterface: null
|
|
||||||
readonly property bool editMode: containmentInterface ? containmentInterface.editMode : false
|
|
||||||
onParentChanged: {
|
|
||||||
if (parent) {
|
|
||||||
for (var obj = widget, depth = 0; !!obj; obj = obj.parent, depth++) {
|
|
||||||
// console.log('depth', depth, 'obj', obj)
|
|
||||||
if (obj.toString().startsWith('ContainmentInterface')) {
|
|
||||||
// desktop containment / plasmoidviewer
|
|
||||||
// Note: This doesn't always work. FolderViewDropArea may not yet have
|
|
||||||
// ContainmentInterface as a parent when this loop runs.
|
|
||||||
if (typeof obj['editMode'] === 'boolean') {
|
|
||||||
// console.log('\t', 'obj.editMode', obj.editMode, typeof obj['editMode'])
|
|
||||||
widget.containmentInterface = obj
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else if (obj.toString().startsWith('DeclarativeDropArea')) {
|
|
||||||
// panel containment
|
|
||||||
if (typeof obj['Plasmoid'] !== 'undefined' && obj['Plasmoid'].toString().startsWith('ContainmentInterface')) {
|
|
||||||
if (typeof obj['Plasmoid']['editMode'] === 'boolean') {
|
|
||||||
// console.log('\t', 'obj.Plasmoid', obj.Plasmoid, typeof obj['Plasmoid']) // ContainmentInterface
|
|
||||||
// console.log('\t', 'obj.Plasmoid.editMode', obj.Plasmoid.editMode, typeof obj['Plasmoid']['editMode'])
|
|
||||||
widget.containmentInterface = obj.Plasmoid
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---
|
|
||||||
property int iconSize: units.iconSizes.smallMedium
|
|
||||||
property int size: {
|
|
||||||
if (isWidgetUnlocked) {
|
|
||||||
return iconSize
|
|
||||||
} else {
|
|
||||||
return Math.max(1, plasmoid.configuration.size) * units.devicePixelRatio
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppletConfig {
|
|
||||||
id: config
|
|
||||||
}
|
|
||||||
|
|
||||||
//---
|
|
||||||
state: {
|
|
||||||
if (plasmoid.formFactor == PlasmaCore.Types.Vertical) return "vertical"
|
|
||||||
if (plasmoid.formFactor == PlasmaCore.Types.Horizontal) return "horizontal"
|
|
||||||
return "square"
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State { name: "square"
|
|
||||||
PropertyChanges {
|
|
||||||
target: widget
|
|
||||||
Layout.minimumWidth: units.iconSizeHints.desktop
|
|
||||||
Layout.minimumHeight: units.iconSizeHints.desktop
|
|
||||||
Layout.maximumWidth: -1
|
|
||||||
Layout.maximumHeight: -1
|
|
||||||
iconSize: units.iconSizeHints.desktop
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: buttonRect
|
|
||||||
y: 0
|
|
||||||
x: 0
|
|
||||||
width: plasmoid.width
|
|
||||||
height: plasmoid.height
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: edgeLine
|
|
||||||
color: "transparent"
|
|
||||||
anchors.fill: edgeLine.parent
|
|
||||||
border.color: config.edgeColor
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State { name: "vertical" // ...panel (fat short button)
|
|
||||||
// Assume it's on the bottom. Breeze has margins of top=4 right=5 bottom=1 left=N/A
|
|
||||||
PropertyChanges {
|
|
||||||
target: widget
|
|
||||||
Layout.maximumWidth: plasmoid.width
|
|
||||||
Layout.maximumHeight: widget.size // size + bottomMargin = totalHeight
|
|
||||||
iconSize: Math.min(plasmoid.width, units.iconSizes.smallMedium)
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: buttonRect
|
|
||||||
rightMargin: 5
|
|
||||||
bottomMargin: 5
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: edgeLine
|
|
||||||
height: 1 * units.devicePixelRatio
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: edgeLine
|
|
||||||
anchors.left: edgeLine.parent.left
|
|
||||||
anchors.top: edgeLine.parent.top
|
|
||||||
anchors.right: edgeLine.parent.right
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State { name: "horizontal" // ...panel (thin tall button)
|
|
||||||
// Assume it's on the right. Breeze has margins of top=4 right=5 bottom=1 left=N/A
|
|
||||||
PropertyChanges {
|
|
||||||
target: widget
|
|
||||||
Layout.maximumWidth: widget.size // size + rightMargin = totalWidth
|
|
||||||
Layout.maximumHeight: plasmoid.height
|
|
||||||
iconSize: Math.min(plasmoid.height, units.iconSizes.smallMedium)
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: buttonRect
|
|
||||||
topMargin: 4
|
|
||||||
rightMargin: 5
|
|
||||||
bottomMargin: 3
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: edgeLine
|
|
||||||
width: 1 * units.devicePixelRatio
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: edgeLine
|
|
||||||
anchors.left: edgeLine.parent.left
|
|
||||||
anchors.top: edgeLine.parent.top
|
|
||||||
anchors.bottom: edgeLine.parent.bottom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
|
|
||||||
Plasmoid.onActivated: widget.performClick()
|
|
||||||
|
|
||||||
function performClick() {
|
|
||||||
if (plasmoid.configuration.click_action == 'minimizeall') {
|
|
||||||
minimizeAll.toggleActive()
|
|
||||||
} else if (plasmoid.configuration.click_action == 'run_command') {
|
|
||||||
widget.exec(plasmoid.configuration.click_command)
|
|
||||||
} else { // Default: showdesktop
|
|
||||||
showdesktop.showingDesktop = !showdesktop.showingDesktop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function performMouseWheelUp() {
|
|
||||||
widget.exec(plasmoid.configuration.mousewheel_up)
|
|
||||||
}
|
|
||||||
|
|
||||||
function performMouseWheelDown() {
|
|
||||||
widget.exec(plasmoid.configuration.mousewheel_down)
|
|
||||||
}
|
|
||||||
|
|
||||||
//--- ShowDesktop
|
|
||||||
// https://github.com/KDE/plasma-desktop/blob/master/applets/showdesktop/package/contents/ui/main.qml
|
|
||||||
ShowDesktop {
|
|
||||||
id: showdesktop
|
|
||||||
property bool isPeeking: false
|
|
||||||
onIsPeekingChanged: {
|
|
||||||
if (isPeeking) {
|
|
||||||
showingDesktop = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function initPeeking() {
|
|
||||||
// console.log('initPeeking')
|
|
||||||
// console.log('showingDesktop', showingDesktop)
|
|
||||||
// console.log('peekTimer.running', peekTimer.running)
|
|
||||||
if (!showingDesktop) {
|
|
||||||
if (plasmoid.configuration.peekingEnabled) {
|
|
||||||
peekTimer.restart()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancelPeek() {
|
|
||||||
// console.log('cancelPeek')
|
|
||||||
// console.log('peekTimer.running', peekTimer.running)
|
|
||||||
peekTimer.stop()
|
|
||||||
if (isPeeking) {
|
|
||||||
isPeeking = false
|
|
||||||
showingDesktop = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--- MinimizeAll
|
|
||||||
// https://github.com/KDE/plasma-desktop/blob/master/applets/minimizeall/package/contents/ui/main.qml
|
|
||||||
QtObject {
|
|
||||||
id: minimizeAll
|
|
||||||
property bool active: false
|
|
||||||
property var minimizedClients: [] //list of persistentmodelindexes from task manager model of clients minimised by us
|
|
||||||
|
|
||||||
property var taskModel: TaskManager.TasksModel {
|
|
||||||
id: tasksModel
|
|
||||||
sortMode: TaskManager.TasksModel.SortDisabled
|
|
||||||
groupMode: TaskManager.TasksModel.GroupDisabled
|
|
||||||
}
|
|
||||||
property var taskModelConnection: Connections {
|
|
||||||
target: tasksModel
|
|
||||||
enabled: minimizeAll.active
|
|
||||||
|
|
||||||
onActiveTaskChanged: {
|
|
||||||
if (tasksModel.activeTask.valid) { //to suppress changing focus to non windows, such as the desktop
|
|
||||||
minimizeAll.active = false
|
|
||||||
minimizeAll.minimizedClients = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onVirtualDesktopChanged: minimizeAll.deactivate()
|
|
||||||
onActivityChanged: minimizeAll.deactivate()
|
|
||||||
}
|
|
||||||
|
|
||||||
function activate() {
|
|
||||||
var clients = []
|
|
||||||
for (var i = 0; i < tasksModel.count; i++) {
|
|
||||||
var idx = tasksModel.makeModelIndex(i)
|
|
||||||
if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
|
|
||||||
tasksModel.requestToggleMinimized(idx)
|
|
||||||
clients.push(tasksModel.makePersistentModelIndex(i))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
minimizedClients = clients
|
|
||||||
active = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function deactivate() {
|
|
||||||
active = false;
|
|
||||||
for (var i = 0; i < minimizedClients.length; i++) {
|
|
||||||
var idx = minimizedClients[i]
|
|
||||||
//client deleted, do nothing
|
|
||||||
if (!idx.valid) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
//if the user has restored it already, do nothing
|
|
||||||
if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
tasksModel.requestToggleMinimized(idx)
|
|
||||||
}
|
|
||||||
minimizedClients = []
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleActive() {
|
|
||||||
if (active) {
|
|
||||||
deactivate()
|
|
||||||
} else {
|
|
||||||
activate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: peekTimer
|
|
||||||
interval: plasmoid.configuration.peekingThreshold
|
|
||||||
onTriggered: {
|
|
||||||
showdesktop.isPeeking = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: buttonRect
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
property int topMargin: 0
|
|
||||||
property int rightMargin: 0
|
|
||||||
property int bottomMargin: 0
|
|
||||||
property int leftMargin: 0
|
|
||||||
|
|
||||||
y: -topMargin
|
|
||||||
x: -leftMargin
|
|
||||||
width: leftMargin + plasmoid.width + rightMargin
|
|
||||||
height: topMargin + plasmoid.height + bottomMargin
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
// Rectangle {
|
|
||||||
// id: surfaceNormal
|
|
||||||
// anchors.fill: parent
|
|
||||||
// anchors.topMargin: 1
|
|
||||||
// color: "transparent"
|
|
||||||
// border.color: theme.buttonBackgroundColor
|
|
||||||
// }
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: surfaceHovered
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 1
|
|
||||||
color: config.hoveredColor
|
|
||||||
opacity: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: surfacePressed
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 1
|
|
||||||
color: config.pressedColor
|
|
||||||
opacity: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: edgeLine
|
|
||||||
color: "transparent"
|
|
||||||
border.color: config.edgeColor
|
|
||||||
border.width: 1 * units.devicePixelRatio
|
|
||||||
}
|
|
||||||
|
|
||||||
state: {
|
|
||||||
if (control.containsPress) return "pressed"
|
|
||||||
if (control.containsMouse) return "hovered"
|
|
||||||
return "normal"
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State { name: "normal" },
|
|
||||||
State { name: "hovered"
|
|
||||||
PropertyChanges {
|
|
||||||
target: surfaceHovered
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State { name: "pressed"
|
|
||||||
PropertyChanges {
|
|
||||||
target: surfacePressed
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
to: "normal"
|
|
||||||
//Cross fade from pressed to normal
|
|
||||||
ParallelAnimation {
|
|
||||||
NumberAnimation { target: surfaceHovered; property: "opacity"; to: 0; duration: 100 }
|
|
||||||
NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: 100 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: control
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: {
|
|
||||||
if (showdesktop.isPeeking && showdesktop.showingDesktop) {
|
|
||||||
showdesktop.isPeeking = false
|
|
||||||
} else {
|
|
||||||
peekTimer.stop()
|
|
||||||
|
|
||||||
if (true) {
|
|
||||||
widget.performClick()
|
|
||||||
} else {
|
|
||||||
showdesktop.showingDesktop = false
|
|
||||||
minimizeAll.toggleActive()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onEntered: {
|
|
||||||
// console.log('onEntered')
|
|
||||||
showdesktop.initPeeking()
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
// console.log('onExited')
|
|
||||||
showdesktop.cancelPeek()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// org.kde.plasma.volume
|
|
||||||
property int wheelDelta: 0
|
|
||||||
onWheel: {
|
|
||||||
var delta = wheel.angleDelta.y || wheel.angleDelta.x
|
|
||||||
wheelDelta += delta
|
|
||||||
// Magic number 120 for common "one click"
|
|
||||||
// See: http://qt-project.org/doc/qt-5/qml-qtquick-wheelevent.html#angleDelta-prop
|
|
||||||
while (wheelDelta >= 120) {
|
|
||||||
wheelDelta -= 120
|
|
||||||
widget.performMouseWheelUp()
|
|
||||||
}
|
|
||||||
while (wheelDelta <= -120) {
|
|
||||||
wheelDelta += 120
|
|
||||||
widget.performMouseWheelDown()
|
|
||||||
}
|
|
||||||
wheel.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DragAndDrop.DropArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onDragEnter: {
|
|
||||||
// console.log('showDesktopDropArea.onDragEnter')
|
|
||||||
// showdesktop.initPeeking()
|
|
||||||
showdesktop.showingDesktop = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PlasmaComponents.Button {
|
|
||||||
// anchors.fill: parent
|
|
||||||
// // anchors.left: parent.left
|
|
||||||
// // anchors.top: parent.top + 3
|
|
||||||
// // anchors.right: parent.right + 5
|
|
||||||
// // anchors.bottom: parent.bottom + 5
|
|
||||||
// // width: parent.width
|
|
||||||
// // height: parent.height
|
|
||||||
// onClicked: showdesktop.showDesktop()
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
visible: widget.isWidgetUnlocked
|
|
||||||
source: "transform-move"
|
|
||||||
width: units.iconSizes.smallMedium
|
|
||||||
height: units.iconSizes.smallMedium
|
|
||||||
}
|
|
||||||
|
|
||||||
// org.kde.plasma.mediacontrollercompact
|
|
||||||
PlasmaCore.DataSource {
|
|
||||||
id: executeSource
|
|
||||||
engine: "executable"
|
|
||||||
connectedSources: []
|
|
||||||
onNewData: {
|
|
||||||
//we get new data when the process finished, so we can remove it
|
|
||||||
disconnectSource(sourceName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function exec(cmd) {
|
|
||||||
//Note: we assume that 'cmd' is executed quickly so that a previous call
|
|
||||||
//with the same 'cmd' has already finished (otherwise no new cmd will be
|
|
||||||
//added because it is already in the list)
|
|
||||||
executeSource.connectSource(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
plasmoid.setAction("toggleLockWidgets", i18n("Toggle Lock Widgets (Plasma 5.18)"), "object-locked")
|
|
||||||
plasmoid.setAction("showdesktop", i18nd("plasma_applet_org.kde.plasma.showdesktop", "Show Desktop"), "user-desktop")
|
|
||||||
plasmoid.setAction("minimizeall", i18ndc("plasma_applet_org.kde.plasma.showdesktop", "@action", "Minimize All Windows"), "user-desktop")
|
|
||||||
}
|
|
||||||
|
|
||||||
//---
|
|
||||||
function action_toggleLockWidgets() {
|
|
||||||
var cmd = 'qdbus org.kde.plasmashell /PlasmaShell evaluateScript "lockCorona(!locked)"'
|
|
||||||
widget.exec(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
function action_showdesktop() {
|
|
||||||
showdesktop.showingDesktop = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function action_minimizeall() {
|
|
||||||
minimizeAll.toggleActive()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"KPlugin": {
|
|
||||||
"Authors": [
|
|
||||||
{
|
|
||||||
"Email": "zrenfire@gmail.com",
|
|
||||||
"Name": "Petri Damstén + Chris Holland"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Category": "Windows and Tasks",
|
|
||||||
"Description": "Show the Plasma desktop",
|
|
||||||
"Description[ru]": "Показать рабочий стол Plasma",
|
|
||||||
"Description[x-test]": "xxShow the Plasma desktopxx",
|
|
||||||
"EnabledByDefault": true,
|
|
||||||
"Icon": "user-desktop",
|
|
||||||
"Id": "com.github.zren.win7showdesktop",
|
|
||||||
"License": "GPL-2.0+",
|
|
||||||
"Name": "Show Desktop (Win7)",
|
|
||||||
"Name[ru]": "Показать рабочий стол (Win7)",
|
|
||||||
"Name[x-test]": "xxShow Desktop (Win7)xx",
|
|
||||||
"ServiceTypes": [
|
|
||||||
"Plasma/Applet"
|
|
||||||
],
|
|
||||||
"Version": "13.0",
|
|
||||||
"Website": "https://github.com/Zren/plasma-applet-win7showdesktop"
|
|
||||||
},
|
|
||||||
"X-Plasma-API": "declarativeappletscript",
|
|
||||||
"X-Plasma-MainScript": "ui/main.qml",
|
|
||||||
"X-Plasma-Provides": [
|
|
||||||
"org.kde.plasma.windowmanagement"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
> Version 6 of Zren's i18n scripts.
|
|
||||||
|
|
||||||
With KDE Frameworks v5.37 and above, translations are bundled with the `*.plasmoid` file downloaded from the store.
|
|
||||||
|
|
||||||
## Install Translations
|
|
||||||
|
|
||||||
Go to `~/.local/share/plasma/plasmoids/org.kde.plasma.win7showdesktop/translate/` and run `sh ./build --restartplasma`.
|
|
||||||
|
|
||||||
## New Translations
|
|
||||||
|
|
||||||
1. Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/Zren/plasma-applet-win7showdesktop/issues/new), name the file `spanish.txt`, attach the txt file to the issue (drag and drop).
|
|
||||||
|
|
||||||
Or if you know how to make a pull request
|
|
||||||
|
|
||||||
1. Copy the `template.pot` file and name it your locale's code (Eg: `en`/`de`/`fr`) with the extension `.po`. Then fill out all the `msgstr ""`.
|
|
||||||
|
|
||||||
## Scripts
|
|
||||||
|
|
||||||
* `sh ./merge` will parse the `i18n()` calls in the `*.qml` files and write it to the `template.pot` file. Then it will merge any changes into the `*.po` language files.
|
|
||||||
* `sh ./build` will convert the `*.po` files to it's binary `*.mo` version and move it to `contents/locale/...` which will bundle the translations in the `*.plasmoid` without needing the user to manually install them.
|
|
||||||
* `sh ./plasmoidlocaletest` will run `./build` then `plasmoidviewer` (part of `plasma-sdk`).
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
* https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
* https://websvn.kde.org/trunk/l10n-kf5/fr/messages/kde-workspace/
|
|
||||||
* https://github.com/psifidotos/nowdock-plasmoid/tree/master/po
|
|
||||||
* https://github.com/kotelnik/plasma-applet-redshift-control/tree/master/translations
|
|
||||||
|
|
||||||
## Status
|
|
||||||
| Locale | Lines | % Done|
|
|
||||||
|----------|---------|-------|
|
|
||||||
| Template | 23 | |
|
|
||||||
| es | 23/23 | 100% |
|
|
||||||
| nl | 23/23 | 100% |
|
|
||||||
| pt_BR | 17/23 | 73% |
|
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# Version: 5
|
|
||||||
|
|
||||||
# This script will convert the *.po files to *.mo files, rebuilding the package/contents/locale folder.
|
|
||||||
# Feature discussion: https://phabricator.kde.org/D5209
|
|
||||||
# Eg: contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo
|
|
||||||
|
|
||||||
DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
|
|
||||||
plasmoidName=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
|
|
||||||
website=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"`
|
|
||||||
bugAddress="$website"
|
|
||||||
packageRoot=".." # Root of translatable sources
|
|
||||||
projectName="plasma_applet_${plasmoidName}" # project name
|
|
||||||
|
|
||||||
#---
|
|
||||||
if [ -z "$plasmoidName" ]; then
|
|
||||||
echo "[build] Error: Couldn't read plasmoidName."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$(which msgfmt)" ]; then
|
|
||||||
echo "[build] Error: msgfmt command not found. Need to install gettext"
|
|
||||||
echo "[build] Running 'sudo apt install gettext'"
|
|
||||||
sudo apt install gettext
|
|
||||||
echo "[build] gettext installation should be finished. Going back to installing translations."
|
|
||||||
fi
|
|
||||||
|
|
||||||
#---
|
|
||||||
echo "[build] Compiling messages"
|
|
||||||
|
|
||||||
catalogs=`find . -name '*.po'`
|
|
||||||
for cat in $catalogs; do
|
|
||||||
echo "$cat"
|
|
||||||
catLocale=`basename ${cat%.*}`
|
|
||||||
msgfmt -o "${catLocale}.mo" "$cat"
|
|
||||||
|
|
||||||
installPath="$DIR/../contents/locale/${catLocale}/LC_MESSAGES/${projectName}.mo"
|
|
||||||
|
|
||||||
echo "[build] Install to ${installPath}"
|
|
||||||
mkdir -p "$(dirname "$installPath")"
|
|
||||||
mv "${catLocale}.mo" "${installPath}"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "[build] Done building messages"
|
|
||||||
|
|
||||||
if [ "$1" = "--restartplasma" ]; then
|
|
||||||
echo "[build] Restarting plasmashell"
|
|
||||||
killall plasmashell
|
|
||||||
kstart5 plasmashell
|
|
||||||
echo "[build] Done restarting plasmashell"
|
|
||||||
else
|
|
||||||
echo "[build] (re)install the plasmoid and restart plasmashell to test."
|
|
||||||
fi
|
|
|
@ -1,136 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# Version: 15
|
|
||||||
|
|
||||||
# https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
|
|
||||||
# Based on: https://github.com/psifidotos/nowdock-plasmoid/blob/master/po/Messages.sh
|
|
||||||
|
|
||||||
DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
|
|
||||||
plasmoidName=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
|
|
||||||
widgetName="${plasmoidName##*.}" # Strip namespace
|
|
||||||
website=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"`
|
|
||||||
bugAddress="$website"
|
|
||||||
packageRoot=".." # Root of translatable sources
|
|
||||||
projectName="plasma_applet_${plasmoidName}" # project name
|
|
||||||
|
|
||||||
#---
|
|
||||||
if [ -z "$plasmoidName" ]; then
|
|
||||||
echo "[merge] Error: Couldn't read plasmoidName."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$(which xgettext)" ]; then
|
|
||||||
echo "[merge] Error: xgettext command not found. Need to install gettext"
|
|
||||||
echo "[merge] Running 'sudo apt install gettext'"
|
|
||||||
sudo apt install gettext
|
|
||||||
echo "[merge] gettext installation should be finished. Going back to merging translations."
|
|
||||||
fi
|
|
||||||
|
|
||||||
#---
|
|
||||||
echo "[merge] Extracting messages"
|
|
||||||
find "${packageRoot}" -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.qml' -o -name '*.js' | sort > "${DIR}/infiles.list"
|
|
||||||
|
|
||||||
xgettext \
|
|
||||||
--from-code=UTF-8 \
|
|
||||||
-C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 \
|
|
||||||
-kI18N_NOOP2:1c,2 -kN_:1 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
|
||||||
--files-from="infiles.list" \
|
|
||||||
--width=200 \
|
|
||||||
--add-location=file \
|
|
||||||
--package-name="${widgetName}" \
|
|
||||||
--package-version="" \
|
|
||||||
--msgid-bugs-address="${bugAddress}" \
|
|
||||||
-D "${packageRoot}" \
|
|
||||||
-D "${DIR}" \
|
|
||||||
-o "template.pot.new" \
|
|
||||||
|| \
|
|
||||||
{ echo "[merge] error while calling xgettext. aborting."; exit 1; }
|
|
||||||
|
|
||||||
sed -i 's/# SOME DESCRIPTIVE TITLE./'"# Translation of ${widgetName} in LANGUAGE"'/' "template.pot.new"
|
|
||||||
sed -i 's/# Copyright (C) YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/'"# Copyright (C) $(date +%Y)"'/' "template.pot.new"
|
|
||||||
|
|
||||||
if [ -f "template.pot" ]; then
|
|
||||||
newPotDate=`grep "POT-Creation-Date:" template.pot.new | sed 's/.\{3\}$//'`
|
|
||||||
oldPotDate=`grep "POT-Creation-Date:" template.pot | sed 's/.\{3\}$//'`
|
|
||||||
sed -i 's/'"${newPotDate}"'/'"${oldPotDate}"'/' "template.pot.new"
|
|
||||||
changes=`diff "template.pot" "template.pot.new"`
|
|
||||||
if [ ! -z "$changes" ]; then
|
|
||||||
# There's been changes
|
|
||||||
sed -i 's/'"${oldPotDate}"'/'"${newPotDate}"'/' "template.pot.new"
|
|
||||||
mv "template.pot.new" "template.pot"
|
|
||||||
|
|
||||||
addedKeys=`echo "$changes" | grep "> msgid" | cut -c 9- | sort`
|
|
||||||
removedKeys=`echo "$changes" | grep "< msgid" | cut -c 9- | sort`
|
|
||||||
echo ""
|
|
||||||
echo "Added Keys:"
|
|
||||||
echo "$addedKeys"
|
|
||||||
echo ""
|
|
||||||
echo "Removed Keys:"
|
|
||||||
echo "$removedKeys"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
else
|
|
||||||
# No changes
|
|
||||||
rm "template.pot.new"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# template.pot didn't already exist
|
|
||||||
mv "template.pot.new" "template.pot"
|
|
||||||
fi
|
|
||||||
|
|
||||||
potMessageCount=`expr $(grep -Pzo 'msgstr ""\n(\n|$)' "template.pot" | grep -c 'msgstr ""')`
|
|
||||||
echo "| Locale | Lines | % Done|" > "./Status.md"
|
|
||||||
echo "|----------|---------|-------|" >> "./Status.md"
|
|
||||||
entryFormat="| %-8s | %7s | %5s |"
|
|
||||||
templateLine=`perl -e "printf(\"$entryFormat\", \"Template\", \"${potMessageCount}\", \"\")"`
|
|
||||||
echo "$templateLine" >> "./Status.md"
|
|
||||||
|
|
||||||
rm "${DIR}/infiles.list"
|
|
||||||
echo "[merge] Done extracting messages"
|
|
||||||
|
|
||||||
#---
|
|
||||||
echo "[merge] Merging messages"
|
|
||||||
catalogs=`find . -name '*.po' | sort`
|
|
||||||
for cat in $catalogs; do
|
|
||||||
echo "[merge] $cat"
|
|
||||||
catLocale=`basename ${cat%.*}`
|
|
||||||
|
|
||||||
widthArg=""
|
|
||||||
catUsesGenerator=`grep "X-Generator:" "$cat"`
|
|
||||||
if [ -z "$catUsesGenerator" ]; then
|
|
||||||
widthArg="--width=400"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp "$cat" "$cat.new"
|
|
||||||
sed -i 's/"Content-Type: text\/plain; charset=CHARSET\\n"/"Content-Type: text\/plain; charset=UTF-8\\n"/' "$cat.new"
|
|
||||||
|
|
||||||
msgmerge \
|
|
||||||
${widthArg} \
|
|
||||||
--add-location=file \
|
|
||||||
--no-fuzzy-matching \
|
|
||||||
-o "$cat.new" \
|
|
||||||
"$cat.new" "${DIR}/template.pot"
|
|
||||||
|
|
||||||
sed -i 's/# SOME DESCRIPTIVE TITLE./'"# Translation of ${widgetName} in ${catLocale}"'/' "$cat.new"
|
|
||||||
sed -i 's/# Translation of '"${widgetName}"' in LANGUAGE/'"# Translation of ${widgetName} in ${catLocale}"'/' "$cat.new"
|
|
||||||
sed -i 's/# Copyright (C) YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/'"# Copyright (C) $(date +%Y)"'/' "$cat.new"
|
|
||||||
|
|
||||||
poEmptyMessageCount=`expr $(grep -Pzo 'msgstr ""\n(\n|$)' "$cat.new" | grep -c 'msgstr ""')`
|
|
||||||
poMessagesDoneCount=`expr $potMessageCount - $poEmptyMessageCount`
|
|
||||||
poCompletion=`perl -e "printf(\"%d\", $poMessagesDoneCount * 100 / $potMessageCount)"`
|
|
||||||
poLine=`perl -e "printf(\"$entryFormat\", \"$catLocale\", \"${poMessagesDoneCount}/${potMessageCount}\", \"${poCompletion}%\")"`
|
|
||||||
echo "$poLine" >> "./Status.md"
|
|
||||||
|
|
||||||
# mv "$cat" "$cat.old"
|
|
||||||
mv "$cat.new" "$cat"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Populate ReadMe.md
|
|
||||||
sed -i -E 's`share\/plasma\/plasmoids\/(.+)\/translate`share/plasma/plasmoids/'"${plasmoidName}"'/translate`' ./ReadMe.md
|
|
||||||
if [[ "$website" == *"github.com"* ]]; then
|
|
||||||
sed -i -E 's`\[new issue\]\(https:\/\/github\.com\/(.+)\/(.+)\/issues\/new\)`[new issue]('"${website}"'/issues/new)`' ./ReadMe.md
|
|
||||||
fi
|
|
||||||
sed -i '/^|/ d' ./ReadMe.md # Remove status table from ReadMe
|
|
||||||
cat ./Status.md >> ./ReadMe.md
|
|
||||||
rm ./Status.md
|
|
||||||
|
|
||||||
echo "[merge] Done merging messages"
|
|
|
@ -1,103 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Version 6
|
|
||||||
# Requires plasmoidviewer v5.13.0
|
|
||||||
|
|
||||||
function checkIfLangInstalled {
|
|
||||||
if [ -x "$(command -v dpkg)" ]; then
|
|
||||||
dpkg -l ${1} >/dev/null 2>&1 || ( \
|
|
||||||
echo -e "${1} not installed.\nInstalling now before continuing.\n" \
|
|
||||||
; sudo apt install ${1} \
|
|
||||||
) || ( \
|
|
||||||
echo -e "\nError trying to install ${1}\nPlease run 'sudo apt install ${1}'\n" \
|
|
||||||
; exit 1 \
|
|
||||||
)
|
|
||||||
elif [ -x "$(command -v pacman)" ]; then
|
|
||||||
# TODO: run `locale -a` and check if the locale is enabled.
|
|
||||||
if false; then
|
|
||||||
# https://wiki.archlinux.org/index.php/Locale
|
|
||||||
# Uncomment the locale in /etc/locale.gen
|
|
||||||
# Then run `locale-gen`
|
|
||||||
echo -e "\nPlease install this locale in System Settings first.\n"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "\nPackage manager not recognized. If the widget is not translated, please install the package '${1}'\n"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
langInput="${1}"
|
|
||||||
lang=""
|
|
||||||
languagePack=""
|
|
||||||
|
|
||||||
if [[ "$langInput" =~ ":" ]]; then # String contains a colon so assume it's a locale code.
|
|
||||||
lang="${langInput}"
|
|
||||||
IFS=: read -r l1 l2 <<< "${lang}"
|
|
||||||
languagePack="language-pack-${l2}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
declare -a langArr=(
|
|
||||||
"ar_EG:ar:Arabic (Egypt)"
|
|
||||||
"bg_BG:bg:Bulgarian (Bulgaria)"
|
|
||||||
"da_DK:da:Danish (Denmark)"
|
|
||||||
"de_DE:de:German (Germany)"
|
|
||||||
"el_GR:el:Greek (Greece)"
|
|
||||||
"es_MX:es:Spanish (Mexico)"
|
|
||||||
"fr_CA:fr:French (Canada)"
|
|
||||||
"hr_HR:hr:Croatian (Croatia)"
|
|
||||||
"id_ID:id:Indonesian (Indonesia)"
|
|
||||||
"ko_KR:ko:Korean (South Korea)"
|
|
||||||
"nl_NL:nl:Dutch (Netherlands)"
|
|
||||||
"pl_PL:pl:Polish (Poland)"
|
|
||||||
"pt_BR:pt:Portuguese (Brazil)"
|
|
||||||
"ru_RU:ru:Russian (Russia)"
|
|
||||||
"tr_TR:tr:Turkish (Turkey)"
|
|
||||||
"uk_UA:uk:Ukrainian (Ukraine)"
|
|
||||||
"zh_CN:zh:Chinese (China)"
|
|
||||||
)
|
|
||||||
|
|
||||||
for i in "${langArr[@]}"; do
|
|
||||||
IFS=: read -r l1 l2 l3 <<< "$i"
|
|
||||||
if [ "$langInput" == "$l2" ]; then
|
|
||||||
lang="${l1}:${l2}"
|
|
||||||
languagePack="language-pack-${l2}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$lang" ]; then
|
|
||||||
echo "plasmoidlocaletest doesn't recognize the language '$lang'"
|
|
||||||
echo "Eg:"
|
|
||||||
scriptcmd='sh ./plasmoidlocaletest'
|
|
||||||
for i in "${langArr[@]}"; do
|
|
||||||
IFS=: read -r l1 l2 l3 <<< "$i"
|
|
||||||
echo " ${scriptcmd} ${l2} | ${l3}"
|
|
||||||
done
|
|
||||||
echo ""
|
|
||||||
echo "Or use a the full locale code:"
|
|
||||||
echo " ${scriptcmd} ar_EG:ar"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
IFS=: read -r l1 l2 <<< "${lang}"
|
|
||||||
l1="${l1}.UTF-8"
|
|
||||||
|
|
||||||
# Check if language is installed
|
|
||||||
if [ ! -z "$languagePack" ]; then
|
|
||||||
if [ "$lang" == "zh_CN:zh" ]; then languagePack="language-pack-zh-hans"
|
|
||||||
fi
|
|
||||||
|
|
||||||
checkIfLangInstalled "$languagePack" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo "LANGUAGE=\"${lang}\""
|
|
||||||
echo "LANG=\"${l1}\""
|
|
||||||
|
|
||||||
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
packageDir="${scriptDir}/.."
|
|
||||||
|
|
||||||
# Build local translations for plasmoidviewer
|
|
||||||
sh "${scriptDir}/build"
|
|
||||||
|
|
||||||
LANGUAGE="${lang}" LANG="${l1}" LC_TIME="${l1}" QML_DISABLE_DISK_CACHE=true plasmoidviewer -a "$packageDir" -l topedge -f horizontal -x 0 -y 0
|
|
|
@ -1,5 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.15
|
||||||
import org.kde.plasma.configuration 2.0
|
import org.kde.plasma.configuration
|
||||||
|
|
||||||
ConfigModel {
|
ConfigModel {
|
||||||
ConfigCategory {
|
ConfigCategory {
|
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||||
|
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||||
<kcfgfile name=""/>
|
<kcfgfile name=""/>
|
||||||
|
|
||||||
<group name="General">
|
<group name="General">
|
||||||
|
@ -19,7 +22,7 @@
|
||||||
<default>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"</default>
|
<default>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"</default>
|
||||||
</entry>
|
</entry>
|
||||||
<entry name="size" type="int">
|
<entry name="size" type="int">
|
||||||
<default>3</default>
|
<default>8</default>
|
||||||
</entry>
|
</entry>
|
||||||
<entry name="peekingEnabled" type="bool">
|
<entry name="peekingEnabled" type="bool">
|
||||||
<default>false</default>
|
<default>false</default>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,21 @@
|
||||||
|
import QtQuick 2.15
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
import org.kde.plasma.plasmoid
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: config
|
||||||
|
|
||||||
|
// Colors
|
||||||
|
function alpha(c, newAlpha) {
|
||||||
|
return Qt.rgba(c.r, c.g, c.b, newAlpha)
|
||||||
|
}
|
||||||
|
property color defaultEdgeColor: alpha(Kirigami.Theme.textColor, 0.4)
|
||||||
|
property color defaultHoveredColor: Kirigami.Theme.backgroundColor
|
||||||
|
property color defaultPressedColor: Kirigami.Theme.hoverColor
|
||||||
|
property color edgeColor: Plasmoid.configuration.edgeColor || defaultEdgeColor
|
||||||
|
property color hoveredColor: Plasmoid.configuration.hoveredColor || defaultHoveredColor
|
||||||
|
property color pressedColor: Plasmoid.configuration.pressedColor || defaultPressedColor
|
||||||
|
|
||||||
|
property bool isOpenSUSE: false // Replace qdbus with qdbus6 (Issue #25)
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko <me@ratijas.tk>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.kde.plasma.plasmoid 2.0
|
||||||
|
|
||||||
|
|
||||||
|
Controller {
|
||||||
|
id: controller
|
||||||
|
|
||||||
|
titleInactive: i18nc("@action:button", "Run custom command")
|
||||||
|
titleActive: titleInactive
|
||||||
|
|
||||||
|
descriptionActive: i18nc("@info:tooltip", "Run user-defined command when pressed")
|
||||||
|
descriptionInactive: descriptionActive
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
// override
|
||||||
|
function toggle() {
|
||||||
|
root.exec(Plasmoid.configuration.click_command);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko <me@ratijas.tk>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQml 2.15
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
/**
|
||||||
|
* Whether the effect is currently active, and can be deactivated.
|
||||||
|
*/
|
||||||
|
property bool active
|
||||||
|
|
||||||
|
property string titleActive
|
||||||
|
property string titleInactive
|
||||||
|
|
||||||
|
property string descriptionActive
|
||||||
|
property string descriptionInactive
|
||||||
|
|
||||||
|
readonly property string title: active ? titleActive : titleInactive
|
||||||
|
readonly property string description: active ? descriptionActive : descriptionInactive
|
||||||
|
|
||||||
|
// virtual
|
||||||
|
function toggle() {}
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2015 Sebastian Kügler <sebas@kde.org>
|
||||||
|
SPDX-FileCopyrightText: 2016 Anthony Fieroni <bvbfan@abv.bg>
|
||||||
|
SPDX-FileCopyrightText: 2018 David Edmundson <davidedmundson@kde.org>
|
||||||
|
SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko <me@ratijas.tk>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQml 2.15
|
||||||
|
|
||||||
|
import org.kde.taskmanager 0.1 as TaskManager
|
||||||
|
|
||||||
|
Controller {
|
||||||
|
id: controller
|
||||||
|
|
||||||
|
titleActive: i18nc("@action:button", "Restore All Minimized Windows")
|
||||||
|
titleInactive: i18nc("@action:button", "Minimize All Windows")
|
||||||
|
|
||||||
|
descriptionActive: i18nc("@info:tooltip", "Restores the previously minimized windows")
|
||||||
|
descriptionInactive: i18nc("@info:tooltip", "Shows the Desktop by minimizing all windows")
|
||||||
|
|
||||||
|
readonly property QtObject tasksModel: TaskManager.TasksModel {
|
||||||
|
id: tasksModel
|
||||||
|
sortMode: TaskManager.TasksModel.SortDisabled
|
||||||
|
groupMode: TaskManager.TasksModel.GroupDisabled
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property Connections activeTaskChangedConnection: Connections {
|
||||||
|
target: tasksModel
|
||||||
|
enabled: controller.active
|
||||||
|
|
||||||
|
function onActiveTaskChanged() {
|
||||||
|
if (tasksModel.activeTask.valid) { // to suppress changing focus to non windows, such as the desktop
|
||||||
|
controller.active = false;
|
||||||
|
controller.minimizedClients = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onVirtualDesktopChanged() {
|
||||||
|
controller.deactivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onActivityChanged() {
|
||||||
|
controller.deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of persistent model indexes from task manager model of
|
||||||
|
* clients minimized by us
|
||||||
|
*/
|
||||||
|
property var minimizedClients: []
|
||||||
|
|
||||||
|
function activate() {
|
||||||
|
const clients = [];
|
||||||
|
for (let i = 0; i < tasksModel.count; i++) {
|
||||||
|
const idx = tasksModel.makeModelIndex(i);
|
||||||
|
if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsHidden)) {
|
||||||
|
tasksModel.requestToggleMinimized(idx);
|
||||||
|
clients.push(tasksModel.makePersistentModelIndex(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
minimizedClients = clients;
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function deactivate() {
|
||||||
|
active = false;
|
||||||
|
for (let i = 0; i < minimizedClients.length; i++) {
|
||||||
|
const idx = minimizedClients[i];
|
||||||
|
// client deleted, do nothing
|
||||||
|
if (!idx.valid) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// if the user has restored it already, do nothing
|
||||||
|
if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsHidden)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
tasksModel.requestToggleMinimized(idx);
|
||||||
|
}
|
||||||
|
minimizedClients = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// override
|
||||||
|
function toggle() {
|
||||||
|
if (active) {
|
||||||
|
deactivate();
|
||||||
|
} else {
|
||||||
|
activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko <me@ratijas.tk>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.kde.plasma.private.showdesktop 0.1
|
||||||
|
import org.kde.plasma.plasmoid 2.0
|
||||||
|
|
||||||
|
|
||||||
|
Controller {
|
||||||
|
id: controller
|
||||||
|
|
||||||
|
titleInactive: i18nc("@action:button", "Peek at Desktop")
|
||||||
|
titleActive: Plasmoid.containment.corona.editMode ? titleInactive : i18nc("@action:button", "Stop Peeking at Desktop")
|
||||||
|
|
||||||
|
descriptionActive: i18nc("@info:tooltip", "Moves windows back to their original positions")
|
||||||
|
descriptionInactive: i18nc("@info:tooltip", "Temporarily shows the desktop by moving windows away")
|
||||||
|
|
||||||
|
active: showdesktop.showingDesktop
|
||||||
|
|
||||||
|
// override
|
||||||
|
function toggle() {
|
||||||
|
showdesktop.toggleDesktop();
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property ShowDesktop showdesktop: ShowDesktop {
|
||||||
|
id: showdesktop
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,243 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
import ".." as Widget
|
||||||
|
import "../libconfig" as LibConfig
|
||||||
|
|
||||||
|
|
||||||
|
LibConfig.FormKCM {
|
||||||
|
id: page
|
||||||
|
|
||||||
|
property string cfg_click_action: 'showdesktop'
|
||||||
|
property alias cfg_click_command: click_command.text
|
||||||
|
|
||||||
|
property string cfg_mousewheel_action: 'run_commands'
|
||||||
|
property alias cfg_mousewheel_up: mousewheel_up.text
|
||||||
|
property alias cfg_mousewheel_down: mousewheel_down.text
|
||||||
|
|
||||||
|
property int indentWidth: 24 * Screen.devicePixelRatio
|
||||||
|
|
||||||
|
Widget.AppletConfig {
|
||||||
|
id: config
|
||||||
|
}
|
||||||
|
|
||||||
|
function setClickCommand(command) {
|
||||||
|
cfg_click_action = 'run_command'
|
||||||
|
clickGroup_runcommand.checked = true
|
||||||
|
cfg_click_command = command
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMouseWheelCommands(up, down) {
|
||||||
|
cfg_mousewheel_action = 'run_commands'
|
||||||
|
mousewheelGroup_runcommands.checked = true
|
||||||
|
cfg_mousewheel_up = up
|
||||||
|
cfg_mousewheel_down = down
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
LibConfig.Heading {
|
||||||
|
text: i18n("Look")
|
||||||
|
useThickTopMargin: false
|
||||||
|
label.Layout.topMargin: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.SpinBox {
|
||||||
|
Kirigami.FormData.label: i18n("Size:")
|
||||||
|
configKey: 'size'
|
||||||
|
suffix: i18n("px")
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.ColorField {
|
||||||
|
Kirigami.FormData.label: i18n("Edge Color:")
|
||||||
|
configKey: 'edgeColor'
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.ColorField {
|
||||||
|
Kirigami.FormData.label: i18n("Hovered Color:")
|
||||||
|
configKey: 'hoveredColor'
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.ColorField {
|
||||||
|
Kirigami.FormData.label: i18n("Pressed Color:")
|
||||||
|
configKey: 'pressedColor'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
LibConfig.Heading {
|
||||||
|
text: i18n("Click")
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.RadioButtonGroup {
|
||||||
|
id: clickGroup
|
||||||
|
spacing: 2 * Screen.devicePixelRatio
|
||||||
|
Kirigami.FormData.isSection: true
|
||||||
|
|
||||||
|
QQC2.RadioButton {
|
||||||
|
text: i18nd("plasma_applet_org.kde.plasma.showdesktop", "Show Desktop")
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: cfg_click_action == 'showdesktop'
|
||||||
|
onClicked: cfg_click_action = 'showdesktop'
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
text: i18ndc("plasma_applet_org.kde.plasma.showdesktop", "@action", "Minimize All Windows")
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: cfg_click_action == 'minimizeall'
|
||||||
|
onClicked: cfg_click_action = 'minimizeall'
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
id: clickGroup_runcommand
|
||||||
|
text: i18n("Run Command")
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: cfg_click_action == 'run_command'
|
||||||
|
onClicked: cfg_click_action = 'run_command'
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Text { width: indentWidth } // indent
|
||||||
|
QQC2.TextField {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: click_command
|
||||||
|
wrapMode: QQC2.TextField.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Text { width: indentWidth } // indent
|
||||||
|
LibConfig.Alert {
|
||||||
|
text: i18n("Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18nd("kwin", "Toggle Present Windows (All desktops)")
|
||||||
|
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ExposeAll"'
|
||||||
|
onClicked: setClickCommand(command)
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18nd("kwin", "Toggle Present Windows (Current desktop)")
|
||||||
|
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Expose"'
|
||||||
|
onClicked: setClickCommand(command)
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18nd("kwin", "Toggle Present Windows (Window class)")
|
||||||
|
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ExposeClass"'
|
||||||
|
onClicked: setClickCommand(command)
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: clickGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18ndc("kwin", "@action Overview is the name of a Kwin effect", "Toggle Overview")
|
||||||
|
property string command: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Overview"'
|
||||||
|
onClicked: setClickCommand(command)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
LibConfig.Heading {
|
||||||
|
text: i18n("Mouse Wheel")
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.RadioButtonGroup {
|
||||||
|
id: mousewheelGroup
|
||||||
|
spacing: 0
|
||||||
|
Kirigami.FormData.isSection: true
|
||||||
|
|
||||||
|
QQC2.RadioButton {
|
||||||
|
id: mousewheelGroup_runcommands
|
||||||
|
text: i18n("Run Commands")
|
||||||
|
QQC2.ButtonGroup.group: mousewheelGroup.group
|
||||||
|
checked: cfg_mousewheel_action == 'run_commands'
|
||||||
|
onClicked: cfg_mousewheel_action = 'run_commands'
|
||||||
|
}
|
||||||
|
GridLayout {
|
||||||
|
columns: 3
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Text { width: indentWidth } // indent
|
||||||
|
QQC2.Label {
|
||||||
|
text: i18n("Scroll Up:")
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
}
|
||||||
|
QQC2.TextField {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: mousewheel_up
|
||||||
|
wrapMode: QQC2.TextField.Wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Text { width: indentWidth } // indent
|
||||||
|
QQC2.Label {
|
||||||
|
text: i18n("Scroll Down:")
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
}
|
||||||
|
QQC2.TextField {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: mousewheel_down
|
||||||
|
wrapMode: QQC2.TextField.Wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Text { width: indentWidth } // indent
|
||||||
|
LibConfig.Alert {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
text: i18n("Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: mousewheelGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18n("Volume (No UI) (amixer)")
|
||||||
|
property string upCommand: 'amixer -q sset Master 10%+'
|
||||||
|
property string downCommand: 'amixer -q sset Master 10%-'
|
||||||
|
// text: i18n("Volume (No UI) (pactl)")
|
||||||
|
// property string upCommand: 'pactl set-sink-volume "@DEFAULT_SINK@" "+10%"'
|
||||||
|
// property string downCommand: 'pactl set-sink-volume "@DEFAULT_SINK@" "-10%"'
|
||||||
|
onClicked: setMouseWheelCommands(upCommand, downCommand)
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: mousewheelGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18n("Volume (UI) (qdbus)")
|
||||||
|
property string upCommand: 'qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "increase_volume"'
|
||||||
|
property string downCommand: 'qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"'
|
||||||
|
onClicked: setMouseWheelCommands(upCommand, downCommand)
|
||||||
|
}
|
||||||
|
QQC2.RadioButton {
|
||||||
|
QQC2.ButtonGroup.group: mousewheelGroup.group
|
||||||
|
checked: false
|
||||||
|
text: i18n("Switch Desktop (qdbus)")
|
||||||
|
property string upCommand: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Left"'
|
||||||
|
property string downCommand: 'qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Right"'
|
||||||
|
onClicked: setMouseWheelCommands(upCommand, downCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
LibConfig.Heading {
|
||||||
|
text: i18n("Peek")
|
||||||
|
}
|
||||||
|
|
||||||
|
LibConfig.CheckBox {
|
||||||
|
Kirigami.FormData.label: i18n("Show desktop on hover:")
|
||||||
|
text: i18n("Enable")
|
||||||
|
configKey: 'peekingEnabled'
|
||||||
|
}
|
||||||
|
LibConfig.SpinBox {
|
||||||
|
Kirigami.FormData.label: i18n("Peek threshold:")
|
||||||
|
configKey: 'peekingThreshold'
|
||||||
|
suffix: i18n("ms")
|
||||||
|
stepSize: 50
|
||||||
|
from: 0
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
// Version 2
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
// Based on Bootstrap's alerts
|
||||||
|
// https://getbootstrap.com/docs/4.6/components/alerts/
|
||||||
|
Rectangle {
|
||||||
|
id: alertItem
|
||||||
|
Layout.fillWidth: true
|
||||||
|
property int horPadding: 4 * Screen.devicePixelRatio
|
||||||
|
property int vertPadding: 4 * Screen.devicePixelRatio
|
||||||
|
implicitHeight: vertPadding + alertLabel.implicitHeight + vertPadding
|
||||||
|
clip: true
|
||||||
|
border.width: 2
|
||||||
|
radius: 5 * Screen.devicePixelRatio
|
||||||
|
|
||||||
|
enum AlertType {
|
||||||
|
Positive,
|
||||||
|
Information,
|
||||||
|
Warning,
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
property int messageType: Alert.AlertType.Warning
|
||||||
|
|
||||||
|
color: {
|
||||||
|
if (messageType == Alert.AlertType.Information) { return "#d9edf7"
|
||||||
|
} else if (messageType == Alert.AlertType.Warning) { return "#fcf8e3"
|
||||||
|
} else if (messageType == Alert.AlertType.Error) { return "#f2dede"
|
||||||
|
} else { /* Positive */ return "#dff0d8" }
|
||||||
|
}
|
||||||
|
border.color: {
|
||||||
|
if (messageType == Alert.AlertType.Information) { return "#bcdff1"
|
||||||
|
} else if (messageType == Alert.AlertType.Warning) { return "#faf2cc"
|
||||||
|
} else if (messageType == Alert.AlertType.Error) { return "#ebcccc"
|
||||||
|
} else { /* Positive */ return "#d0e9c6" }
|
||||||
|
}
|
||||||
|
property color labelColor: {
|
||||||
|
if (messageType == Alert.AlertType.Information) { return "#31708f"
|
||||||
|
} else if (messageType == Alert.AlertType.Warning) { return "#8a6d3b"
|
||||||
|
} else if (messageType == Alert.AlertType.Error) { return "#a94442"
|
||||||
|
} else { /* Positive */ return "#3c763d" }
|
||||||
|
}
|
||||||
|
|
||||||
|
property alias icon: alertIcon
|
||||||
|
Kirigami.Icon {
|
||||||
|
id: alertIcon
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: alertItem.horPadding
|
||||||
|
width: alertLabel.fontInfo.pixelSize
|
||||||
|
height: alertLabel.fontInfo.pixelSize
|
||||||
|
|
||||||
|
source: {
|
||||||
|
if (messageType == Alert.AlertType.Information) { return "dialog-information-symbolic"
|
||||||
|
} else if (messageType == Alert.AlertType.Warning) { return "dialog-warning-symboli"
|
||||||
|
} else if (messageType == Alert.AlertType.Error) { return "dialog-error-symbolic"
|
||||||
|
} else { /* Positive */ return "dialog-ok-symbolic" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property alias label: alertLabel
|
||||||
|
property alias text: alertLabel.text
|
||||||
|
property alias wrapMode: alertLabel.wrapMode
|
||||||
|
property alias maximumLineCount: alertLabel.maximumLineCount
|
||||||
|
QQC2.Label {
|
||||||
|
id: alertLabel
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
color: alertItem.labelColor
|
||||||
|
linkColor: Kirigami.Theme.highlightColor
|
||||||
|
|
||||||
|
elide: Text.ElideRight
|
||||||
|
QQC2.ToolTip.visible: alertLabel.truncated
|
||||||
|
QQC2.ToolTip.text: alertLabel.text
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: alertItem.horPadding + (alertIcon.visible ? (alertIcon.width + alertItem.horPadding) : 0)
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: alertItem.horPadding
|
||||||
|
|
||||||
|
function onLinkActivated(link) {
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
|
||||||
|
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
// Version 5
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
|
||||||
|
QQC2.CheckBox {
|
||||||
|
id: configCheckBox
|
||||||
|
|
||||||
|
property string configKey: ''
|
||||||
|
checked: plasmoid.configuration[configKey]
|
||||||
|
onClicked: plasmoid.configuration[configKey] = !plasmoid.configuration[configKey]
|
||||||
|
}
|
|
@ -0,0 +1,159 @@
|
||||||
|
// Version 8
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Dialogs as QtDialogs
|
||||||
|
import QtQuick.Window
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
// https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html
|
||||||
|
import Qt5Compat.GraphicalEffects as QtGraphicalEffects // TODO Deprecated in Qt6
|
||||||
|
|
||||||
|
|
||||||
|
QQC2.TextField {
|
||||||
|
id: colorField
|
||||||
|
font.family: "monospace"
|
||||||
|
readonly property string defaultText: "#AARRGGBB"
|
||||||
|
placeholderText: defaultColor ? defaultColor : defaultText
|
||||||
|
|
||||||
|
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))
|
||||||
|
) {
|
||||||
|
colorField.value = text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property bool showAlphaChannel: true
|
||||||
|
property bool showPreviewBg: true
|
||||||
|
|
||||||
|
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 (!activeFocus) {
|
||||||
|
text = colorField.value
|
||||||
|
}
|
||||||
|
if (configKey) {
|
||||||
|
if (value == defaultColorValue) {
|
||||||
|
plasmoid.configuration[configKey] = ""
|
||||||
|
} else {
|
||||||
|
plasmoid.configuration[configKey] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
leftPadding: rightPadding + mouseArea.height + rightPadding
|
||||||
|
|
||||||
|
FontMetrics {
|
||||||
|
id: fontMetrics
|
||||||
|
font.family: colorField.font.family
|
||||||
|
font.italic: colorField.font.italic
|
||||||
|
font.pointSize: colorField.font.pointSize
|
||||||
|
font.pixelSize: colorField.font.pixelSize
|
||||||
|
font.weight: colorField.font.weight
|
||||||
|
}
|
||||||
|
readonly property int defaultWidth: Math.ceil(fontMetrics.advanceWidth(defaultText))
|
||||||
|
implicitWidth: rightPadding + Math.max(defaultWidth, contentWidth) + leftPadding
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.leftMargin: parent.rightPadding
|
||||||
|
anchors.topMargin: parent.topPadding
|
||||||
|
anchors.bottomMargin: parent.bottomPadding
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
width: height
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
|
onClicked: dialogLoader.active = true
|
||||||
|
|
||||||
|
// Color Preview Circle
|
||||||
|
Rectangle {
|
||||||
|
id: previewBgMask
|
||||||
|
visible: false
|
||||||
|
anchors.fill: parent
|
||||||
|
border.width: 1 * Screen.devicePixelRatio
|
||||||
|
border.color: "transparent"
|
||||||
|
radius: width / 2
|
||||||
|
}
|
||||||
|
QtGraphicalEffects.ConicalGradient {
|
||||||
|
id: previewBgGradient
|
||||||
|
visible: colorField.showPreviewBg
|
||||||
|
anchors.fill: parent
|
||||||
|
angle: 0.0
|
||||||
|
gradient: Gradient {
|
||||||
|
GradientStop { position: 0.00; color: "white" }
|
||||||
|
GradientStop { position: 0.24; color: "white" }
|
||||||
|
GradientStop { position: 0.25; color: "#cccccc" }
|
||||||
|
GradientStop { position: 0.49; color: "#cccccc" }
|
||||||
|
GradientStop { position: 0.50; color: "white" }
|
||||||
|
GradientStop { position: 0.74; color: "white" }
|
||||||
|
GradientStop { position: 0.75; color: "#cccccc" }
|
||||||
|
GradientStop { position: 1.00; color: "#cccccc" }
|
||||||
|
}
|
||||||
|
source: previewBgMask
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
id: previewFill
|
||||||
|
anchors.fill: parent
|
||||||
|
color: colorField.valueColor
|
||||||
|
border.width: 1 * Screen.devicePixelRatio
|
||||||
|
border.color: Kirigami.ColorUtils.linearInterpolation(color, Kirigami.Theme.textColor, 0.5)
|
||||||
|
radius: width / 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: dialogLoader
|
||||||
|
active: false
|
||||||
|
sourceComponent: QtDialogs.ColorDialog {
|
||||||
|
id: dialog
|
||||||
|
visible: true
|
||||||
|
modality: Qt.WindowModal
|
||||||
|
options: colorField.showAlphaChannel ? QtDialogs.ColorDialog.ShowAlphaChannel : 0
|
||||||
|
selectedColor: colorField.valueColor
|
||||||
|
onSelectedColorChanged: {
|
||||||
|
if (visible) {
|
||||||
|
colorField.text = selectedColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onAccepted: {
|
||||||
|
colorField.text = selectedColor
|
||||||
|
dialogLoader.active = false
|
||||||
|
}
|
||||||
|
onRejected: {
|
||||||
|
// This event is also triggered when the user clicks outside the popup modal.
|
||||||
|
// TODO Find a way to only trigger when Cancel is clicked.
|
||||||
|
colorField.text = initColor
|
||||||
|
dialogLoader.active = false
|
||||||
|
}
|
||||||
|
|
||||||
|
property color initColor
|
||||||
|
Component.onCompleted: {
|
||||||
|
initColor = colorField.valueColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Version 3
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.kcmutils as KCM
|
||||||
|
|
||||||
|
KCM.SimpleKCM {
|
||||||
|
id: simpleKCM
|
||||||
|
default property alias _formChildren: formLayout.data
|
||||||
|
|
||||||
|
Kirigami.FormLayout {
|
||||||
|
id: formLayout
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://invent.kde.org/plasma/plasma-desktop/-/blame/master/desktoppackage/contents/configuration/AppletConfiguration.qml
|
||||||
|
// AppletConfiguration.implicitWidth: Kirigami.Units.gridUnit * 40 = 720
|
||||||
|
// AppletConfiguration.Layout.minimumWidth: Kirigami.Units.gridUnit * 30 = 540
|
||||||
|
// In practice, Window.width = 744px is a typical FormLayout.wideMode switchWidth
|
||||||
|
// A rough guess is 128+24+180+10+360+24+20 = 746px
|
||||||
|
// TabSidebar=128x, Padding=24px, Labels=180px, Spacing=10px, Controls=360px, Padding=24px, Scrollbar=20px
|
||||||
|
// However the default is only 720px. So we'll set it to a 800px minimum to avoid wideMode=false
|
||||||
|
property int wideModeMinWidth: 800 * Screen.devicePixelRatio
|
||||||
|
Window.onWindowChanged: {
|
||||||
|
if (Window.window) {
|
||||||
|
Window.window.visibleChanged.connect(function(){
|
||||||
|
if (Window.window && Window.window.visible && Window.window.width < wideModeMinWidth) {
|
||||||
|
Window.window.width = wideModeMinWidth
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
// Version 6
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Example:
|
||||||
|
**
|
||||||
|
import './libconfig' as LibConfig
|
||||||
|
LibConfig.Heading {
|
||||||
|
text: i18n("SpinBox (Double)")
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// While the following Kirigami is very simple:
|
||||||
|
// Kirigami.Separator {
|
||||||
|
// Kirigami.FormData.label: "Heading"
|
||||||
|
// Kirigami.FormData.isSection: true
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// I want to be able to adjust the label size and make it bold.
|
||||||
|
// Kirigami's buddy Heading is level=3, which does not stand out
|
||||||
|
// very well. I also want to center the heading.
|
||||||
|
// Since we can't access the Heading in the buddy component, we
|
||||||
|
// need to make sure the Heading has no text, and draw our own.
|
||||||
|
ColumnLayout {
|
||||||
|
id: heading
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
property string text: ""
|
||||||
|
property alias separator: separator
|
||||||
|
property alias label: label
|
||||||
|
property bool useThickTopMargin: true
|
||||||
|
|
||||||
|
property Item __formLayout: {
|
||||||
|
if (parent && typeof parent.wideMode === 'boolean') {
|
||||||
|
return parent
|
||||||
|
} else if (typeof formLayout !== 'undefined' && typeof formLayout.wideMode === 'boolean') {
|
||||||
|
return formLayout
|
||||||
|
} else if (typeof page !== 'undefined' && typeof page.wideMode === 'boolean') {
|
||||||
|
return page
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
// Kirigami.FormData.isSection: true
|
||||||
|
Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.FormLabel
|
||||||
|
|
||||||
|
Kirigami.Separator {
|
||||||
|
id: separator
|
||||||
|
visible: false
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
|
Layout.bottomMargin: Kirigami.Units.largeSpacing
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.Heading {
|
||||||
|
id: label
|
||||||
|
Layout.topMargin: useThickTopMargin ? Kirigami.Units.largeSpacing * 3 : Kirigami.Units.largeSpacing
|
||||||
|
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: heading.text
|
||||||
|
level: 1
|
||||||
|
font.weight: Font.Bold
|
||||||
|
// horizontalAlignment: (!__formLayout || __formLayout.wideMode) ? Text.AlignHCenter : Text.AlignLeft
|
||||||
|
verticalAlignment: (!__formLayout || __formLayout.wideMode) ? Text.AlignVCenter : Text.AlignBottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--- Test Default Kirigami Heading
|
||||||
|
// Kirigami.Separator {
|
||||||
|
// property string text: ""
|
||||||
|
// Kirigami.FormData.label: text
|
||||||
|
// Kirigami.FormData.isSection: true
|
||||||
|
// property alias separator: separator
|
||||||
|
// Item {
|
||||||
|
// id: separator
|
||||||
|
// }
|
||||||
|
// }
|
|
@ -0,0 +1,67 @@
|
||||||
|
// Version 7
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Example:
|
||||||
|
**
|
||||||
|
import './libconfig' as LibConfig
|
||||||
|
LibConfig.RadioButtonGroup {
|
||||||
|
configKey: "priority"
|
||||||
|
model: [
|
||||||
|
{ value: "a", text: i18n("A") },
|
||||||
|
{ value: "b", text: i18n("B") },
|
||||||
|
{ value: "c", text: i18n("C") },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
ColumnLayout {
|
||||||
|
id: radioButtonGroup
|
||||||
|
|
||||||
|
property string configKey: ''
|
||||||
|
readonly property var configValue: configKey ? plasmoid.configuration[configKey] : ""
|
||||||
|
|
||||||
|
Kirigami.FormData.labelAlignment: Qt.AlignTop
|
||||||
|
|
||||||
|
property alias group: group
|
||||||
|
QQC2.ButtonGroup {
|
||||||
|
id: group
|
||||||
|
}
|
||||||
|
|
||||||
|
property alias model: buttonRepeater.model
|
||||||
|
|
||||||
|
// The main reason we put all the RadioButtons in
|
||||||
|
// a ColumnLayout is to shrink the spacing between the buttons.
|
||||||
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
|
// Assign buddyFor to the first RadioButton so that the Kirigami label aligns with it.
|
||||||
|
// Repeater is also a visibleChild, so avoid it.
|
||||||
|
Kirigami.FormData.buddyFor: {
|
||||||
|
for (var i = 0; i < visibleChildren.length; i++) {
|
||||||
|
if (!(visibleChildren[i] instanceof Repeater)) {
|
||||||
|
return visibleChildren[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: buttonRepeater
|
||||||
|
QQC2.RadioButton {
|
||||||
|
visible: typeof modelData.visible !== "undefined" ? modelData.visible : true
|
||||||
|
enabled: typeof modelData.enabled !== "undefined" ? modelData.enabled : true
|
||||||
|
text: modelData.text
|
||||||
|
checked: modelData.value === configValue
|
||||||
|
QQC2.ButtonGroup.group: radioButtonGroup.group
|
||||||
|
onClicked: {
|
||||||
|
focus = true
|
||||||
|
if (configKey) {
|
||||||
|
plasmoid.configuration[configKey] = modelData.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,225 @@
|
||||||
|
// Version 7
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Example:
|
||||||
|
**
|
||||||
|
import './libconfig' as LibConfig
|
||||||
|
// Integer
|
||||||
|
LibConfig.SpinBox {
|
||||||
|
configKey: "leftPadding"
|
||||||
|
suffix: "px"
|
||||||
|
from: 0
|
||||||
|
to: 1000
|
||||||
|
stepSize: 5
|
||||||
|
}
|
||||||
|
// Double
|
||||||
|
LibConfig.SpinBox {
|
||||||
|
configKey: "distance"
|
||||||
|
decimals: 3
|
||||||
|
suffix: "m"
|
||||||
|
minimumValue: 0.0
|
||||||
|
maximumValue: 1000.0
|
||||||
|
stepSize: Math.round(0.5 * factor)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// QQC1.SpinBox: https://github.com/qt/qtquickcontrols/blob/dev/src/controls/SpinBox.qml
|
||||||
|
// QQC2.SpinBox: https://github.com/qt/qtquickcontrols2/blob/5.15/src/imports/controls/SpinBox.qml
|
||||||
|
// KDE Config Theme: https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/master/org.kde.desktop/SpinBox.qml
|
||||||
|
// Qt6 QQC2.SpinBox: https://github.com/qt/qtquickcontrols2/blob/dev/src/imports/controls/basic/SpinBox.qml
|
||||||
|
QQC2.SpinBox {
|
||||||
|
id: spinBox
|
||||||
|
|
||||||
|
property string configKey: ''
|
||||||
|
readonly property var configValue: configKey ? plasmoid.configuration[configKey] : 0
|
||||||
|
|
||||||
|
readonly property real factor: Math.pow(10, decimals)
|
||||||
|
readonly property real valueReal: value / factor
|
||||||
|
value: Math.round(configValue * factor)
|
||||||
|
onValueRealChanged: serializeTimer.start()
|
||||||
|
|
||||||
|
readonly property int spinBox_MININT: Math.ceil(-2147483648 / factor)
|
||||||
|
readonly property int spinBox_MAXINT: Math.floor(2147483647 / factor)
|
||||||
|
from: Math.round(minimumValue * factor)
|
||||||
|
to: Math.round(maximumValue * factor)
|
||||||
|
|
||||||
|
// Reimplement QQC1 properties
|
||||||
|
// https://github.com/qt/qtquickcontrols/blob/dev/src/controls/SpinBox.qml
|
||||||
|
property int decimals: 0
|
||||||
|
property alias prefix: prefixLabel.text
|
||||||
|
property alias suffix: suffixLabel.text
|
||||||
|
property real minimumValue: 0
|
||||||
|
property real maximumValue: spinBox_MAXINT
|
||||||
|
|
||||||
|
// Avoid selecting prefix/suffix by drawing them overlayed on top.
|
||||||
|
// As a bonus, we can draw with in a different color (textColor at 60% opacity).
|
||||||
|
QQC2.Label {
|
||||||
|
id: prefixLabel
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.leftMargin: spinBox.leftPadding
|
||||||
|
anchors.topMargin: spinBox.topPadding
|
||||||
|
anchors.bottomMargin: spinBox.bottomPadding
|
||||||
|
font: spinBox.font
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
color: spinBox.palette.text
|
||||||
|
opacity: 0.6
|
||||||
|
}
|
||||||
|
QQC2.Label {
|
||||||
|
id: suffixLabel
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.rightMargin: spinBox.rightPadding
|
||||||
|
anchors.topMargin: spinBox.topPadding
|
||||||
|
anchors.bottomMargin: spinBox.bottomPadding
|
||||||
|
font: spinBox.font
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
color: spinBox.palette.text
|
||||||
|
opacity: 0.6
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer { // throttle
|
||||||
|
id: serializeTimer
|
||||||
|
interval: 300
|
||||||
|
onTriggered: {
|
||||||
|
if (configKey) {
|
||||||
|
if (decimals == 0) {
|
||||||
|
plasmoid.configuration[configKey] = spinBox.value
|
||||||
|
} else {
|
||||||
|
plasmoid.configuration[configKey] = spinBox.valueReal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note: Qt5 used RegExpValidator { regExp: /[\-\.\d]+/ }
|
||||||
|
// validator: RegularExpressionValidator {
|
||||||
|
// regularExpression: /[\-\.\d]+/
|
||||||
|
// }
|
||||||
|
validator: DoubleValidator {
|
||||||
|
bottom: Math.min(spinBox.from, spinBox.to)
|
||||||
|
top: Math.max(spinBox.from, spinBox.to)
|
||||||
|
decimals: spinBox.decimals
|
||||||
|
notation: DoubleValidator.StandardNotation
|
||||||
|
}
|
||||||
|
|
||||||
|
textFromValue: function(value, locale) {
|
||||||
|
return Number(value / factor).toFixed(decimals)
|
||||||
|
}
|
||||||
|
|
||||||
|
valueFromText: function(text, locale) {
|
||||||
|
var text2 = text
|
||||||
|
.replace(/[^\-\.\d]/g, '') // Remove non digit characters
|
||||||
|
.replace(/\.+/g, '.') // Allow user to type '.' instead of RightArrow to enter to decimals
|
||||||
|
var val = Number(text2)
|
||||||
|
if (isNaN(val)) {
|
||||||
|
val = -0
|
||||||
|
}
|
||||||
|
// console.log('valueFromText', text, val)
|
||||||
|
return Math.round(val * factor)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select value on foucs
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if (activeFocus) {
|
||||||
|
selectValue()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function selectValue() {
|
||||||
|
// Check if SpinBox.contentItem == TextInput
|
||||||
|
// https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/master/org.kde.desktop/SpinBox.qml
|
||||||
|
// https://doc.qt.io/qt-5/qml-qtquick-textinput.html#select-method
|
||||||
|
if (contentItem && contentItem instanceof TextInput) {
|
||||||
|
contentItem.selectAll()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixMinus(str) {
|
||||||
|
var minusIndex = str.indexOf('-')
|
||||||
|
if (minusIndex >= 0) {
|
||||||
|
var a = str.substr(0, minusIndex)
|
||||||
|
var b = str.substr(minusIndex+1)
|
||||||
|
console.log('a', a, 'b', b)
|
||||||
|
|
||||||
|
return '-' + a + b
|
||||||
|
} else {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function fixDecimals(str) {
|
||||||
|
var periodIndex = str.indexOf('.')
|
||||||
|
var a = str.substr(0, periodIndex+1)
|
||||||
|
var b = str.substr(periodIndex+1)
|
||||||
|
return a + b.replace(/\.+/g, '') // Remove extra periods
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixText(str) {
|
||||||
|
return fixMinus(fixDecimals(str))
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTextEdited() {
|
||||||
|
var oldText = spinBox.contentItem.text
|
||||||
|
// console.log('onTextEdited', 'oldText1', oldText)
|
||||||
|
oldText = fixText(oldText)
|
||||||
|
// console.log('onTextEdited', 'oldText2', oldText)
|
||||||
|
var oldPeriodIndex = oldText.indexOf('.')
|
||||||
|
if (oldPeriodIndex == -1) {
|
||||||
|
oldPeriodIndex = oldText.length
|
||||||
|
}
|
||||||
|
var oldCursorPosition = spinBox.contentItem.cursorPosition
|
||||||
|
var oldCursorDelta = oldPeriodIndex - oldCursorPosition
|
||||||
|
|
||||||
|
spinBox.value = spinBox.valueFromText(oldText, spinBox.locale)
|
||||||
|
spinBox.valueModified()
|
||||||
|
|
||||||
|
var newText = spinBox.contentItem.text
|
||||||
|
// console.log('onTextEdited', 'newText1', newText)
|
||||||
|
newText = fixText(newText)
|
||||||
|
// console.log('onTextEdited', 'newText2', newText)
|
||||||
|
var newPeriodIndex = newText.indexOf('.')
|
||||||
|
if (newPeriodIndex == -1) {
|
||||||
|
newPeriodIndex = newText.length
|
||||||
|
}
|
||||||
|
if (newText != spinBox.contentItem.text) {
|
||||||
|
spinBox.contentItem.text = Qt.binding(function(){
|
||||||
|
return spinBox.textFromValue(spinBox.value, spinBox.locale)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
spinBox.contentItem.cursorPosition = newPeriodIndex - oldCursorDelta
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindContentItem() {
|
||||||
|
if (contentItem && contentItem instanceof TextInput) {
|
||||||
|
// We bind the left/right padding in the TextInput so that
|
||||||
|
// clicking the prefix/suffix will focus the TextInput. If we set
|
||||||
|
// the SpinBox left/right padding, then they do not focus the TextInput.
|
||||||
|
contentItem.leftPadding = Qt.binding(function(){ return prefixLabel.implicitWidth })
|
||||||
|
contentItem.rightPadding = Qt.binding(function(){ return suffixLabel.implicitWidth })
|
||||||
|
|
||||||
|
// Bind value update on keypress, while retaining cursor position
|
||||||
|
spinBox.contentItem.textEdited.connect(spinBox.onTextEdited)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onContentItemChanged: {
|
||||||
|
bindContentItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data[i] instanceof Connections) {
|
||||||
|
// Remove the Connections where it changes the text/cursor when typing.
|
||||||
|
// onTextEdited { value = valueFromText() }
|
||||||
|
data[i].destroy()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bindContentItem()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,408 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2014 Ashish Madeti <ashishmadeti@gmail.com>
|
||||||
|
SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||||
|
SPDX-FileCopyrightText: 2019 Chris Holland <zrenfire@gmail.com>
|
||||||
|
SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko <me@ratijas.tk>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
|
import org.kde.plasma.core as PlasmaCore
|
||||||
|
import org.kde.plasma.plasma5support as Plasma5Support
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.ksvg as KSvg
|
||||||
|
|
||||||
|
import org.kde.plasma.plasmoid
|
||||||
|
|
||||||
|
PlasmoidItem {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
preferredRepresentation: fullRepresentation
|
||||||
|
toolTipSubText: activeController.description
|
||||||
|
|
||||||
|
AppletConfig {
|
||||||
|
id: config
|
||||||
|
}
|
||||||
|
|
||||||
|
Plasmoid.icon: "transform-move"
|
||||||
|
Plasmoid.title: activeController.title
|
||||||
|
Plasmoid.onActivated: {
|
||||||
|
if (isPeeking) {
|
||||||
|
isPeeking = false;
|
||||||
|
peekController.toggle();
|
||||||
|
}
|
||||||
|
activeController.toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
||||||
|
|
||||||
|
Layout.minimumWidth: Kirigami.Units.iconSizes.medium
|
||||||
|
Layout.minimumHeight: Kirigami.Units.iconSizes.medium
|
||||||
|
|
||||||
|
Layout.maximumWidth: vertical ? Layout.minimumWidth : Math.max(1, Plasmoid.configuration.size)
|
||||||
|
Layout.maximumHeight: vertical ? Math.max(1, Plasmoid.configuration.size) : Layout.minimumHeight
|
||||||
|
|
||||||
|
Layout.preferredWidth: Layout.maximumWidth
|
||||||
|
Layout.preferredHeight: Layout.maximumHeight
|
||||||
|
|
||||||
|
Plasmoid.constraintHints: Plasmoid.CanFillArea
|
||||||
|
|
||||||
|
readonly property bool inPanel: [PlasmaCore.Types.TopEdge, PlasmaCore.Types.RightEdge, PlasmaCore.Types.BottomEdge, PlasmaCore.Types.LeftEdge]
|
||||||
|
.includes(Plasmoid.location)
|
||||||
|
|
||||||
|
readonly property bool vertical: Plasmoid.location === PlasmaCore.Types.RightEdge || Plasmoid.location === PlasmaCore.Types.LeftEdge
|
||||||
|
|
||||||
|
readonly property Controller primaryController: {
|
||||||
|
if (Plasmoid.configuration.click_action == "minimizeall") {
|
||||||
|
return minimizeAllController;
|
||||||
|
} else if (Plasmoid.configuration.click_action == "showdesktop") {
|
||||||
|
return peekController;
|
||||||
|
} else {
|
||||||
|
return commandController;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property Controller activeController: {
|
||||||
|
if (minimizeAllController.active) {
|
||||||
|
return minimizeAllController;
|
||||||
|
} else {
|
||||||
|
return primaryController;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property bool isPeeking: false
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
activeFocusOnTab: true
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onClicked: Plasmoid.activated();
|
||||||
|
|
||||||
|
onEntered: {
|
||||||
|
if (Plasmoid.configuration.peekingEnabled)
|
||||||
|
peekTimer.start();
|
||||||
|
}
|
||||||
|
onExited: {
|
||||||
|
peekTimer.stop();
|
||||||
|
if (isPeeking) {
|
||||||
|
isPeeking = false;
|
||||||
|
peekController.toggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// org.kde.plasma.volume
|
||||||
|
property int wheelDelta: 0
|
||||||
|
onWheel: wheel => {
|
||||||
|
const delta = (wheel.inverted ? -1 : 1) * (wheel.angleDelta.y ? wheel.angleDelta.y : -wheel.angleDelta.x);
|
||||||
|
wheelDelta += delta;
|
||||||
|
// Magic number 120 for common "one click"
|
||||||
|
// See: https://qt-project.org/doc/qt-5/qml-qtquick-wheelevent.html#angleDelta-prop
|
||||||
|
while (wheelDelta >= 120) {
|
||||||
|
wheelDelta -= 120;
|
||||||
|
performMouseWheelUp();
|
||||||
|
}
|
||||||
|
while (wheelDelta <= -120) {
|
||||||
|
wheelDelta += 120;
|
||||||
|
performMouseWheelDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onPressed: {
|
||||||
|
switch (event.key) {
|
||||||
|
case Qt.Key_Space:
|
||||||
|
case Qt.Key_Enter:
|
||||||
|
case Qt.Key_Return:
|
||||||
|
case Qt.Key_Select:
|
||||||
|
Plasmoid.activated();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Accessible.name: Plasmoid.title
|
||||||
|
Accessible.description: toolTipSubText
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
|
||||||
|
PeekController {
|
||||||
|
id: peekController
|
||||||
|
}
|
||||||
|
|
||||||
|
MinimizeAllController {
|
||||||
|
id: minimizeAllController
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandController {
|
||||||
|
id: commandController
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.Icon {
|
||||||
|
anchors.fill: parent
|
||||||
|
active: mouseArea.containsMouse || activeController.active
|
||||||
|
visible: Plasmoid.containment.corona.editMode
|
||||||
|
source: Plasmoid.icon
|
||||||
|
}
|
||||||
|
|
||||||
|
// also activate when dragging an item over the plasmoid so a user can easily drag data to the desktop
|
||||||
|
DropArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onEntered: activateTimer.start()
|
||||||
|
onExited: activateTimer.stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: activateTimer
|
||||||
|
interval: 250 // to match TaskManager
|
||||||
|
onTriggered: Plasmoid.activated()
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: peekTimer
|
||||||
|
interval: Plasmoid.configuration.peekingThreshold
|
||||||
|
onTriggered: {
|
||||||
|
if (!minimizeAllController.active && !peekController.active) {
|
||||||
|
isPeeking = true;
|
||||||
|
peekController.toggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
state: {
|
||||||
|
if (mouseArea.containsPress) {
|
||||||
|
return "pressed";
|
||||||
|
} else if (mouseArea.containsMouse || mouseArea.activeFocus) {
|
||||||
|
return "hover";
|
||||||
|
} else {
|
||||||
|
return "normal";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component ButtonSurface : Rectangle {
|
||||||
|
property var containerMargins: {
|
||||||
|
let item = this;
|
||||||
|
while (item.parent) {
|
||||||
|
item = item.parent;
|
||||||
|
if (item.isAppletContainer) {
|
||||||
|
return item.getMargins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
property bool returnAllMargins: true
|
||||||
|
// The above makes sure margin is returned even for side margins
|
||||||
|
// that would be otherwise turned off.
|
||||||
|
topMargin: !vertical && containerMargins ? -containerMargins('top', returnAllMargins) : 0
|
||||||
|
leftMargin: vertical && containerMargins ? -containerMargins('left', returnAllMargins) : 0
|
||||||
|
rightMargin: vertical && containerMargins ? -containerMargins('right', returnAllMargins) : 0
|
||||||
|
bottomMargin: !vertical && containerMargins ? -containerMargins('bottom', returnAllMargins) : 0
|
||||||
|
}
|
||||||
|
Behavior on opacity { OpacityAnimator { duration: Kirigami.Units.longDuration; easing.type: Easing.OutCubic } }
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonSurface {
|
||||||
|
id: hoverSurface
|
||||||
|
color: Plasmoid.configuration.hoveredColor
|
||||||
|
opacity: mouseArea.state === "hover" ? 1 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonSurface {
|
||||||
|
id: pressedSurface
|
||||||
|
color: Plasmoid.configuration.pressedColor
|
||||||
|
opacity: mouseArea.state === "pressed" ? 1 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonSurface {
|
||||||
|
id: edgeLine
|
||||||
|
color: "transparent"
|
||||||
|
border.color: Plasmoid.configuration.edgeColor
|
||||||
|
border.width: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// Active/not active indicator
|
||||||
|
KSvg.FrameSvgItem {
|
||||||
|
property var containerMargins: {
|
||||||
|
let item = this;
|
||||||
|
while (item.parent) {
|
||||||
|
item = item.parent;
|
||||||
|
if (item.isAppletContainer) {
|
||||||
|
return item.getMargins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
property bool returnAllMargins: true
|
||||||
|
// The above makes sure margin is returned even for side margins
|
||||||
|
// that would be otherwise turned off.
|
||||||
|
topMargin: !vertical && containerMargins ? -containerMargins('top', returnAllMargins) : 0
|
||||||
|
leftMargin: vertical && containerMargins ? -containerMargins('left', returnAllMargins) : 0
|
||||||
|
rightMargin: vertical && containerMargins ? -containerMargins('right', returnAllMargins) : 0
|
||||||
|
bottomMargin: !vertical && containerMargins ? -containerMargins('bottom', returnAllMargins) : 0
|
||||||
|
}
|
||||||
|
imagePath: "widgets/tabbar"
|
||||||
|
visible: opacity > 0
|
||||||
|
prefix: {
|
||||||
|
let prefix;
|
||||||
|
switch (Plasmoid.location) {
|
||||||
|
case PlasmaCore.Types.LeftEdge:
|
||||||
|
prefix = "west-active-tab";
|
||||||
|
break;
|
||||||
|
case PlasmaCore.Types.TopEdge:
|
||||||
|
prefix = "north-active-tab";
|
||||||
|
break;
|
||||||
|
case PlasmaCore.Types.RightEdge:
|
||||||
|
prefix = "east-active-tab";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
prefix = "south-active-tab";
|
||||||
|
}
|
||||||
|
if (!hasElementPrefix(prefix)) {
|
||||||
|
prefix = "active-tab";
|
||||||
|
}
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
opacity: activeController.active ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Kirigami.Units.shortDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaCore.ToolTipArea {
|
||||||
|
id: toolTip
|
||||||
|
anchors.fill: parent
|
||||||
|
mainText: Plasmoid.title
|
||||||
|
subText: toolTipSubText
|
||||||
|
textFormat: Text.PlainText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://invent.kde.org/plasma/plasma5support/-/tree/master/src/declarativeimports/datasource.h
|
||||||
|
Plasma5Support.DataSource {
|
||||||
|
id: executeSource
|
||||||
|
engine: "executable"
|
||||||
|
connectedSources: []
|
||||||
|
|
||||||
|
property var listeners: ({}) // Empty Map
|
||||||
|
|
||||||
|
signal exited(string cmd, int exitCode, int exitStatus, string stdout, string stderr)
|
||||||
|
|
||||||
|
function getUniqueId(cmd) {
|
||||||
|
// Note: we assume that 'cmd' is executed quickly so that a previous call
|
||||||
|
// with the same 'cmd' has already finished (otherwise no new cmd will be
|
||||||
|
// added because it is already in the list)
|
||||||
|
// Workaround: We append spaces onto the user's command to workaround this.
|
||||||
|
var cmd2 = cmd
|
||||||
|
for (var i = 0; i < 10; i++) {
|
||||||
|
if (connectedSources.includes(cmd2)) {
|
||||||
|
cmd2 += ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cmd2
|
||||||
|
}
|
||||||
|
function exec(cmd, callback) {
|
||||||
|
const cmdId = getUniqueId(cmd)
|
||||||
|
if (typeof callback === 'function') {
|
||||||
|
if (listeners[cmdId]) {
|
||||||
|
exited.disconnect(listeners[cmdId])
|
||||||
|
delete listeners[cmdId]
|
||||||
|
}
|
||||||
|
var listener = execCallback.bind(executeSource, callback)
|
||||||
|
listeners[cmdId] = listener
|
||||||
|
}
|
||||||
|
connectSource(cmdId)
|
||||||
|
}
|
||||||
|
function execCallback(callback, cmd, exitCode, exitStatus, stdout, stderr) {
|
||||||
|
delete listeners[cmd]
|
||||||
|
callback(cmd, exitCode, exitStatus, stdout, stderr)
|
||||||
|
}
|
||||||
|
onNewData: function(sourceName, data) {
|
||||||
|
const cmd = sourceName
|
||||||
|
const exitCode = data["exit code"]
|
||||||
|
const exitStatus = data["exit status"]
|
||||||
|
const stdout = data["stdout"]
|
||||||
|
const stderr = data["stderr"]
|
||||||
|
const listener = listeners[cmd]
|
||||||
|
if (listener) {
|
||||||
|
listener(cmd, exitCode, exitStatus, stdout, stderr)
|
||||||
|
}
|
||||||
|
exited(cmd, exitCode, exitStatus, stdout, stderr)
|
||||||
|
disconnectSource(sourceName) // cmd finished
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function exec(cmd) {
|
||||||
|
let cmd2 = executeSource.getUniqueId(cmd)
|
||||||
|
if (config.isOpenSUSE) {
|
||||||
|
cmd2 = cmd2.replace(/^qdbus /, 'qdbus6 ')
|
||||||
|
}
|
||||||
|
executeSource.connectSource(cmd2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function performMouseWheelUp() {
|
||||||
|
root.exec(Plasmoid.configuration.mousewheel_up)
|
||||||
|
}
|
||||||
|
|
||||||
|
function performMouseWheelDown() {
|
||||||
|
root.exec(Plasmoid.configuration.mousewheel_down)
|
||||||
|
}
|
||||||
|
|
||||||
|
Plasmoid.contextualActions: [
|
||||||
|
PlasmaCore.Action {
|
||||||
|
visible: Plasmoid.immutability != PlasmaCore.Types.SystemImmutable
|
||||||
|
readonly property bool isLocked: Plasmoid.immutability != PlasmaCore.Types.Mutable
|
||||||
|
text: isLocked ? i18n("Unlock Widgets") : i18n("Lock Widgets")
|
||||||
|
icon.name: isLocked ? "object-unlocked" : "object-locked"
|
||||||
|
onTriggered: {
|
||||||
|
if (Plasmoid.immutability == PlasmaCore.Types.Mutable) {
|
||||||
|
Plasmoid.containment.corona.setImmutability(PlasmaCore.Types.UserImmutable)
|
||||||
|
} else if (Plasmoid.immutability == PlasmaCore.Types.UserImmutable) {
|
||||||
|
Plasmoid.containment.corona.setImmutability(PlasmaCore.Types.Mutable)
|
||||||
|
} else {
|
||||||
|
// ignore SystemImmutable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
PlasmaCore.Action {
|
||||||
|
text: minimizeAllController.titleInactive
|
||||||
|
checkable: true
|
||||||
|
checked: minimizeAllController.active
|
||||||
|
toolTip: minimizeAllController.description
|
||||||
|
enabled: !peekController.active
|
||||||
|
onTriggered: minimizeAllController.toggle()
|
||||||
|
},
|
||||||
|
PlasmaCore.Action {
|
||||||
|
text: peekController.titleInactive
|
||||||
|
checkable: true
|
||||||
|
checked: peekController.active
|
||||||
|
toolTip: peekController.description
|
||||||
|
enabled: !minimizeAllController.active
|
||||||
|
onTriggered: peekController.toggle()
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
function detectSUSE() {
|
||||||
|
executeSource.exec('env | grep VENDOR', function(cmd, exitCode, exitStatus, stdout, stderr) {
|
||||||
|
if (stdout.replace(/\n/g, ' ').trim() == 'VENDOR=suse') {
|
||||||
|
config.isOpenSUSE = true
|
||||||
|
}
|
||||||
|
// console.log('config.isOpenSUSE', config.isOpenSUSE)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
detectSUSE()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"KPackageStructure": "Plasma/Applet",
|
||||||
|
"KPlugin": {
|
||||||
|
"Authors": [
|
||||||
|
{
|
||||||
|
"Email": "zrenfire@gmail.com",
|
||||||
|
"Name": "Chris Holland"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"BugReportUrl": "https://github.com/Zren/plasma-applet-win7showdesktop/issues",
|
||||||
|
"Category": "Windows and Tasks",
|
||||||
|
"Description": "Show the Plasma desktop",
|
||||||
|
"Description[ar]": "أظهر سطح مكتب بلازما",
|
||||||
|
"Description[es]": "Mostrar el escritorio de Plasma",
|
||||||
|
"Description[fr]": "Afficher le bureau Plasma",
|
||||||
|
"Description[nl]": "Toont het Plasma-bureaublad",
|
||||||
|
"Description[pt_BR]": "Mostra a área de trabalho do Plasma",
|
||||||
|
"FormFactors": [
|
||||||
|
"desktop"
|
||||||
|
],
|
||||||
|
"Icon": "user-desktop",
|
||||||
|
"Id": "org.kde.plasma.win7showdesktop",
|
||||||
|
"License": "GPL-2.0+",
|
||||||
|
"Name": "Show Desktop (Win7)",
|
||||||
|
"Name[ar]": "أظهر سطح المكتب (Win7)",
|
||||||
|
"Name[es]": "Mostrar el escritorio (Win7)",
|
||||||
|
"Name[fr]": "Afficher un bureau (Win7)",
|
||||||
|
"Name[nl]": "Bureaublad tonen (Win7)",
|
||||||
|
"Name[pt_BR]": "Exibir a área de trabalho (Win7)",
|
||||||
|
"Version": "14",
|
||||||
|
"Website": "https://github.com/Zren/plasma-applet-win7showdesktop"
|
||||||
|
},
|
||||||
|
"X-Plasma-API-Minimum-Version": "6.0",
|
||||||
|
"X-Plasma-Provides": [
|
||||||
|
"org.kde.plasma.windowmanagement"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translate
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
| Locale | Lines | % Done|
|
||||||
|
|----------|---------|-------|
|
||||||
|
| Template | 36 | |
|
||||||
|
| ar | 5/36 | 13% |
|
||||||
|
| es | 23/36 | 63% |
|
||||||
|
| fr | 5/36 | 13% |
|
||||||
|
| nl | 23/36 | 63% |
|
||||||
|
| pt_BR | 19/36 | 52% |
|
||||||
|
|
||||||
|
|
||||||
|
## New Translations
|
||||||
|
|
||||||
|
* Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/Zren/plasma-applet-win7showdesktop/issues/new), name the file `spanish.txt`, attach the txt file to the issue (drag and drop).
|
||||||
|
|
||||||
|
Or if you know how to make a pull request
|
||||||
|
|
||||||
|
* Copy the `template.pot` file and name it your locale's code (Eg: `en`/`de`/`fr`) with the extension `.po`. Then fill out all the `msgstr ""`.
|
||||||
|
* Your region's locale code can be found at: https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes/28357857#28357857
|
||||||
|
|
||||||
|
## Scripts
|
||||||
|
|
||||||
|
Zren's `kpac` script can easily run the `gettext` commands for you, parsing the `metadata.json` and filling out any placeholders for you. `kpac` can be [downloaded here](https://github.com/Zren/plasma-applet-lib/blob/master/kpac) and should be placed at `~/Code/plasmoid-widgetname/kpac` to edit translations at `~/Code/plasmoid-widgetname/package/translate/`.
|
||||||
|
|
||||||
|
|
||||||
|
* `python3 ./kpac i18n` will parse the `i18n()` calls in the `*.qml` files and write it to the `template.pot` file. Then it will merge any changes into the `*.po` language files. Then it converts the `*.po` files to it's binary `*.mo` version and move it to `contents/locale/...` which will bundle the translations in the `*.plasmoid` without needing the user to manually install them.
|
||||||
|
* `python3 ./kpac localetest` will convert the `.po` to the `*.mo` files then run `plasmoidviewer` (part of `plasma-sdk`).
|
||||||
|
|
||||||
|
## How it works
|
||||||
|
|
||||||
|
Since KDE Frameworks v5.37, translations can be bundled with the zipped `*.plasmoid` file downloaded from the store.
|
||||||
|
|
||||||
|
* `xgettext` extracts the messages from the source code into a `template.pot`.
|
||||||
|
* Translators copy the `template.pot` to `fr.po` to translate the French language.
|
||||||
|
* When the source code is updated, we use `msgmerge` to update the `fr.po` based on the updated `template.pot`.
|
||||||
|
* When testing or releasing the widget, we convert the `.po` files to their binary `.mo` form with `msgfmt`.
|
||||||
|
|
||||||
|
The binary `.mo` translation files are placed in `package/contents/locale/` so you may want to add `*.mo` to your `.gitignore`.
|
||||||
|
|
||||||
|
```
|
||||||
|
package/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo
|
||||||
|
```
|
||||||
|
|
||||||
|
## Links
|
||||||
|
|
||||||
|
* https://develop.kde.org/docs/plasma/widget/translations-i18n/
|
||||||
|
* https://l10n.kde.org/stats/gui/trunk-kf5/team/fr/plasma-desktop/
|
||||||
|
* https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
|
||||||
|
* https://api.kde.org/frameworks/ki18n/html/prg_guide.html
|
||||||
|
|
||||||
|
> Version 8 of [Zren's i18n scripts](https://github.com/Zren/plasma-applet-lib).
|
|
@ -0,0 +1,170 @@
|
||||||
|
# Translation of win7showdesktop in ar
|
||||||
|
# Copyright (C) 2022
|
||||||
|
# This file is distributed under the same license as the win7showdesktop package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: win7showdesktop\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: ar <LL@li.org>\n"
|
||||||
|
"Language: ar\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr "أظهر سطح المكتب (Win7)"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr "أظهر سطح مكتب بلازما"
|
||||||
|
|
||||||
|
#: ../contents/config/config.qml
|
||||||
|
msgid "General"
|
||||||
|
msgstr "عامّ"
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Look"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Size:"
|
||||||
|
msgstr "الحجم:"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "px"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Edge Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Hovered Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Pressed Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Click"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Run Command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Mouse Wheel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Run Commands"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Scroll Up:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Scroll Down:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Volume (No UI) (amixer)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Volume (UI) (qdbus)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Switch Desktop (qdbus)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Peek"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Show desktop on hover:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Enable"
|
||||||
|
msgstr "مكّن"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Peek threshold:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "ms"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/main.qml
|
||||||
|
msgid "Unlock Widgets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/main.qml
|
||||||
|
msgid "Lock Widgets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
|
msgstr ""
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: win7showdesktop \n"
|
"Project-Id-Version: win7showdesktop \n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
"POT-Creation-Date: 2020-03-29 16:37-0400\n"
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
"PO-Revision-Date: 2019-10-19 12:36\n"
|
"PO-Revision-Date: 2019-10-19 12:36\n"
|
||||||
"Last-Translator: wunivesales <universales@protonmail.com>\n"
|
"Last-Translator: wunivesales <universales@protonmail.com>\n"
|
||||||
"Language-Team: Spanish <LL@li.org>\n"
|
"Language-Team: Spanish <LL@li.org>\n"
|
||||||
|
@ -17,10 +17,28 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr "Mostrar el escritorio (Win7)"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr "Mostrar el escritorio de Plasma"
|
||||||
|
|
||||||
#: ../contents/config/config.qml
|
#: ../contents/config/config.qml
|
||||||
msgid "General"
|
msgid "General"
|
||||||
msgstr "General"
|
msgstr "General"
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Look"
|
msgid "Look"
|
||||||
msgstr "Apariencia"
|
msgstr "Apariencia"
|
||||||
|
@ -53,6 +71,10 @@ msgstr "Click"
|
||||||
msgid "Run Command"
|
msgid "Run Command"
|
||||||
msgstr "Ejecutar comando:"
|
msgstr "Ejecutar comando:"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Mouse Wheel"
|
msgid "Mouse Wheel"
|
||||||
msgstr "Rueda del ratón"
|
msgstr "Rueda del ratón"
|
||||||
|
@ -101,10 +123,56 @@ msgstr "Límite de visualización:"
|
||||||
msgid "ms"
|
msgid "ms"
|
||||||
msgstr "ms"
|
msgstr "ms"
|
||||||
|
|
||||||
#: ../contents/ui/lib/AppletVersion.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "<b>Version:</b> %1"
|
msgid "Unlock Widgets"
|
||||||
msgstr "<b>Versión:</b> %1"
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/main.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "Toggle Lock Widgets (Plasma 5.18)"
|
msgid "Lock Widgets"
|
||||||
msgstr "Alternar widgets bloqueados (Plasma 5.18)"
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "<b>Version:</b> %1"
|
||||||
|
#~ msgstr "<b>Versión:</b> %1"
|
||||||
|
|
||||||
|
#~ msgid "Toggle Lock Widgets"
|
||||||
|
#~ msgstr "Alternar widgets bloqueados"
|
|
@ -0,0 +1,170 @@
|
||||||
|
# Translation of win7showdesktop in fr
|
||||||
|
# Copyright (C) 2022
|
||||||
|
# This file is distributed under the same license as the win7showdesktop package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: win7showdesktop\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: fr <LL@li.org>\n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr "Afficher un bureau (Win7)"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr "Afficher le bureau Plasma"
|
||||||
|
|
||||||
|
#: ../contents/config/config.qml
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Général"
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Look"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Size:"
|
||||||
|
msgstr "Taille : "
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "px"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Edge Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Hovered Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Pressed Color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Click"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Run Command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Mouse Wheel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Run Commands"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Scroll Up:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Scroll Down:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Volume (No UI) (amixer)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Volume (UI) (qdbus)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Switch Desktop (qdbus)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Peek"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Show desktop on hover:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Enable"
|
||||||
|
msgstr "Activer"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Peek threshold:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "ms"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/main.qml
|
||||||
|
msgid "Unlock Widgets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/main.qml
|
||||||
|
msgid "Lock Widgets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
|
msgstr ""
|
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: win7showdesktop\n"
|
"Project-Id-Version: win7showdesktop\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
"POT-Creation-Date: 2020-03-29 16:37-0400\n"
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
"PO-Revision-Date: 2020-03-30 13:57+0200\n"
|
"PO-Revision-Date: 2020-03-30 13:57+0200\n"
|
||||||
"Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n"
|
"Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n"
|
||||||
"Language-Team: Dutch <vistausss@outlook.com>\n"
|
"Language-Team: Dutch <vistausss@outlook.com>\n"
|
||||||
|
@ -18,10 +18,28 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Poedit 2.3\n"
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr "Bureaublad tonen (Win7)"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr "Toont het Plasma-bureaublad"
|
||||||
|
|
||||||
#: ../contents/config/config.qml
|
#: ../contents/config/config.qml
|
||||||
msgid "General"
|
msgid "General"
|
||||||
msgstr "Algemeen"
|
msgstr "Algemeen"
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Look"
|
msgid "Look"
|
||||||
msgstr "Uiterlijk"
|
msgstr "Uiterlijk"
|
||||||
|
@ -54,6 +72,12 @@ msgstr "Klikken"
|
||||||
msgid "Run Command"
|
msgid "Run Command"
|
||||||
msgstr "Opdracht uitvoeren"
|
msgstr "Opdracht uitvoeren"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid ""
|
||||||
|
"Note that in openSUSE, <b>qdbus</b> is automatically replaced with "
|
||||||
|
"<b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Mouse Wheel"
|
msgid "Mouse Wheel"
|
||||||
msgstr "Scrollwiel"
|
msgstr "Scrollwiel"
|
||||||
|
@ -102,10 +126,56 @@ msgstr "Gluurvertraging:"
|
||||||
msgid "ms"
|
msgid "ms"
|
||||||
msgstr "ms"
|
msgstr "ms"
|
||||||
|
|
||||||
#: ../contents/ui/lib/AppletVersion.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "<b>Version:</b> %1"
|
msgid "Unlock Widgets"
|
||||||
msgstr "<b>Versie:</b> %1"
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/main.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "Toggle Lock Widgets (Plasma 5.18)"
|
msgid "Lock Widgets"
|
||||||
msgstr "Widgets ver-/ontgrendelen (Plasma 5.18)"
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "<b>Version:</b> %1"
|
||||||
|
#~ msgstr "<b>Versie:</b> %1"
|
||||||
|
|
||||||
|
#~ msgid "Toggle Lock Widgets"
|
||||||
|
#~ msgstr "Widgets ver-/ontgrendelen"
|
|
@ -6,7 +6,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: win7showdesktop \n"
|
"Project-Id-Version: win7showdesktop \n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
"POT-Creation-Date: 2020-03-29 16:37-0400\n"
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
"PO-Revision-Date: 2020-15-01 10:25-0300\n"
|
"PO-Revision-Date: 2020-15-01 10:25-0300\n"
|
||||||
"Last-Translator: Andrew Miranda <kryptusql@protonmail.com>\n"
|
"Last-Translator: Andrew Miranda <kryptusql@protonmail.com>\n"
|
||||||
"Language-Team: Portuguese Brazilian <kryptusql@protonmail.com>\n"
|
"Language-Team: Portuguese Brazilian <kryptusql@protonmail.com>\n"
|
||||||
|
@ -15,10 +15,28 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr "Exibir a área de trabalho (Win7)"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr "Mostra a área de trabalho do Plasma"
|
||||||
|
|
||||||
#: ../contents/config/config.qml
|
#: ../contents/config/config.qml
|
||||||
msgid "General"
|
msgid "General"
|
||||||
msgstr "Geral"
|
msgstr "Geral"
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Look"
|
msgid "Look"
|
||||||
msgstr "Aparência"
|
msgstr "Aparência"
|
||||||
|
@ -51,6 +69,10 @@ msgstr "Clique"
|
||||||
msgid "Run Command"
|
msgid "Run Command"
|
||||||
msgstr "Executar comando:"
|
msgstr "Executar comando:"
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Mouse Wheel"
|
msgid "Mouse Wheel"
|
||||||
msgstr "Roda do mouse"
|
msgstr "Roda do mouse"
|
||||||
|
@ -89,7 +111,7 @@ msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Enable"
|
msgid "Enable"
|
||||||
msgstr ""
|
msgstr "Ativar"
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Peek threshold:"
|
msgid "Peek threshold:"
|
||||||
|
@ -99,10 +121,53 @@ msgstr ""
|
||||||
msgid "ms"
|
msgid "ms"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/lib/AppletVersion.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "<b>Version:</b> %1"
|
msgid "Unlock Widgets"
|
||||||
msgstr "<b>Versão:</b> %1"
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/main.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "Toggle Lock Widgets (Plasma 5.18)"
|
msgid "Lock Widgets"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "<b>Version:</b> %1"
|
||||||
|
#~ msgstr "<b>Versão:</b> %1"
|
|
@ -1,26 +1,44 @@
|
||||||
# Translation of win7showdesktop in LANGUAGE
|
# Translation of win7showdesktop in LANGUAGE
|
||||||
# Copyright (C) 2020
|
# Copyright (C) 2024
|
||||||
# This file is distributed under the same license as the win7showdesktop package.
|
# This file is distributed under the same license as the win7showdesktop package.
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
#
|
#
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: win7showdesktop \n"
|
"Project-Id-Version: win7showdesktop\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
"Report-Msgid-Bugs-To: https://github.com/Zren/plasma-applet-win7showdesktop\n"
|
||||||
"POT-Creation-Date: 2020-03-29 16:37-0400\n"
|
"POT-Creation-Date: 2024-05-01 10:07-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
"Language: \n"
|
"Language: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=CHARSET\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show Desktop (Win7)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../metadata.json
|
||||||
|
msgid "Show the Plasma desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/config/config.qml
|
#: ../contents/config/config.qml
|
||||||
msgid "General"
|
msgid "General"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Run custom command"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/CommandController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Run user-defined command when pressed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Look"
|
msgid "Look"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -53,6 +71,10 @@ msgstr ""
|
||||||
msgid "Run Command"
|
msgid "Run Command"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
|
msgid "Note that in openSUSE, <b>qdbus</b> is automatically replaced with <b>qdbus6</b>."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/config/ConfigGeneral.qml
|
#: ../contents/ui/config/ConfigGeneral.qml
|
||||||
msgid "Mouse Wheel"
|
msgid "Mouse Wheel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -101,10 +123,50 @@ msgstr ""
|
||||||
msgid "ms"
|
msgid "ms"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/lib/AppletVersion.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "<b>Version:</b> %1"
|
msgid "Unlock Widgets"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../contents/ui/main.qml
|
#: ../contents/ui/main.qml
|
||||||
msgid "Toggle Lock Widgets (Plasma 5.18)"
|
msgid "Lock Widgets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Restore All Minimized Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Minimize All Windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Restores the previously minimized windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/MinimizeAllController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Shows the Desktop by minimizing all windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Peek at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "Stop Peeking at Desktop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Moves windows back to their original positions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../contents/ui/PeekController.qml
|
||||||
|
msgctxt "@info:tooltip"
|
||||||
|
msgid "Temporarily shows the desktop by moving windows away"
|
||||||
msgstr ""
|
msgstr ""
|
Loading…
Reference in New Issue