From fc34808a9d56bae518a6679aebc0d30da12364cc Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Sat, 4 May 2024 13:43:30 +0500 Subject: [PATCH] Update --- README.md | 2 - ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 1639 -> 0 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 1713 -> 0 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 1314 -> 0 bytes .../contents/ui/AppletConfig.qml | 16 - .../contents/ui/config/ConfigGeneral.qml | 226 -------- .../contents/ui/lib/AppletVersion.qml | 49 -- .../contents/ui/lib/ConfigCheckBox.qml | 16 - .../contents/ui/lib/ConfigColor.qml | 109 ---- .../contents/ui/lib/ConfigPage.qml | 37 -- .../contents/ui/lib/ConfigSection.qml | 24 - .../contents/ui/lib/ConfigSpinBox.qml | 47 -- .../contents/ui/main.qml | 507 ------------------ com.github.zren.win7showdesktop/metadata.json | 31 -- .../translate/ReadMe.md | 39 -- .../translate/build | 53 -- .../translate/merge | 136 ----- .../translate/plasmoidlocaletest | 103 ---- .../contents/config/config.qml | 4 +- .../contents/config/main.xml | 7 +- ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 0 -> 667 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 0 -> 1629 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 0 -> 644 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 0 -> 1698 bytes ...a_applet_org.kde.plasma.win7showdesktop.mo | Bin 0 -> 1437 bytes .../contents/ui/AppletConfig.qml | 21 + .../contents/ui/CommandController.qml | 25 + .../contents/ui/Controller.qml | 26 + .../contents/ui/MinimizeAllController.qml | 93 ++++ .../contents/ui/PeekController.qml | 30 ++ .../contents/ui/config/ConfigGeneral.qml | 243 +++++++++ .../contents/ui/libconfig/Alert.qml | 96 ++++ .../contents/ui/libconfig/CheckBox.qml | 12 + .../contents/ui/libconfig/ColorField.qml | 159 ++++++ .../contents/ui/libconfig/FormKCM.qml | 33 ++ .../contents/ui/libconfig/Heading.qml | 83 +++ .../ui/libconfig/RadioButtonGroup.qml | 67 +++ .../contents/ui/libconfig/SpinBox.qml | 225 ++++++++ .../contents/ui/main.qml | 408 ++++++++++++++ org.kde.plasma.win7showdesktop/metadata.json | 37 ++ .../translate/ReadMe.md | 54 ++ .../translate/ar.po | 170 ++++++ .../translate/es.po | 80 ++- .../translate/fr.po | 170 ++++++ .../translate/nl.po | 82 ++- .../translate/pt_BR.po | 77 ++- .../translate/template.pot | 76 ++- 47 files changed, 2249 insertions(+), 1424 deletions(-) delete mode 100644 com.github.zren.win7showdesktop/contents/locale/es/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo delete mode 100644 com.github.zren.win7showdesktop/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo delete mode 100644 com.github.zren.win7showdesktop/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo delete mode 100644 com.github.zren.win7showdesktop/contents/ui/AppletConfig.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/config/ConfigGeneral.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/AppletVersion.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/ConfigCheckBox.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/ConfigColor.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/ConfigPage.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/ConfigSection.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/lib/ConfigSpinBox.qml delete mode 100644 com.github.zren.win7showdesktop/contents/ui/main.qml delete mode 100644 com.github.zren.win7showdesktop/metadata.json delete mode 100644 com.github.zren.win7showdesktop/translate/ReadMe.md delete mode 100644 com.github.zren.win7showdesktop/translate/build delete mode 100644 com.github.zren.win7showdesktop/translate/merge delete mode 100644 com.github.zren.win7showdesktop/translate/plasmoidlocaletest rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/contents/config/config.qml (69%) rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/contents/config/main.xml (81%) create mode 100644 org.kde.plasma.win7showdesktop/contents/locale/ar/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo create mode 100644 org.kde.plasma.win7showdesktop/contents/locale/es/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo create mode 100644 org.kde.plasma.win7showdesktop/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo create mode 100644 org.kde.plasma.win7showdesktop/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo create mode 100644 org.kde.plasma.win7showdesktop/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/AppletConfig.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/CommandController.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/Controller.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/MinimizeAllController.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/PeekController.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/config/ConfigGeneral.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/Alert.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/CheckBox.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/ColorField.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/FormKCM.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/Heading.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/RadioButtonGroup.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/libconfig/SpinBox.qml create mode 100644 org.kde.plasma.win7showdesktop/contents/ui/main.qml create mode 100644 org.kde.plasma.win7showdesktop/metadata.json create mode 100644 org.kde.plasma.win7showdesktop/translate/ReadMe.md create mode 100644 org.kde.plasma.win7showdesktop/translate/ar.po rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/translate/es.po (58%) create mode 100644 org.kde.plasma.win7showdesktop/translate/fr.po rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/translate/nl.po (59%) rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/translate/pt_BR.po (59%) rename {com.github.zren.win7showdesktop => org.kde.plasma.win7showdesktop}/translate/template.pot (55%) diff --git a/README.md b/README.md index c5c7885..06dec7f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,4 @@ Show desktop plasmoid [YooMoney](https://yoomoney.ru/to/4100115921160758) -[Qiwi](https://qiwi.com/n/VALERIAFADEEVA) - Etherium 0x981FBf878fe451BDB83BEaF68078394d4B13213f diff --git a/com.github.zren.win7showdesktop/contents/locale/es/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo b/com.github.zren.win7showdesktop/contents/locale/es/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo deleted file mode 100644 index 215eb15be17566f938aec3040cf07a9fad05bec4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1639 zcmZvbzi%Wp6vqvOUki7@@#{boriip#%>Fn8mm5NKAqgaC15vWcNr)fv%$OP9dh9vd zlg(X^kmzX;1uX>yLNs)cKY)q`5TZq*K|-RT;QKbSS?-7>&u8rS{QQ3T*9!}uFpP_s z&td+8xrq7MUHD-1?`G@*H~{Yj*TILtH^BSA1Mq(EUGO|8!38jYq<6Dfe+WK;^~WIT zecH&s03XKsn}*+mEv$b4p8|gZ>E1t^_21z0Sf9U#v8Ta4_&B%;Ld4!__&)d^Vn`bK zcW{dA{0Ke@{tS}ee>D87+5ZQm`_Dm{^e%$uzz+B}YlfJMzi`fqT z{QS^vZE(IUg~`}|{yp1Eoz+A$=h#QzQ5JsZBeQt>E`>> z&Bj{kS#^Xs>~)!jXe*0miQ^MxE+fpz%)QpGtgH*sw$D`-y;|o!8rhf^Ayhu@^>P)8 zI_aji?7i)z=~YvYB2iUZhUgAst(~``U3sXeMA5nkGUk{1gDcUX9}TYX!KL_xms&&N zLo{;2cr5}7#wWE=htdlzJzt*wyXoR;!NLTI4bsNm0gpuM$T2f-et; zSGDR|m(Nw^($@CY_QpK=LAT#pvnEIbCvH}7Fvz1oQ7Q8>PYdC^46p2uUW=CIdgSZ} z(nT94wV5(`%$E`sT5Q&j$6w#skkej72WXyHm!asZX;6p4owns%q3Mm)N;oA=ssvh0 zW@38Si2&Qwj>u^(w7LZo!{aYY6(kh+>29jX2XWxR<(zyU52aUH5>2%J-ii1C1YaIh+U>J*BoET>Ba?&OHMr1urGktoISS1`0D s%0%6+KI{5b9i%gmO`4WZw7pSFk=e7m-|+UHGH3NaBq;2OYl zH_`q;n?n2UF??X{#~HfWF2K@WrtKjco`0qcp{{XxS|I!nTy#}_ym%w!pQ|#lKpMpOihCcWr z#xLTKpz|#-oIeEyeQod=a1neP?1ImN1cr463~`=-m%-1$m%*>WkeBak|5q@?cfaOe zAcy}q7|y?pL#}~ufbW1^kb?yn^8OVV^#4@zXAttwEX)N9xqAgIXbACy9EALZe+1pZ z5b~J?jUhild$5pG9L=6b3wp!7kMaWs3wJlR5dYW^#;Gm#m-op!X>`2U>M!%D4qH)j zkh5-*5??XO*qC*-=qqAtq{#}!*3A)FO2)IB#^h|vRF3%Fj7YH_Q9k-`pILI5QAx~t z=()+Jol0YWQ3#!|bA89|46IR#ubQEb$If1fZf1r&A(wkoa-(?`L||B+5WYj{2N_?j zr<xx%m2xYw+8R zP2qgBYlU`7cw8D^Cs~l@cf2_`Am#WX4)LOL&b@0YuW)HW!ZJ4Mv=S*ryCjO3uT~+G z|F<~iS~a#dwz`ufbY|L(6{9_A=(txxsHbBeqLX@o4>DmL`K7(xThaVvUC?_#HtOnu zNu*9=KHrzV(Nh%)ExKiF;qa?+ z*toLktgvq@ndhY04vH>URH1w}w1cvo6o%hZDHVjy?J&pt@{oI@k-`(B6S6!%-5#?& z>B%a2nAi0=lqmW&XvAKivZzdNMH=EccbL?Pt%87MM~vLh70|#-nK1HZ+}u%C!)dBMXSCKRIIjY{pLoTcQ?j gG=;t-r05Zkr_Rq2X@|t{h(G*_3i5n1`=96ZFOa^foB#j- diff --git a/com.github.zren.win7showdesktop/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo b/com.github.zren.win7showdesktop/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo deleted file mode 100644 index b3b1670a2943cd2683ee53c5880c3c6654bc4a79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1314 zcma))OKTKC5XakRbbTxM0L4a7A~M;HY9{mP-@B@hdj`TalaBKC2n)(vz z550x>K|+5)wnM|rL!WG{HNHsJNu%SjYHOUItg}falO;Btwuw&~Wo*o@ktQn?yKWwm zrL=FpVayV1n8Fdi-62wJ){=9B^SMI9HOquf*}8AX<`Zj_;!~!p}$r-H}9bq^MDc`&7@JkLEe@6 zyz7{5T86I7QEse{8m=wVXrgGlsA*!}@jiEPwc3`xQ?y1BlU46n($!oEmx)N^xgsC^ z7OXORE1IK+GK?~s5}sl{S{toJ^>b0J&g->!6dz}6waN|QeAKi;J0(1(%dhCvQkOR* zY^mU5OZHLj3%9H;=hk?mGa*$dVjNd>yAW-Pnk2HA&!YCCT@dC!VZ~#qq|pC!{U0|g zjhV*uU|98$T4mB`Pa5Su%F&Ofo)1Hi`XWy{!aDMo7MfS13j@E<)_t5(?Ra&pJyYGgQzNxZMePl_#s=zWT}%(h~Pp Xw1n!IKUQ*{vcK;nw*S|`U@w0HzHdYF diff --git a/com.github.zren.win7showdesktop/contents/ui/AppletConfig.qml b/com.github.zren.win7showdesktop/contents/ui/AppletConfig.qml deleted file mode 100644 index d1cb17a..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/AppletConfig.qml +++ /dev/null @@ -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 -} diff --git a/com.github.zren.win7showdesktop/contents/ui/config/ConfigGeneral.qml b/com.github.zren.win7showdesktop/contents/ui/config/ConfigGeneral.qml deleted file mode 100644 index df7bebc..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/config/ConfigGeneral.qml +++ /dev/null @@ -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 - } - } - } -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/AppletVersion.qml b/com.github.zren.win7showdesktop/contents/ui/lib/AppletVersion.qml deleted file mode 100644 index b61caf5..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/AppletVersion.qml +++ /dev/null @@ -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("Version: %1", version) - } - - Component.onCompleted: { - var cmd = 'kreadconfig5 --file "' + metadataFilepath + '" --group "Desktop Entry" --key "X-KDE-PluginInfo-Version"' - executable.exec(cmd) - } - -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigCheckBox.qml b/com.github.zren.win7showdesktop/contents/ui/lib/ConfigCheckBox.qml deleted file mode 100644 index e2c0d05..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigCheckBox.qml +++ /dev/null @@ -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] -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigColor.qml b/com.github.zren.win7showdesktop/contents/ui/lib/ConfigColor.qml deleted file mode 100644 index 7a7bd9e..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigColor.qml +++ /dev/null @@ -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 - } - } - } -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigPage.qml b/com.github.zren.win7showdesktop/contents/ui/lib/ConfigPage.qml deleted file mode 100644 index 1711f63..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigPage.qml +++ /dev/null @@ -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 - } -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSection.qml b/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSection.qml deleted file mode 100644 index 64d303a..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSection.qml +++ /dev/null @@ -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 - } - } - } -} diff --git a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSpinBox.qml b/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSpinBox.qml deleted file mode 100644 index 76c2efb..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/lib/ConfigSpinBox.qml +++ /dev/null @@ -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 - } -} diff --git a/com.github.zren.win7showdesktop/contents/ui/main.qml b/com.github.zren.win7showdesktop/contents/ui/main.qml deleted file mode 100644 index 58cdbfd..0000000 --- a/com.github.zren.win7showdesktop/contents/ui/main.qml +++ /dev/null @@ -1,507 +0,0 @@ -/* - Copyright (C) 2019 Chris Holland - Copyright (C) 2014 Ashish Madeti - - 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() - } -} diff --git a/com.github.zren.win7showdesktop/metadata.json b/com.github.zren.win7showdesktop/metadata.json deleted file mode 100644 index ea2c2db..0000000 --- a/com.github.zren.win7showdesktop/metadata.json +++ /dev/null @@ -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" - ] -} diff --git a/com.github.zren.win7showdesktop/translate/ReadMe.md b/com.github.zren.win7showdesktop/translate/ReadMe.md deleted file mode 100644 index d1767a9..0000000 --- a/com.github.zren.win7showdesktop/translate/ReadMe.md +++ /dev/null @@ -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% | diff --git a/com.github.zren.win7showdesktop/translate/build b/com.github.zren.win7showdesktop/translate/build deleted file mode 100644 index 6d6f60a..0000000 --- a/com.github.zren.win7showdesktop/translate/build +++ /dev/null @@ -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 diff --git a/com.github.zren.win7showdesktop/translate/merge b/com.github.zren.win7showdesktop/translate/merge deleted file mode 100644 index 410e8a5..0000000 --- a/com.github.zren.win7showdesktop/translate/merge +++ /dev/null @@ -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" diff --git a/com.github.zren.win7showdesktop/translate/plasmoidlocaletest b/com.github.zren.win7showdesktop/translate/plasmoidlocaletest deleted file mode 100644 index a1a9546..0000000 --- a/com.github.zren.win7showdesktop/translate/plasmoidlocaletest +++ /dev/null @@ -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 diff --git a/com.github.zren.win7showdesktop/contents/config/config.qml b/org.kde.plasma.win7showdesktop/contents/config/config.qml similarity index 69% rename from com.github.zren.win7showdesktop/contents/config/config.qml rename to org.kde.plasma.win7showdesktop/contents/config/config.qml index 56bb046..b3004e3 100644 --- a/com.github.zren.win7showdesktop/contents/config/config.qml +++ b/org.kde.plasma.win7showdesktop/contents/config/config.qml @@ -1,5 +1,5 @@ -import QtQuick 2.0 -import org.kde.plasma.configuration 2.0 +import QtQuick 2.15 +import org.kde.plasma.configuration ConfigModel { ConfigCategory { diff --git a/com.github.zren.win7showdesktop/contents/config/main.xml b/org.kde.plasma.win7showdesktop/contents/config/main.xml similarity index 81% rename from com.github.zren.win7showdesktop/contents/config/main.xml rename to org.kde.plasma.win7showdesktop/contents/config/main.xml index 2feb271..31a4783 100644 --- a/com.github.zren.win7showdesktop/contents/config/main.xml +++ b/org.kde.plasma.win7showdesktop/contents/config/main.xml @@ -1,5 +1,8 @@ - + @@ -19,7 +22,7 @@ qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume" - 3 + 8 false diff --git a/org.kde.plasma.win7showdesktop/contents/locale/ar/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo b/org.kde.plasma.win7showdesktop/contents/locale/ar/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo new file mode 100644 index 0000000000000000000000000000000000000000..7e3d4f987dea09cb96a830c11dfd453a39bab29e GIT binary patch literal 667 zcmZ9J&2AGh6on0x9}PQLuwh{dA%Tz+5DO|3PzPp8Bh55Xl7i^YNz9C4VvlTx0%Au4 zOVkBVz#;)riJt}K9e4oGh7~KGg6jqvsaN`R#y-dQ+L~Wymfj(#6To>O0Zs!i0bet~ zdmn(4z-Qnrum_w2egemV-@w`tg#Lh@0tPz>Mx2JtWF?HEPTcL@hN#TOEaRld*@$AMaU)4q3QXi%MH#@u2(qhT;v7evcykGwF#KF%Q#;cgG zWB!483iHbY_+TtP!Prw^2Yd!R4?Ycc!9(D6@HucDJO~Pq^lsOC2Oh(I43gew_4yaz zQS862`7PMO{wMGS@E7o9@OSVP@IFX>w4R*EkAoyX4U+!5AXHet<|cRxF?HazJdGK1zk3h=ZHuxI&DM)$z3Ooh= z2)+US4ITz5d1UVhNcwMrbpJ9){%_U13DzZml(Cnp@5Cqag9cQp98kU~rpi7@cBX@J z^CBkIfCl9hu2i|FdeFZq9*X@0Cek$O3l`!+^If1WKR0b>NI9+So!ACdTDS!&xJ|Z18dLv ziL+YsB|A3pbhA-lnb|R4l71)Hg15JnIX^d%rM1i&o{?jR+%val{htA3=?=)H2}qk)Zi7DD0Ug@us{Svj0fY`$>QNwZK?4o9LWv<%UI zjJ4KoMC)=_(VwCv5oFBIEOstNoyDkgk$29-XWwe|gb&fc3FEa0C>tLI4{FH8-r`ng+`B@y)9j|Y!aI)Gm80zp$aWFX~U`m zQ9;dz)}<)l)g-80;bzU)DAd)zS_r44Nt8fi$&|{kxf5akdqYi#{FOqhyD-t)|0Y*K zLV?euiGp6tCRT;!MX9}@CxB9yK{$?Np=a%*63@_`2o;v`5;6e?xEP9Us6OVvIW-h9 zo{bLGKs UH@w|f=5g(h6V!Eb^3WUj7f&~kc>n+a literal 0 HcmV?d00001 diff --git a/org.kde.plasma.win7showdesktop/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo b/org.kde.plasma.win7showdesktop/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo new file mode 100644 index 0000000000000000000000000000000000000000..cc80b434e6b7800225616ec3271a219ea9c41a35 GIT binary patch literal 644 zcmZ9JF>ll`6vqt|P{RfTLSpbpg?tBMpmJN(K-~7Eq<6YYL3BaB+`Gi!vm@JSY1Oa6 z&d6kjf5Ns)WV8Pe7_r1j>=UF19R z0QrGDM1CQ+kw3`Z4MP5+wz(HK30XzmKz)QNF7*RygzqP)7{9Jt__Ttwv(UQeiLxwV zq?3hBM(Pwe894h9iokjk_7yB1G+xVK9j7}7X-fCwOwdh{ z#l3VpPLiP*jb35Yl#MKblqoq~AFB|NxCrV99N9geoAY_QjCeX# gMFoyFhK?HtvbkExwWHz6SuBU-QfUo8zj8|c0nenYrT_o{ literal 0 HcmV?d00001 diff --git a/org.kde.plasma.win7showdesktop/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo b/org.kde.plasma.win7showdesktop/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.win7showdesktop.mo new file mode 100644 index 0000000000000000000000000000000000000000..e34bcffe7d520d2861732a970708749971d086d7 GIT binary patch literal 1698 zcmaiz&u<(x6vs^|zm{L6{FFe#J)kC3lWaCZsV0OUP0}=NLspwj3LHS*otGVFJ@#OG zvY{7_T)4uiQYB8@xNzi%#6Q3d#9zRPzku(XOtK*yur%|rpP!$<@7ezI^2Kij+H3gU z!1o8fx9~l91V6O)1tA^-7r>{%CGc@@6?_7`4L%3A;)*>ArYd+>RTCm{QM-OPUn zK7;Z14Sxh%82=2u2>uGb0{#xZ3jPhUj@F~c_Ddk!uY&CVJ_r}F({K;`0XcjEvd#-w z%<)?w>w6h|61)Pw3BCOePuMcvbpM#gceefl40$v8cX~qvh&hMv&zksakH&B9q zfv*|d zjJV|v$y0VRd)K+K*m6}Mc`qk2qDwTce=_EtLhekKiY|I#x~NxKtS<^>GjXOL#Lmz= zW8|8f*z{zuTcVr0iCm*Fj;@q5_q1J_J+@_y%~_eVu*Nm!B)dk1LdnKM?CAT1*@=$B zd>ZPDY*2++vFA)xkevC*$=%IaIim`FM1E?ojg4;+M0tda+yM<^vY91&OW3m-SI!kU;qmcAnD)Si2kj~GKbj+*4+|U*CpL(+MWvw?+WoalT=VNuZ zlO7#v-Y8j9ky6=dciKsNF77GYto-CA`vl7)^h zO9+j06gfL>m*p^5K2TiQ?cYqUPyJZ$KKW$b4qc}0D3#X-I<~r|!j(&II$s2ARo26> z(pi?r-IWy@=MK-wfj*GYSrqKPvl)3gK3<-RT^-3AeK2nBIteV&k);DADFaB=#j(%7Jx0CkP=$bGy&C6VJ}9 zXJ&mD7ZeC7RT?B3XrQH`prt`6kf?|#=x7iPB?UGAcOSZ78Hv%&{$}31dG9|n?|z#* z^0`2J1N}|(@6q2v|L71tXg`B5g3rL0z+b_m;P2ou@K5kn@GtNPc<6<(-%*h5bCdZw z@MX-C2~)6v`5o|eumhd}w?NMKF?bsMbYlM!WWVn~{KSv=JVDN%K-TjClD`5z0C`@5 z94CUDcMs%zk3shP3}k&@fv3Q4C;VZ;U%->F{{fx@{|4U%&m!n?@H%)NybYcOHOTru z0a@P{Amok4z^Ea_zZ##1wQ+uq$$GfWp&v$Py{uu{5OVZRJm?~`0{#`#pVtm+vOcgT`gM!f5G$x}XEz3bezXuCR)yk8I*vF<5^*?On8a4kz^ zbMf3bh>grUW8|tE*mOGCtS~IxK(12Qj;@mP_qDyeFt){l$$u*UlP zNr!edXG&I8q*N|9mz&AbrKGtemzwD^1{a&n#$6R+()G#)qaq$e-n6-=foyBoawV^A z`$tu*!;X2U@-8}CDs5QA4Q#djTJDLr)3L#2 zxKoo@abDtxJ?C?kikngIDvwI!Ivg#L+;W-2N~QeMZ)~QO=s0Z1oh-Q~r(W489BO$; zSsj&^xE@>{cJ8+X1Tb(wK;%_=2%qOHnJyuuHPk)rrIJs-_Qd5VqgOp;3OB9TwhJ&F l=mBlxG8SD05e3UPk-SCL1LEzg<_#(jE@%A7#tXBO{s(|YX?p+w literal 0 HcmV?d00001 diff --git a/org.kde.plasma.win7showdesktop/contents/ui/AppletConfig.qml b/org.kde.plasma.win7showdesktop/contents/ui/AppletConfig.qml new file mode 100644 index 0000000..ffebf48 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/AppletConfig.qml @@ -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) +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/CommandController.qml b/org.kde.plasma.win7showdesktop/contents/ui/CommandController.qml new file mode 100644 index 0000000..3b92736 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/CommandController.qml @@ -0,0 +1,25 @@ +/* + SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko + + 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); + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/Controller.qml b/org.kde.plasma.win7showdesktop/contents/ui/Controller.qml new file mode 100644 index 0000000..138a6e0 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/Controller.qml @@ -0,0 +1,26 @@ +/* + SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko + + 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() {} +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/MinimizeAllController.qml b/org.kde.plasma.win7showdesktop/contents/ui/MinimizeAllController.qml new file mode 100644 index 0000000..8eb9000 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/MinimizeAllController.qml @@ -0,0 +1,93 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + SPDX-FileCopyrightText: 2016 Anthony Fieroni + SPDX-FileCopyrightText: 2018 David Edmundson + SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko + + 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(); + } + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/PeekController.qml b/org.kde.plasma.win7showdesktop/contents/ui/PeekController.qml new file mode 100644 index 0000000..8d7678d --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/PeekController.qml @@ -0,0 +1,30 @@ +/* + SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko + + 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 + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/config/ConfigGeneral.qml b/org.kde.plasma.win7showdesktop/contents/ui/config/ConfigGeneral.qml new file mode 100644 index 0000000..8a3f01d --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/config/ConfigGeneral.qml @@ -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, qdbus is automatically replaced with qdbus6.") + } + } + 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, qdbus is automatically replaced with qdbus6.") + } + } + 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 + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Alert.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Alert.qml new file mode 100644 index 0000000..66b96d7 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Alert.qml @@ -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 + } + } +} \ No newline at end of file diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/CheckBox.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/CheckBox.qml new file mode 100644 index 0000000..1b5dcbb --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/CheckBox.qml @@ -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] +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/ColorField.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/ColorField.qml new file mode 100644 index 0000000..264064d --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/ColorField.qml @@ -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 + } + } + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/FormKCM.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/FormKCM.qml new file mode 100644 index 0000000..e2ba60b --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/FormKCM.qml @@ -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 + } + }) + } + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Heading.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Heading.qml new file mode 100644 index 0000000..bff0043 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/Heading.qml @@ -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 +// } +// } diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/RadioButtonGroup.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/RadioButtonGroup.qml new file mode 100644 index 0000000..11ce126 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/RadioButtonGroup.qml @@ -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 + } + } + } + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/libconfig/SpinBox.qml b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/SpinBox.qml new file mode 100644 index 0000000..eb8908e --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/libconfig/SpinBox.qml @@ -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() + } +} diff --git a/org.kde.plasma.win7showdesktop/contents/ui/main.qml b/org.kde.plasma.win7showdesktop/contents/ui/main.qml new file mode 100644 index 0000000..54f2c19 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/contents/ui/main.qml @@ -0,0 +1,408 @@ +/* + SPDX-FileCopyrightText: 2014 Ashish Madeti + SPDX-FileCopyrightText: 2016 Kai Uwe Broulik + SPDX-FileCopyrightText: 2019 Chris Holland + SPDX-FileCopyrightText: 2022 ivan (@ratijas) tkachenko + + 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() + } +} diff --git a/org.kde.plasma.win7showdesktop/metadata.json b/org.kde.plasma.win7showdesktop/metadata.json new file mode 100644 index 0000000..2c59c2f --- /dev/null +++ b/org.kde.plasma.win7showdesktop/metadata.json @@ -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" + ] +} diff --git a/org.kde.plasma.win7showdesktop/translate/ReadMe.md b/org.kde.plasma.win7showdesktop/translate/ReadMe.md new file mode 100644 index 0000000..d51ab3b --- /dev/null +++ b/org.kde.plasma.win7showdesktop/translate/ReadMe.md @@ -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). diff --git a/org.kde.plasma.win7showdesktop/translate/ar.po b/org.kde.plasma.win7showdesktop/translate/ar.po new file mode 100644 index 0000000..f657d47 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/translate/ar.po @@ -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 , 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 \n" +"Language-Team: ar \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, qdbus is automatically replaced with qdbus6." +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 "" diff --git a/com.github.zren.win7showdesktop/translate/es.po b/org.kde.plasma.win7showdesktop/translate/es.po similarity index 58% rename from com.github.zren.win7showdesktop/translate/es.po rename to org.kde.plasma.win7showdesktop/translate/es.po index 937f6c0..30f5f36 100644 --- a/com.github.zren.win7showdesktop/translate/es.po +++ b/org.kde.plasma.win7showdesktop/translate/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 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" "Last-Translator: wunivesales \n" "Language-Team: Spanish \n" @@ -17,10 +17,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\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 msgid "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 msgid "Look" msgstr "Apariencia" @@ -53,6 +71,10 @@ msgstr "Click" msgid "Run Command" msgstr "Ejecutar comando:" +#: ../contents/ui/config/ConfigGeneral.qml +msgid "Note that in openSUSE, qdbus is automatically replaced with qdbus6." +msgstr "" + #: ../contents/ui/config/ConfigGeneral.qml msgid "Mouse Wheel" msgstr "Rueda del ratón" @@ -101,10 +123,56 @@ msgstr "Límite de visualización:" msgid "ms" msgstr "ms" -#: ../contents/ui/lib/AppletVersion.qml -msgid "Version: %1" -msgstr "Versión: %1" +#: ../contents/ui/main.qml +msgid "Unlock Widgets" +msgstr "" #: ../contents/ui/main.qml -msgid "Toggle Lock Widgets (Plasma 5.18)" -msgstr "Alternar widgets bloqueados (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 "" + +#~ msgid "Version: %1" +#~ msgstr "Versión: %1" + +#~ msgid "Toggle Lock Widgets" +#~ msgstr "Alternar widgets bloqueados" diff --git a/org.kde.plasma.win7showdesktop/translate/fr.po b/org.kde.plasma.win7showdesktop/translate/fr.po new file mode 100644 index 0000000..938aa20 --- /dev/null +++ b/org.kde.plasma.win7showdesktop/translate/fr.po @@ -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 , 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 \n" +"Language-Team: fr \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, qdbus is automatically replaced with qdbus6." +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 "" diff --git a/com.github.zren.win7showdesktop/translate/nl.po b/org.kde.plasma.win7showdesktop/translate/nl.po similarity index 59% rename from com.github.zren.win7showdesktop/translate/nl.po rename to org.kde.plasma.win7showdesktop/translate/nl.po index be77dae..1127c4d 100644 --- a/com.github.zren.win7showdesktop/translate/nl.po +++ b/org.kde.plasma.win7showdesktop/translate/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 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" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -18,10 +18,28 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\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 msgid "General" 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 msgid "Look" msgstr "Uiterlijk" @@ -54,6 +72,12 @@ msgstr "Klikken" msgid "Run Command" msgstr "Opdracht uitvoeren" +#: ../contents/ui/config/ConfigGeneral.qml +msgid "" +"Note that in openSUSE, qdbus is automatically replaced with " +"qdbus6." +msgstr "" + #: ../contents/ui/config/ConfigGeneral.qml msgid "Mouse Wheel" msgstr "Scrollwiel" @@ -102,10 +126,56 @@ msgstr "Gluurvertraging:" msgid "ms" msgstr "ms" -#: ../contents/ui/lib/AppletVersion.qml -msgid "Version: %1" -msgstr "Versie: %1" +#: ../contents/ui/main.qml +msgid "Unlock Widgets" +msgstr "" #: ../contents/ui/main.qml -msgid "Toggle Lock Widgets (Plasma 5.18)" -msgstr "Widgets ver-/ontgrendelen (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 "" + +#~ msgid "Version: %1" +#~ msgstr "Versie: %1" + +#~ msgid "Toggle Lock Widgets" +#~ msgstr "Widgets ver-/ontgrendelen" diff --git a/com.github.zren.win7showdesktop/translate/pt_BR.po b/org.kde.plasma.win7showdesktop/translate/pt_BR.po similarity index 59% rename from com.github.zren.win7showdesktop/translate/pt_BR.po rename to org.kde.plasma.win7showdesktop/translate/pt_BR.po index 6b3223b..4d48bd2 100644 --- a/com.github.zren.win7showdesktop/translate/pt_BR.po +++ b/org.kde.plasma.win7showdesktop/translate/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: 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" "Last-Translator: Andrew Miranda \n" "Language-Team: Portuguese Brazilian \n" @@ -15,10 +15,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\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 msgid "General" 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 msgid "Look" msgstr "Aparência" @@ -51,6 +69,10 @@ msgstr "Clique" msgid "Run Command" msgstr "Executar comando:" +#: ../contents/ui/config/ConfigGeneral.qml +msgid "Note that in openSUSE, qdbus is automatically replaced with qdbus6." +msgstr "" + #: ../contents/ui/config/ConfigGeneral.qml msgid "Mouse Wheel" msgstr "Roda do mouse" @@ -89,7 +111,7 @@ msgstr "" #: ../contents/ui/config/ConfigGeneral.qml msgid "Enable" -msgstr "" +msgstr "Ativar" #: ../contents/ui/config/ConfigGeneral.qml msgid "Peek threshold:" @@ -99,10 +121,53 @@ msgstr "" msgid "ms" msgstr "" -#: ../contents/ui/lib/AppletVersion.qml -msgid "Version: %1" -msgstr "Versão: %1" +#: ../contents/ui/main.qml +msgid "Unlock Widgets" +msgstr "" #: ../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 "" + +#~ msgid "Version: %1" +#~ msgstr "Versão: %1" diff --git a/com.github.zren.win7showdesktop/translate/template.pot b/org.kde.plasma.win7showdesktop/translate/template.pot similarity index 55% rename from com.github.zren.win7showdesktop/translate/template.pot rename to org.kde.plasma.win7showdesktop/translate/template.pot index 1c9ffa3..08a23c4 100644 --- a/com.github.zren.win7showdesktop/translate/template.pot +++ b/org.kde.plasma.win7showdesktop/translate/template.pot @@ -1,26 +1,44 @@ # Translation of win7showdesktop in LANGUAGE -# Copyright (C) 2020 +# Copyright (C) 2024 # This file is distributed under the same license as the win7showdesktop package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: win7showdesktop \n" +"Project-Id-Version: 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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \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" +#: ../metadata.json +msgid "Show Desktop (Win7)" +msgstr "" + +#: ../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 "" @@ -53,6 +71,10 @@ msgstr "" msgid "Run Command" msgstr "" +#: ../contents/ui/config/ConfigGeneral.qml +msgid "Note that in openSUSE, qdbus is automatically replaced with qdbus6." +msgstr "" + #: ../contents/ui/config/ConfigGeneral.qml msgid "Mouse Wheel" msgstr "" @@ -101,10 +123,50 @@ msgstr "" msgid "ms" msgstr "" -#: ../contents/ui/lib/AppletVersion.qml -msgid "Version: %1" +#: ../contents/ui/main.qml +msgid "Unlock Widgets" msgstr "" #: ../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 ""