From 8965ccefe9f6dc9501b6f85aba781fa3a9c5c00c Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Sun, 13 Jul 2025 20:35:57 +0500 Subject: [PATCH] Update --- .../contents/config/main.xml | 3 +- .../plasma_applet_com.github.adhec.Menu11.mo | Bin 2713 -> 2793 bytes .../contents/ui/AToolButton.qml | 33 +- .../contents/ui/ActionMenu.qml | 4 +- .../contents/ui/CompactRepresentation.qml | 6 +- .../contents/ui/ConfigGeneral.qml | 34 +- .../contents/ui/Footer.qml | 153 +++-- .../contents/ui/ItemGridDelegate.qml | 14 +- .../contents/ui/ItemGridDelegateColumns.qml | 6 +- .../contents/ui/ItemGridDelegateColumns_t.qml | 6 +- .../contents/ui/ItemGridView.qml | 86 +-- .../contents/ui/ItemMultiGridView.qml | 146 ++--- .../contents/ui/MenuRepresentation.qml | 537 +++++++++++------- com.github.adhec.Menu11/contents/ui/main.qml | 31 +- com.github.adhec.Menu11/translate/ReadMe.md | 16 +- com.github.adhec.Menu11/translate/fr.po | 6 +- com.github.adhec.Menu11/translate/ko.po | 6 +- com.github.adhec.Menu11/translate/nl.po | 6 +- com.github.adhec.Menu11/translate/pl.po | 6 +- com.github.adhec.Menu11/translate/pt_BR.po | 6 +- com.github.adhec.Menu11/translate/ru.po | 6 +- .../translate/template.pot | 8 +- com.github.adhec.Menu11/translate/tr.po | 6 +- 23 files changed, 666 insertions(+), 459 deletions(-) diff --git a/com.github.adhec.Menu11/contents/config/main.xml b/com.github.adhec.Menu11/contents/config/main.xml index 2d9a4bd..d1f6c74 100644 --- a/com.github.adhec.Menu11/contents/config/main.xml +++ b/com.github.adhec.Menu11/contents/config/main.xml @@ -42,7 +42,7 @@ - 6 + 7 @@ -91,6 +91,5 @@ true - diff --git a/com.github.adhec.Menu11/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.Menu11.mo b/com.github.adhec.Menu11/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.Menu11.mo index 8b3ac50cb8707eca509665b546b716971c0905d1..28b7cfc2f5407330b01462a18f0cc85145bb50fa 100644 GIT binary patch delta 876 zcmX}q%PWLY7{~E5W-zYfGUI+3_ayfymmS4M%ED?&in1VOV>yzLlq?i0mTWXk5+eTq zy|Ym+*(jwfu(43`{k>kEI`8M4_x7CgoU;{p34|ZBJR63nq!rP+UBzIxyjQyw|22nq( z!Axw!bnJ7+!0`>kJYJy7`z)jS5`2%W33nSQ$i>Q^HqxS3` z_2C=Vpqts1VI3;L0IC9E?80@_gszYR8671}T%q^=B3t|a7ySD_bfC0%3ME!hWfP>a z2s^nZrpc=k+9s`B=Ol-gPvd;q!5mCEja{%q3u9;PNHMLy9V%>x%BGSlwAb1vm0qjS z;jtqc@7{MMPR|CXrf0^Z5zm9CXxqB5POXS_Y(--8vDKh;z>TxmYHZm$imoL2TtCl= BP+tH5 delta 799 zcmXxiJuE{}7{>8aZM8*<()y@ssgFd`mPRC4h}9$_Hls~UVv(zh#bl7wA|^34k!vzw zu}MfwQr`)Qq&ti7f3E9IPJj3Go_o&wo^w88dok-V>f1F$hSo(J^%#@K*&2R`p!csI z!Yuu9Y{F#>;yN~B5o>V=!&t%q9=h+#*h>G*{r?ty##pApgP#}AuJ2e+zlxgh3pL>n zHe;BtBA7z;bJ&JcsPT)a1eY*|tEh2X*p4Ms;>YM`eRIl#7QDbHUZEy@!VrF9H+slY z{WQ+7OGBuMS6DTPn>c{`n7~UM#uu!^DBGbOPNL?Yz#QwFIUWjFL=8MaRd9|Cc!R3= z0Xwnk_5+lmh2ogO0;X^QM{o_5&=IPzYwX8Y?86|{SQ?P!VGQR{XS9v_-~b2F#vZJo zCjLfMo+sN$oJJ+GfozPEqzX{AY@SKe6uq<-ns!Tt5|(pGl(o*7opO#sRsV<1koBAe zm6Q@uk{vXKDp%-i6%^-ONUn=>Z2C_Tr)k@DuQ@p<63%LFCt_#4Wsm*lyYt!ip|Ix{ D>~cGI diff --git a/com.github.adhec.Menu11/contents/ui/AToolButton.qml b/com.github.adhec.Menu11/contents/ui/AToolButton.qml index 7f4380c..89655cb 100644 --- a/com.github.adhec.Menu11/contents/ui/AToolButton.qml +++ b/com.github.adhec.Menu11/contents/ui/AToolButton.qml @@ -1,21 +1,23 @@ -import QtQuick 2.4 +import QtQuick import QtQuick.Controls -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore +import QtQuick.Layouts +import org.kde.plasma.core as PlasmaCore import org.kde.kirigami as Kirigami Rectangle{ id:item - implicitHeight: Math.floor( Kirigami.Units.gridUnit * 1.8) - width: Math.floor(lb.implicitWidth + Kirigami.Units.smallSpacing * 5 + icon.width) - + property int buttonHeight: Math.floor(Kirigami.Units.gridUnit * 2) + implicitHeight: buttonHeight + implicitWidth: row.implicitWidth + (Kirigami.Units.mediumSpacing * 2) border.width: mouseItem.containsMouse || focus || activeFocus ? 2 : 1 - border.color: mouseItem.containsMouse || focus || activeFocus ? Kirigami.Theme.highlightColor : colorWithAlpha(Kirigami.Theme.textColor,0.2) - radius: 3 - color: Kirigami.Theme.backgroundColor + border.color: Qt.rgba(0.5, 0.5, 0.5, 0.6) // Gray border always + + radius: 5 + color: mouseItem.containsMouse ? Qt.rgba(0.7, 0.7, 0.7, 0.3) : Kirigami.Theme.backgroundColor + smooth: true // Plasmoid.configuration.iconSmooth focus: true @@ -29,23 +31,26 @@ Rectangle{ //Keys.onEnterPressed: item.clicked() Keys.onSpacePressed: item.clicked() - RowLayout{ + RowLayout { id: row anchors.fill: parent - anchors.leftMargin: Kirigami.Units.smallSpacing * 2 - anchors.rightMargin: Kirigami.Units.smallSpacing * 2 + anchors.margins: Kirigami.Units.smallSpacing + anchors.topMargin: Kirigami.Units.smallSpacing / 2 + anchors.bottomMargin: Kirigami.Units.smallSpacing / 2 spacing: Kirigami.Units.smallSpacing LayoutMirroring.enabled: mirror - Label{ + Label { id: lb color: Kirigami.Theme.textColor + Layout.leftMargin: Kirigami.Units.smallSpacing } + Kirigami.Icon { id: icon implicitHeight: Kirigami.Units.gridUnit implicitWidth: implicitHeight - smooth: true // Plasmoid.configuration.iconSmooth + smooth: true } } diff --git a/com.github.adhec.Menu11/contents/ui/ActionMenu.qml b/com.github.adhec.Menu11/contents/ui/ActionMenu.qml index be10f70..2615e50 100644 --- a/com.github.adhec.Menu11/contents/ui/ActionMenu.qml +++ b/com.github.adhec.Menu11/contents/ui/ActionMenu.qml @@ -5,9 +5,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -import QtQuick 2.15 +import QtQuick -import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.extras as PlasmaExtras Item { id: root diff --git a/com.github.adhec.Menu11/contents/ui/CompactRepresentation.qml b/com.github.adhec.Menu11/contents/ui/CompactRepresentation.qml index cc388de..699ca74 100644 --- a/com.github.adhec.Menu11/contents/ui/CompactRepresentation.qml +++ b/com.github.adhec.Menu11/contents/ui/CompactRepresentation.qml @@ -17,11 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -import QtQuick 2.0 -import QtQuick.Layouts 1.1 +import QtQuick +import QtQuick.Layouts import org.kde.plasma.plasmoid -import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.core as PlasmaCore import org.kde.kirigami as Kirigami Item { diff --git a/com.github.adhec.Menu11/contents/ui/ConfigGeneral.qml b/com.github.adhec.Menu11/contents/ui/ConfigGeneral.qml index f324076..b6e5809 100644 --- a/com.github.adhec.Menu11/contents/ui/ConfigGeneral.qml +++ b/com.github.adhec.Menu11/contents/ui/ConfigGeneral.qml @@ -17,26 +17,26 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -//import QtQuick 2.15 -//import QtQuick.Controls 2.15 -//import QtQuick.Dialogs 1.2 -//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.kquickcontrolsaddons 2.0 as KQuickAddons -//import org.kde.draganddrop 2.0 as DragDrop -//import org.kde.kirigami 2.4 as Kirigami +//import QtQuick +//import QtQuick.Controls +//import QtQuick.Dialogs +//import QtQuick.Layouts +//import org.kde.plasma.core as PlasmaCore +//import org.kde.plasma.components as PlasmaComponents +//import org.kde.kquickcontrolsaddons as KQuickAddons +//import org.kde.draganddrop as DragDrop +//import org.kde.kirigami as Kirigami -import QtQuick 2.15 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 2.15 -import org.kde.draganddrop 2.0 as DragDrop -import org.kde.kirigami 2.5 as Kirigami +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import org.kde.draganddrop as DragDrop +import org.kde.kirigami as Kirigami import org.kde.iconthemes as KIconThemes import org.kde.plasma.core as PlasmaCore -import org.kde.kirigami 2.20 as Kirigami -import org.kde.ksvg 1.0 as KSvg -import org.kde.plasma.plasmoid 2.0 +import org.kde.kirigami as Kirigami +import org.kde.ksvg as KSvg +import org.kde.plasma.plasmoid import org.kde.kcmutils as KCM diff --git a/com.github.adhec.Menu11/contents/ui/Footer.qml b/com.github.adhec.Menu11/contents/ui/Footer.qml index 792928d..ad5ec7c 100644 --- a/com.github.adhec.Menu11/contents/ui/Footer.qml +++ b/com.github.adhec.Menu11/contents/ui/Footer.qml @@ -1,32 +1,31 @@ -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.plasmoid +import org.kde.plasma.core as PlasmaCore -import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.extras as PlasmaExtras import org.kde.plasma.private.kicker 0.1 as Kicker import org.kde.coreaddons 1.0 as KCoreAddons // kuser import org.kde.plasma.private.shell 2.0 -import org.kde.kwindowsystem 1.0 +import org.kde.kwindowsystem import Qt5Compat.GraphicalEffects -import org.kde.kquickcontrolsaddons 2.0 +import org.kde.kquickcontrolsaddons -import org.kde.plasma.components 3.0 as PlasmaComponents3 -import org.kde.plasma.private.quicklaunch 1.0 +import org.kde.plasma.components as PlasmaComponents3 +import org.kde.plasma.private.quicklaunch import org.kde.kirigami as Kirigami -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.plasma5support as P5Support import org.kde.plasma.private.sessions as Sessions -import org.kde.ksvg 1.0 as KSvg +import org.kde.ksvg as KSvg import org.kde.kcmutils as KCM -import org.kde.plasma.plasmoid 2.0 - +import org.kde.plasma.plasmoid RowLayout{ @@ -35,6 +34,14 @@ RowLayout{ KCoreAddons.KUser { id: kuser } Logic { id: logic } + Sessions.SessionManagement { + id: sessionManager + } + + Sessions.SessionsModel { + id: sessionsModel + } + P5Support.DataSource { id: pmEngine engine: "powermanagement" @@ -103,63 +110,91 @@ RowLayout{ text: qsTr(kuser.fullName) } + PlasmaComponents3.ToolButton { + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: logic.openUrl("file:///usr/share/applications/org.kde.dolphin.desktop") + } + icon.width: 24 + icon.height: 24 + icon.name: "user-home" + + Layout.leftMargin: 10 + PlasmaComponents3.ToolTip.delay: 1000 + PlasmaComponents3.ToolTip.timeout: 1000 + PlasmaComponents3.ToolTip.visible: hovered + PlasmaComponents3.ToolTip.text: i18n("User Home") + } + + PlasmaComponents3.ToolButton { + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: logic.openUrl("file:///usr/share/applications/systemsettings.desktop") + } + icon.width: 24 + icon.height: 24 + icon.name: "configure" + Layout.leftMargin: 10 + PlasmaComponents3.ToolTip.delay: 1000 + PlasmaComponents3.ToolTip.timeout: 1000 + PlasmaComponents3.ToolTip.visible: hovered + PlasmaComponents3.ToolTip.text: i18n("System Preferences") + } + Item{ Layout.fillWidth: true } - Sessions.SessionManagement { - id: sm - } - - Sessions.SessionsModel { - id: sessionsModel - } - - PlasmaComponents3.ToolButton { - icon.name: "user-home" - onClicked: logic.openUrl("file:///usr/share/applications/org.kde.dolphin.desktop") - ToolTip.delay: 200 - ToolTip.timeout: 1000 - ToolTip.visible: hovered - ToolTip.text: i18n("User Home") - } - - PlasmaComponents3.ToolButton { - icon.name: "configure" - onClicked: logic.openUrl("file:///usr/share/applications/systemsettings.desktop") - ToolTip.delay: 1000 - ToolTip.timeout: 1000 - ToolTip.visible: hovered - ToolTip.text: i18n("System Preferences") - } - PlasmaComponents3.ToolButton { + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + //onClicked: pmEngine.performOperation("lockScreen") + //enabled: pmEngine.data["Sleep States"]["LockScreen"] + onClicked: sessionManager.lock() + } + icon.width: 24 + icon.height: 24 icon.name: "system-lock-screen" - //onClicked: pmEngine.performOperation("lockScreen") - //enabled: pmEngine.data["Sleep States"]["LockScreen"] - onClicked: sm.lock() - ToolTip.delay: 200 - ToolTip.timeout: 1000 - ToolTip.visible: hovered - ToolTip.text: i18n("Lock Screen") + Layout.rightMargin: 10 + PlasmaComponents3.ToolTip.delay: 1000 + PlasmaComponents3.ToolTip.timeout: 1000 + PlasmaComponents3.ToolTip.visible: hovered + PlasmaComponents3.ToolTip.text: i18n("Lock Screen") } PlasmaComponents3.ToolButton { + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: sessionManager.switchUser() + } + icon.width: 24 + icon.height: 24 icon.name: "system-switch-user" - onClicked: sm.switchUser() - ToolTip.delay: 200 - ToolTip.timeout: 1000 - ToolTip.visible: hovered - ToolTip.text: i18n("Switch User") + Layout.rightMargin: 10 + PlasmaComponents3.ToolTip.delay: 1000 + PlasmaComponents3.ToolTip.timeout: 1000 + PlasmaComponents3.ToolTip.visible: hovered + PlasmaComponents3.ToolTip.text: i18n("Switch User") } PlasmaComponents3.ToolButton { - icon.name: "system-shutdown" - // onClicked: sm.requestShutdown() - onClicked: sm.requestLogoutPrompt() - ToolTip.delay: 200 - ToolTip.timeout: 1000 - ToolTip.visible: hovered - ToolTip.text: i18n("Shutdown") + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + // onClicked: sessionManager.requestShutdown() + onClicked: sessionManager.requestLogoutPrompt() + } + icon.width: 24 + icon.height: 24 + icon.name: "system-shutdown" + Layout.rightMargin: 10 + PlasmaComponents3.ToolTip.delay: 1000 + PlasmaComponents3.ToolTip.timeout: 1000 + PlasmaComponents3.ToolTip.visible: hovered + PlasmaComponents3.ToolTip.text: i18n("Shutdown") } } diff --git a/com.github.adhec.Menu11/contents/ui/ItemGridDelegate.qml b/com.github.adhec.Menu11/contents/ui/ItemGridDelegate.qml index 29dd546..c2744b4 100644 --- a/com.github.adhec.Menu11/contents/ui/ItemGridDelegate.qml +++ b/com.github.adhec.Menu11/contents/ui/ItemGridDelegate.qml @@ -6,10 +6,10 @@ import QtQuick -import org.kde.plasma.components 3.0 as PlasmaComponents3 +import org.kde.plasma.components as PlasmaComponents3 import org.kde.plasma.core as PlasmaCore -import org.kde.kirigami 2.20 as Kirigami -import QtQuick.Layouts 1.1 +import org.kde.kirigami as Kirigami +import QtQuick.Layouts import "code/tools.js" as Tools Item { @@ -50,6 +50,14 @@ Item { } } + WheelHandler { + acceptedDevices: PointerDevice.Mouse + onWheel: { + if (typeof scrollFlickable !== "undefined" && scrollFlickable) { + scrollFlickable.contentY -= wheel.angleDelta.y + } + } + } Kirigami.Icon { id: icon diff --git a/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns.qml b/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns.qml index d009714..cbc3728 100644 --- a/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns.qml +++ b/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns.qml @@ -6,10 +6,10 @@ import QtQuick -import org.kde.plasma.components 3.0 as PlasmaComponents3 +import org.kde.plasma.components as PlasmaComponents3 import org.kde.plasma.core as PlasmaCore -import org.kde.kirigami 2.20 as Kirigami -import QtQuick.Layouts 1.1 +import org.kde.kirigami as Kirigami +import QtQuick.Layouts import "code/tools.js" as Tools Item { diff --git a/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns_t.qml b/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns_t.qml index afb4bf6..6098ea2 100644 --- a/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns_t.qml +++ b/com.github.adhec.Menu11/contents/ui/ItemGridDelegateColumns_t.qml @@ -6,10 +6,10 @@ import QtQuick -import org.kde.plasma.components 3.0 as PlasmaComponents3 +import org.kde.plasma.components as PlasmaComponents3 import org.kde.plasma.core as PlasmaCore -import org.kde.kirigami 2.20 as Kirigami -import QtQuick.Layouts 1.1 +import org.kde.kirigami as Kirigami +import QtQuick.Layouts import "code/tools.js" as Tools Item { diff --git a/com.github.adhec.Menu11/contents/ui/ItemGridView.qml b/com.github.adhec.Menu11/contents/ui/ItemGridView.qml index f0b78a8..e0a2ed9 100644 --- a/com.github.adhec.Menu11/contents/ui/ItemGridView.qml +++ b/com.github.adhec.Menu11/contents/ui/ItemGridView.qml @@ -4,13 +4,13 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -import QtQuick 2.15 +import QtQuick -import org.kde.kquickcontrolsaddons 2.0 -import org.kde.ksvg 1.0 as KSvg +import org.kde.kquickcontrolsaddons +import org.kde.ksvg as KSvg import org.kde.plasma.components as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.kirigami 2.20 as Kirigami +import org.kde.plasma.extras as PlasmaExtras +import org.kde.kirigami as Kirigami FocusScope { id: itemGrid @@ -38,8 +38,8 @@ FocusScope { property int iconSize property var horizontalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOff - property var verticalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOn - + property var verticalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOff + property bool bypassArrowNav: false onDropEnabledChanged: { if (!dropEnabled && "dropPlaceHolderIndex" in model) { model.dropPlaceHolderIndex = -1; @@ -255,7 +255,7 @@ FocusScope { boundsBehavior: Flickable.StopAtBounds delegate: itemColumns == 1 ? aItemGridDelegate : aItemGridDelegate2 - highlight: Rectangle { color: colorWithAlpha(Kirigami.Theme.highlightColor,0.5); radius: 6 } + highlight: Rectangle { color: Qt.rgba(0.9, 0.9, 0.9, 0.1); radius: 6 } highlightFollowsCurrentItem: true highlightMoveDuration: 0 @@ -277,6 +277,7 @@ FocusScope { } Keys.onLeftPressed: event => { + console.log("ItemGridView navLeft") if (itemGrid.currentCol() !== 0) { event.accepted = true; moveCurrentIndexLeft(); @@ -286,40 +287,50 @@ FocusScope { } Keys.onRightPressed: event => { - var columns = Math.floor(width / cellWidth); - - if (itemGrid.currentCol() !== columns - 1 && currentIndex !== count -1) { - event.accepted = true; - moveCurrentIndexRight(); - } else { - itemGrid.keyNavRight(); - } - } - - Keys.onUpPressed: event => { - if (itemGrid.currentRow() !== 0) { - event.accepted = true; - moveCurrentIndexUp(); - positionViewAtIndex(currentIndex, GridView.Contain); - } else { - itemGrid.keyNavUp(); - } - } - - Keys.onDownPressed: event => { - if (itemGrid.currentRow() < itemGrid.lastRow()) { - // Fix moveCurrentIndexDown()'s lack of proper spatial nav down - // into partial columns. + var columns = Math.floor(width / cellWidth); + console.log("ItemGridView navRight") + if (itemGrid.currentCol() !== columns - 1 && currentIndex !== count -1) { event.accepted = true; - var columns = Math.floor(width / cellWidth); - var newIndex = currentIndex + columns; - currentIndex = Math.min(newIndex, count - 1); - positionViewAtIndex(currentIndex, GridView.Contain); + moveCurrentIndexRight(); } else { - itemGrid.keyNavDown(); + itemGrid.keyNavRight(); } } + Keys.onUpPressed: event => { + + if (bypassArrowNav) { + console.log("Bypass navup") + keyNavUp() + event.accepted = true + } else if (currentRow() !== 0) { + console.log("navup") + moveCurrentIndexUp() + event.accepted = true + } else { + keyNavUp() + } + } + + + Keys.onDownPressed: event => { + + if (bypassArrowNav) { + console.log("Bypass navdown") + keyNavDown() + event.accepted = true + } else if (currentRow() < lastRow()) { + console.log("navdown") + var columns = Math.floor(width / cellWidth) + var newIndex = currentIndex + columns + currentIndex = Math.min(newIndex, count - 1) + positionViewAtIndex(currentIndex, GridView.Contain) + event.accepted = true + } else { + keyNavDown() + } + } + onItemContainsMouseChanged: containsMouse => { if (!containsMouse) { if (!actionMenu.opened) { @@ -339,6 +350,7 @@ FocusScope { MouseArea { id: hoverArea + cursorShape: gridView.currentIndex !== -1 ? Qt.PointingHandCursor : Qt.ArrowCursor //anchors.fill: parent width: itemGrid.width - Kirigami.Units.gridUnit diff --git a/com.github.adhec.Menu11/contents/ui/ItemMultiGridView.qml b/com.github.adhec.Menu11/contents/ui/ItemMultiGridView.qml index cd77351..11f8f11 100644 --- a/com.github.adhec.Menu11/contents/ui/ItemMultiGridView.qml +++ b/com.github.adhec.Menu11/contents/ui/ItemMultiGridView.qml @@ -1,16 +1,16 @@ /* - SPDX-FileCopyrightText: 2015 Eike Hein +SPDX-FileCopyrightText: 2015 Eike Hein - SPDX-License-Identifier: GPL-2.0-or-later +SPDX-License-Identifier: GPL-2.0-or-later */ import QtQuick -import org.kde.ksvg 1.0 as KSvg +import org.kde.ksvg as KSvg import org.kde.plasma.components as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.kirigami 2.20 as Kirigami -import org.kde.plasma.private.kicker 0.1 as Kicker +import org.kde.plasma.extras as PlasmaExtras +import org.kde.kirigami as Kirigami +import org.kde.plasma.private.kicker as Kicker import org.kde.plasma.plasmoid PlasmaComponents.ScrollView { @@ -24,10 +24,10 @@ PlasmaComponents.ScrollView { implicitHeight: itemColumn.implicitHeight - signal keyNavLeft(int subGridIndex) - signal keyNavRight(int subGridIndex) - signal keyNavUp() - signal keyNavDown() + //signal keyNavLeft(int subGridIndex) + //signal keyNavRight(int subGridIndex) + signal keyNavUp + signal keyNavDown property bool grabFocus: false @@ -53,7 +53,7 @@ PlasmaComponents.ScrollView { for (var i = 0; i < repeater.count; i++) { var grid = subGridAt(i); - if(grid.count > 0 ){ + if (grid.count > 0) { if (rows <= row) { target = grid; rows += grid.lastRow() + 2; // Header counts as one. @@ -95,8 +95,8 @@ PlasmaComponents.ScrollView { delegate: Item { id: itemTest width: itemColumn.width - height: gridView.height + gridViewLabel.height + Kirigami.Units.largeSpacing * 2 - visible: gridView.count > 0 + height: gridView.height + gridViewLabel.height + Kirigami.Units.largeSpacing * 2 + visible: gridView.count > 0 property Item itemGrid: gridView @@ -118,7 +118,7 @@ PlasmaComponents.ScrollView { textFormat: Text.PlainText } - Rectangle{ + Rectangle { anchors.right: parent.right anchors.left: gridViewLabel.right anchors.leftMargin: Kirigami.Units.largeSpacing @@ -138,6 +138,56 @@ PlasmaComponents.ScrollView { ItemGridView { id: gridView + Connections { + target: gridView + + onKeyNavDown: { + console.log("ItemMultiGridView.qml: ↓") + + if (gridView.currentIndex < gridView.count - 1) { + gridView.currentIndex += 1 + return + } + + // At end of grid → jump to next grid + var i = index + for (var j = i + 1; j < repeater.count; j++) { + var next = subGridAt(j) + if (next.count > 0) { + next.currentIndex = 0 + next.focus = true + return + } + } + } + + onKeyNavUp: { + console.log("ItemMultiGridView.qml: ↑") + + if (gridView.currentIndex > 0) { + gridView.currentIndex -= 1 + return + } + + // At start of grid → jump to previous grid + var i = index + for (var j = i - 1; j >= 0; j--) { + var prev = subGridAt(j) + if (prev.count > 0) { + prev.currentIndex = prev.count - 1 + prev.focus = true + return + } + } + + // If first grid and first item → focus search bar + if (i === 0 && gridView.currentIndex === 0) { + searchField.forceActiveFocus() + } + + } + } + anchors { top: gridViewLabel.bottom topMargin: Kirigami.Units.largeSpacing @@ -145,13 +195,14 @@ PlasmaComponents.ScrollView { width: parent.width height: count * itemMultiGrid.cellHeight - itemColumns: 3//itemMultiGrid.itemColumns + itemColumns: 3 //itemMultiGrid.itemColumns + cellWidth: itemMultiGrid.cellWidth cellHeight: itemMultiGrid.cellHeight iconSize: root.iconSize verticalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOff - + bypassArrowNav: true model: repeater.model.modelForRow(index) onFocusChanged: { @@ -192,64 +243,17 @@ PlasmaComponents.ScrollView { } } } - - onKeyNavLeft: { - itemMultiGrid.keyNavLeft(index); - } - - onKeyNavRight: { - itemMultiGrid.keyNavRight(index); - } - - onKeyNavUp: { - if (index > 0) { - var i; - for (i = index; i > 0 ; i--) { - var prevGrid = subGridAt(i-1); - if(prevGrid.count > 0 ){ - prevGrid.tryActivate(prevGrid.lastRow(), currentCol()); - break; - } - } - if(i === 0){ - itemMultiGrid.keyNavUp(); - } - // var prevGrid = subGridAt(index - 1); - // prevGrid.tryActivate(prevGrid.lastRow(), currentCol()); - } else { - itemMultiGrid.keyNavUp(); - } - } - - onKeyNavDown: { - if (index < repeater.count - 1) { - var i; - for (i = index; i < repeater.count - 1 ; i++) { - var grid = subGridAt(i+1); - if(grid.count > 0 ){ - grid.tryActivate(0, currentCol()); - break; - } - } - if(i === repeater.count){ - itemMultiGrid.keyNavDown(); - } - // subGridAt(index + 1).tryActivate(0, currentCol()); - } else { - itemMultiGrid.keyNavDown(); - } - } - } - - // HACK: Steal wheel events from the nested grid view and forward them to - // the ScrollView's internal WheelArea. - Kicker.WheelInterceptor { - anchors.fill: gridView - z: 1 - destination: findWheelArea(itemMultiGrid) } } } + + // HACK: Steal wheel events from the nested grid view and forward them to + // the ScrollView's internal WheelArea. + Kicker.WheelInterceptor { + anchors.fill: gridView + z: 1 + destination: findWheelArea(itemMultiGrid) + } } } } diff --git a/com.github.adhec.Menu11/contents/ui/MenuRepresentation.qml b/com.github.adhec.Menu11/contents/ui/MenuRepresentation.qml index 1b596e7..74b46e6 100644 --- a/com.github.adhec.Menu11/contents/ui/MenuRepresentation.qml +++ b/com.github.adhec.Menu11/contents/ui/MenuRepresentation.qml @@ -18,51 +18,67 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.12 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.private.kicker 0.1 as Kicker -import org.kde.kquickcontrolsaddons 2.0 -import org.kde.plasma.private.quicklaunch 1.0 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import org.kde.plasma.plasmoid +import org.kde.plasma.core as PlasmaCore +import org.kde.plasma.components as PC3 +import org.kde.plasma.extras as PlasmaExtras +import org.kde.plasma.private.kicker as Kicker +import org.kde.kquickcontrolsaddons +import org.kde.plasma.private.quicklaunch import org.kde.kirigami as Kirigami +import org.kde.plasma.plasma5support as Plasma5Support PlasmaCore.Dialog { id: root objectName: "popupWindow" - //flags: Qt.Dialog | Qt.FramelessWindowHint flags: Qt.WindowStaysOnTopHint - location:{ + location: { if (Plasmoid.configuration.displayPosition === 1) - return PlasmaCore.Types.Floating + return PlasmaCore.Types.Floating; else if (Plasmoid.configuration.displayPosition === 2) - return PlasmaCore.Types.BottomEdge + return PlasmaCore.Types.BottomEdge; else - return Plasmoid.location + return Plasmoid.location; } hideOnWindowDeactivate: true - property int iconSize:{ switch(Plasmoid.configuration.appsIconSize){ - case 0: return Kirigami.Units.iconSizes.smallMedium; - case 1: return Kirigami.Units.iconSizes.medium; - case 2: return Kirigami.Units.iconSizes.large; - case 3: return Kirigami.Units.iconSizes.huge; - default: return 64 + // Ensure minimum dimensions to prevent empty dialog error + width: Math.max(rootItem.width, 300) + height: Math.max(rootItem.height, 200) + + property int iconSize: { + switch (Plasmoid.configuration.appsIconSize) { + case 0: + return Kirigami.Units.iconSizes.smallMedium; + case 1: + return Kirigami.Units.iconSizes.medium; + case 2: + return Kirigami.Units.iconSizes.large; + case 3: + return Kirigami.Units.iconSizes.huge; + default: + return 64; } } - property int docsIconSize:{ switch(Plasmoid.configuration.docsIconSize){ - case 0: return Kirigami.Units.iconSizes.smallMedium; - case 1: return Kirigami.Units.iconSizes.medium; - case 2: return Kirigami.Units.iconSizes.large; - case 3: return Kirigami.Units.iconSizes.huge; - default: return Kirigami.Units.iconSizes.medium; + property int docsIconSize: { + switch (Plasmoid.configuration.docsIconSize) { + case 0: + return Kirigami.Units.iconSizes.smallMedium; + case 1: + return Kirigami.Units.iconSizes.medium; + case 2: + return Kirigami.Units.iconSizes.large; + case 3: + return Kirigami.Units.iconSizes.huge; + default: + return Kirigami.Units.iconSizes.medium; } } @@ -75,10 +91,11 @@ PlasmaCore.Dialog { property bool searching: (searchField.text != "") onSearchingChanged: { - if(searching) - view.currentIndex = 2 - else - view.currentIndex = 0 + if (searching) { + view.currentIndex = 2; + } else { + view.currentIndex = 0; + } } onVisibleChanged: { @@ -87,34 +104,38 @@ PlasmaCore.Dialog { x = pos.x; y = pos.y; reset(); - }else{ - view.currentIndex = 0 + } else { + view.currentIndex = 0; } } onHeightChanged: { - var pos = popupPosition(width, height); - x = pos.x; - y = pos.y; + if (visible) { + var pos = popupPosition(width, height); + x = pos.x; + y = pos.y; + } } onWidthChanged: { - var pos = popupPosition(width, height); - x = pos.x; - y = pos.y; + if (visible) { + var pos = popupPosition(width, height); + x = pos.x; + y = pos.y; + } } - function toggle(){ - root.visible = !root.visible + function toggle() { + root.visible = !root.visible; } function reset() { searchField.text = ""; - searchField.focus = true - view.currentIndex = 0 - globalFavoritesGrid.currentIndex = -1 - documentsGrid.currentIndex = -1 - allAppsGrid.currentIndex = -1 + searchField.focus = true; + view.currentIndex = 0; + globalFavoritesGrid.currentIndex = -1; + documentsGrid.currentIndex = -1; + allAppsGrid.currentIndex = -1; } function popupPosition(width, height) { @@ -175,24 +196,48 @@ PlasmaCore.Dialog { } function colorWithAlpha(color: color, alpha: real): color { - return Qt.rgba(color.r, color.g, color.b, alpha) + return Qt.rgba(color.r, color.g, color.b, alpha); } - - mainItem: FocusScope { + mainItem: FocusScope { id: rootItem - property int widthComputed: root.cellSizeWidth * Plasmoid.configuration.numberColumns + Kirigami.Units.gridUnit*2 + property int widthComputed: root.cellSizeWidth * Plasmoid.configuration.numberColumns + Kirigami.Units.gridUnit * 2 - width: rootItem.widthComputed+ Kirigami.Units.gridUnit*2 - Layout.minimumWidth: width - Layout.maximumWidth: width - Layout.minimumHeight: view.height + searchField.height + footer.height + Kirigami.Units.gridUnit * 3 - Layout.maximumHeight: view.height + searchField.height + footer.height + Kirigami.Units.gridUnit * 3 + width: Math.max(widthComputed + Kirigami.Units.gridUnit * 2, 300) + height: view.height + searchField.height + footer.height + Kirigami.Units.gridUnit * 3 + + Layout.minimumWidth: width + Layout.maximumWidth: width + Layout.minimumHeight: height + Layout.maximumHeight: height focus: true onFocusChanged: searchField.focus = true + Plasma5Support.DataSource { + id: executable + engine: "executable" + connectedSources: [] + + property bool dolphinRunning: false + + onNewData: function (source, data) { + if (source.includes("pgrep")) { + dolphinRunning = data["exit code"] === 0; + } + disconnectSource(source); + } + + function exec(cmd) { + connectSource(cmd); + } + + function checkDolphin() { + connectSource("pgrep dolphin"); + } + } + Kirigami.Heading { id: dummyHeading visible: false @@ -207,7 +252,7 @@ PlasmaCore.Dialog { PC3.TextField { id: searchField - anchors{ + anchors { top: parent.top topMargin: Kirigami.Units.gridUnit left: parent.left @@ -225,29 +270,107 @@ PlasmaCore.Dialog { background: Rectangle { color: Kirigami.Theme.backgroundColor - radius: 3 + radius: 20 border.width: 1 - border.color: colorWithAlpha(Kirigami.Theme.textColor,0.05) + border.color: colorWithAlpha(Kirigami.Theme.textColor, 0.05) } onTextChanged: runnerModel.query = text; - Keys.onPressed: (event)=> { - if (event.key === Qt.Key_Escape) { - event.accepted = true; - if(root.searching){ - searchField.clear() - } else { - root.toggle() - } - } + Keys.onPressed: (event) => { + if (event.key === Qt.Key_Escape) { + event.accepted = true; + if (root.searching) { + searchField.clear(); + } else { + root.toggle(); + } + } - if (event.key === Qt.Key_Down || event.key === Qt.Key_Tab || event.key === Qt.Key_Backtab) { - event.accepted = true; - view.currentItem.forceActiveFocus() - view.currentItem.tryActivate(0,0) - } + // Forward Up/Down keys directly to runnerGrid when on search page + if (view.currentIndex === 2 && (event.key === Qt.Key_Up || event.key === Qt.Key_Down)) { + event.accepted = true; + + // Make sure runnerGrid can receive the key event + runnerGrid.focus = true; + + // Forward the key event to runnerGrid + if (event.key === Qt.Key_Down) { + console.log("Down key pressed"); + // Simulate a down key press on the first item if nothing is selected + if (!runnerGrid.focus || runnerGrid.currentIndex === -1) { + runnerGrid.tryActivate(0, 0); + } else { + // Forward the down key to the currently focused grid + var currentGrid = runnerGrid.subGridAt(0); // or find the currently active grid + if (currentGrid) { + currentGrid.forceActiveFocus(); + // Trigger the key navigation + currentGrid.keyNavDown(); } + } + } else if (event.key === Qt.Key_Up) { + // For up key, go to the last item or handle appropriately + console.log("Up key pressed"); + var lastGridIndex = runnerGrid.count - 1; + if (lastGridIndex >= 0) { + var lastGrid = runnerGrid.subGridAt(lastGridIndex); + if (lastGrid && lastGrid.count > 0) { + lastGrid.tryActivate(lastGrid.lastRow(), 0); + lastGrid.focus = true; + } + } + } + return; + } + if (event.key === Qt.Key_Down || event.key === Qt.Key_Tab || event.key === Qt.Key_Backtab) { + event.accepted = true; + if (view.currentIndex === 2) { + // For search results page + runnerGrid.focus = true; + runnerGrid.tryActivate(0, 0); + } else { + // For other pages + view.currentItem.forceActiveFocus(); + view.currentItem.tryActivate(0, 0); + } + } + } + + Keys.onReturnPressed: { + if (view.currentIndex === 2) { + // On search results page, activate the first available item + runnerGrid.focus = true; + + // Find the first grid with items and activate its first item + for (var i = 0; i < runnerGrid.count; i++) { + var grid = runnerGrid.subGridAt(i); + if (grid && grid.count > 0) { + grid.currentIndex = 0; + grid.focus = true; + grid.itemActivated(0, "", null); + + if ("trigger" in grid.model) { + //console.log("Calling grid.model.trigger(0)"); + grid.model.trigger(0, "", null); + root.toggle(); + } + return; + } + } + } else { + // Original logic for other pages + for (var i = 0; i < runnerGrid.count; i++) { + var grid = runnerGrid.subGridAt(i) + if (grid && grid.count > 0) { + grid.currentIndex = 0 + grid.focus = true + grid.itemActivated(0, "", null) + return + } + } + } + } function backspace() { if (!root.visible) { return; @@ -270,68 +393,55 @@ PlasmaCore.Dialog { left: searchField.left verticalCenter: searchField.verticalCenter leftMargin: Kirigami.Units.smallSpacing * 2 - } height: Kirigami.Units.iconSizes.small width: height } - } - Rectangle{ - height: 2 - width: searchField.width - 2 - anchors.bottom: searchField.bottom - anchors.horizontalCenter: parent.horizontalCenter - color: Kirigami.Theme.highlightColor - } - - - // - // - // - // - // - SwipeView { id: view interactive: false currentIndex: 0 clip: true - anchors.top: searchField.bottom - anchors.topMargin: Kirigami.Units.gridUnit - anchors.left: parent.left - anchors.leftMargin: Kirigami.Units.gridUnit - onCurrentIndexChanged: { - globalFavoritesGrid.currentIndex = -1 - documentsGrid.currentIndex = -1 + anchors { + top: searchField.bottom + topMargin: Kirigami.Units.gridUnit + left: parent.left + leftMargin: Kirigami.Units.gridUnit + right: parent.right + rightMargin: Kirigami.Units.gridUnit } - width: rootItem.widthComputed - height: (root.cellSizeHeight * Plasmoid.configuration.numberRows) + (topRow.height*2) + ((docsIconSize + Kirigami.Units.largeSpacing)*3) + (3*Kirigami.Units.largeSpacing) + onCurrentIndexChanged: { + globalFavoritesGrid.currentIndex = -1; + documentsGrid.currentIndex = -1; + } + + width: rootItem.widthComputed / 0.1 + height: (root.cellSizeHeight * Plasmoid.configuration.numberRows) + (topRow.height * 2) + ((docsIconSize + Kirigami.Units.largeSpacing) * 5) + (3 * Kirigami.Units.largeSpacing) // // PAGE 1 // - - Column{ + Column { width: rootItem.widthComputed height: view.height - spacing: Kirigami.Units.largeSpacing + spacing: Kirigami.Units.largeSpacing * 2 function tryActivate(row, col) { globalFavoritesGrid.tryActivate(row, col); } - RowLayout{ + RowLayout { id: topRow - width: rootItem.widthComputed + width: parent.width height: butttonActionAllApps.implicitHeight Kirigami.Icon { - source: 'favorite' + source: 'favorite' implicitHeight: Kirigami.Units.iconSizes.smallMedium implicitWidth: Kirigami.Units.iconSizes.smallMedium } @@ -344,52 +454,55 @@ PlasmaCore.Dialog { font.weight: Font.Bold } - Item{ Layout.fillWidth: true } + Item { + Layout.fillWidth: true + } AToolButton { id: butttonActionAllApps flat: false - iconName: "go-next" + iconName: "go-next" text: i18n("All apps") - onClicked: { - view.currentIndex = 1 + buttonHeight: 25 + onClicked: { + view.currentIndex = 1; } } } ItemGridView { id: globalFavoritesGrid - width: rootItem.widthComputed + width: parent.width height: root.cellSizeHeight * Plasmoid.configuration.numberRows itemColumns: 1 dragEnabled: true dropEnabled: true - cellWidth: root.cellSizeWidth - cellHeight: root.cellSizeHeight - iconSize: root.iconSize + cellWidth: parent.width / Plasmoid.configuration.numberColumns + cellHeight: root.cellSizeHeight + iconSize: root.iconSize onKeyNavUp: { - globalFavoritesGrid.focus = false + globalFavoritesGrid.focus = false; searchField.focus = true; } onKeyNavDown: { - globalFavoritesGrid.focus = false - documentsGrid.tryActivate(0,0) + globalFavoritesGrid.focus = false; + documentsGrid.tryActivate(0, 0); + } + Keys.onPressed: event => { + if (event.key === Qt.Key_Tab) { + event.accepted = true; + searchField.focus = true; + globalFavoritesGrid.focus = false; + } } - Keys.onPressed:(event)=> { - if (event.key === Qt.Key_Tab) { - event.accepted = true; - searchField.focus = true - globalFavoritesGrid.focus = false - } - } } - RowLayout{ - width: rootItem.widthComputed + RowLayout { + width: parent.width height: butttonActionAllApps.implicitHeight Kirigami.Icon { - source: 'tag-recents' + source: 'tag-recents' implicitHeight: Kirigami.Units.iconSizes.smallMedium implicitWidth: Kirigami.Units.iconSizes.smallMedium } @@ -402,17 +515,28 @@ PlasmaCore.Dialog { font.weight: Font.Bold } - Item{ Layout.fillWidth: true } + Item { + Layout.fillWidth: true + } - //AToolButton { - // flat: false - // iconName: "list-add" - // text: i18n("More") - // onClicked: { - // //view.currentIndex = 1 - // - // } - //} + AToolButton { + id: butttonActionRecentMore + flat: false + iconName: "go-next" + text: i18n("Show more") + buttonHeight: 25 + onClicked: { + executable.checkDolphin(); + if (executable.dolphinRunning) { + console.log("dolphin is running"); + executable.exec("dolphin 'recentlyused:/files/'"); + } else { + console.log("dolphin is not running"); + executable.exec("dolphin --new-window 'recentlyused:/files/'"); + } + root.toggle(); + } + } } ItemGridView { @@ -422,37 +546,37 @@ PlasmaCore.Dialog { itemColumns: 2 dragEnabled: true dropEnabled: true - cellWidth: rootItem.widthComputed * 0.48 - cellHeight: docsIconSize + Kirigami.Units.largeSpacing - iconSize: docsIconSize + cellWidth: rootItem.widthComputed * 0.48 + cellHeight: docsIconSize + Kirigami.Units.largeSpacing * 2 + iconSize: docsIconSize clip: true - onKeyNavUp: {globalFavoritesGrid.tryActivate(0,0); - documentsGrid.focus = false + onKeyNavUp: { + globalFavoritesGrid.tryActivate(0, 0); + documentsGrid.focus = false; + } + Keys.onPressed: (event) => { + if (event.key === Qt.Key_Tab) { + event.accepted = true; + searchField.focus = true; + documentsGrid.focus = false; + } } - Keys.onPressed:(event)=> { - if (event.key === Qt.Key_Tab) { - event.accepted = true; - searchField.focus = true - documentsGrid.focus = false - } - } } } // // PAGE 2 // - - Column{ + Column { width: rootItem.widthComputed height: view.height - spacing: Kirigami.Units.largeSpacing + spacing: Kirigami.Units.largeSpacing * 2 function tryActivate(row, col) { allAppsGrid.tryActivate(row, col); } - RowLayout{ - width: rootItem.widthComputed + RowLayout { + width: parent.width height: butttonActionAllApps.implicitHeight Kirigami.Icon { @@ -469,15 +593,18 @@ PlasmaCore.Dialog { font.weight: Font.Bold } - Item{ Layout.fillWidth: true } + Item { + Layout.fillWidth: true + } AToolButton { flat: false - iconName: 'go-previous' + iconName: 'go-previous' text: i18n("Pinned") + buttonHeight: 25 mirror: true - onClicked: { - view.currentIndex = 0 + onClicked: { + view.currentIndex = 0; } } } @@ -485,45 +612,44 @@ PlasmaCore.Dialog { ItemGridView { id: allAppsGrid width: rootItem.widthComputed - height: Math.floor((view.height-topRow.height-Kirigami.Units.largeSpacing)/cellHeight)* cellHeight - itemColumns: 3 + height: Math.floor((view.height - topRow.height - Kirigami.Units.largeSpacing) / cellHeight) * cellHeight + itemColumns: 2 dragEnabled: false dropEnabled: false - cellWidth: rootItem.widthComputed - Kirigami.Units.gridUnit * 2 - cellHeight: root.iconSize + Kirigami.Units.largeSpacing - iconSize: root.iconSize + cellWidth: rootItem.widthComputed - Kirigami.Units.gridUnit * 2 + cellHeight: root.iconSize + Kirigami.Units.largeSpacing + iconSize: root.iconSize clip: true onKeyNavUp: { - searchField.focus = true - allAppsGrid.focus = false + searchField.focus = true; + allAppsGrid.focus = false; } - Keys.onPressed:(event)=> { + Keys.onPressed: (event) => { if (event.key === Qt.Key_Tab) { event.accepted = true; - searchField.focus = true - allAppsGrid.focus = false + searchField.focus = true; + allAppsGrid.focus = false; } } } - } // // PAGE 3 // - ItemMultiGridView { id: runnerGrid width: rootItem.widthComputed height: view.height itemColumns: 3 - cellWidth: rootItem.widthComputed - Kirigami.Units.gridUnit * 2 - cellHeight: root.iconSize + Kirigami.Units.smallSpacing + cellWidth: rootItem.widthComputed - Kirigami.Units.gridUnit * 2 + cellHeight: root.iconSize + Kirigami.Units.smallSpacing * 4 model: runnerModel - grabFocus: false + grabFocus: true // Change this to true + focus: view.currentIndex === 2 // Add this line onKeyNavUp: { - runnerGrid.focus = false - searchField.focus = true + runnerGrid.focus = false; + searchField.focus = true; } } } @@ -535,56 +661,51 @@ PlasmaCore.Dialog { anchors.bottom: parent.bottom position: PC3.ToolBar.Footer - Footer{ + Footer { anchors.fill: parent anchors.leftMargin: Kirigami.Units.gridUnit anchors.rightMargin: Kirigami.Units.gridUnit } } - Keys.onPressed: (event)=> { - if(event.modifiers & Qt.ControlModifier ||event.modifiers & Qt.ShiftModifier){ - searchField.focus = true; - return - } - if (event.key === Qt.Key_Escape) { - event.accepted = true; - if (root.searching) { - reset(); - } else { - root.visible = false; - } - return; - } + Keys.onPressed: (event) => { + if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier) { + searchField.focus = true; + return; + } + if (event.key === Qt.Key_Escape) { + event.accepted = true; + if (root.searching) { + reset(); + } else { + root.visible = false; + } + return; + } - if (searchField.focus) { - return; - } - - if (event.key === Qt.Key_Backspace) { - event.accepted = true; - searchField.backspace(); - } else if (event.text !== "") { - event.accepted = true; - searchField.appendText(event.text); - } - - searchField.focus = true - } + if (searchField.focus) { + return; + } + if (event.key === Qt.Key_Backspace) { + event.accepted = true; + searchField.backspace(); + } else if (event.text !== "") { + event.accepted = true; + searchField.appendText(event.text); + } + } } - function setModels(){ - globalFavoritesGrid.model = globalFavorites + function setModels() { + globalFavoritesGrid.model = globalFavorites; allAppsGrid.model = rootModel.modelForRow(2); - documentsGrid.model = rootModel.modelForRow(1) + documentsGrid.model = rootModel.modelForRow(1); } Component.onCompleted: { - rootModel.refreshed.connect(setModels) + rootModel.refreshed.connect(setModels); reset(); rootModel.refresh(); } } - - diff --git a/com.github.adhec.Menu11/contents/ui/main.qml b/com.github.adhec.Menu11/contents/ui/main.qml index 5ae9407..4fc7c6f 100644 --- a/com.github.adhec.Menu11/contents/ui/main.qml +++ b/com.github.adhec.Menu11/contents/ui/main.qml @@ -17,18 +17,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -import QtQuick 2.0 -import QtQuick.Layouts 1.1 +import QtQuick +import QtQuick.Layouts import org.kde.plasma.plasmoid -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 3.0 as PC3 +import org.kde.plasma.core as PlasmaCore +import org.kde.plasma.components as PC3 -import org.kde.plasma.private.kicker 0.1 as Kicker -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.private.kicker as Kicker import org.kde.kirigami as Kirigami -import org.kde.ksvg 1.0 as KSvg +import org.kde.ksvg as KSvg PlasmoidItem { @@ -59,7 +58,9 @@ PlasmoidItem { Plasmoid.icon: Plasmoid.configuration.useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icon onSystemFavoritesChanged: { - systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions; + if (systemFavorites) { + systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions; + } } Kicker.RootModel { @@ -102,7 +103,6 @@ PlasmoidItem { } } - Connections { target: globalFavorites @@ -115,7 +115,8 @@ PlasmoidItem { target: systemFavorites function onFavoritesChanged() { - Plasmoid.configuration.favoriteSystemActions = target.favorites; + if (Plasmoid.configuration && target) + Plasmoid.configuration.favoriteSystemActions = target.favorites; } } @@ -158,7 +159,6 @@ PlasmoidItem { } } - Kicker.DragHelper { id: dragHelper } @@ -204,7 +204,6 @@ PlasmoidItem { imagePath: "dialogs/background" } - PC3.Label { id: toolTipDelegate @@ -235,10 +234,6 @@ PlasmoidItem { ] Component.onCompleted: { - // plasmoid.setAction("menuedit", i18n("Edit Applications...")); - // //rootModel.refreshed.connect(reset); - // //dragHelper.dropped.connect(resetDragSource); - if (Plasmoid.hasOwnProperty("activationTogglesExpanded")) { Plasmoid.activationTogglesExpanded = !kicker.isDash } @@ -246,10 +241,6 @@ PlasmoidItem { windowSystem.focusIn.connect(enableHideOnWindowDeactivate); kicker.hideOnWindowDeactivate = true; - //updateSvgMetrics(); - //PlasmaCore.Theme.themeChanged.connect(updateSvgMetrics); - //rootModel.refreshed.connect(reset); dragHelper.dropped.connect(resetDragSource); - } } diff --git a/com.github.adhec.Menu11/translate/ReadMe.md b/com.github.adhec.Menu11/translate/ReadMe.md index 4693611..95caef5 100644 --- a/com.github.adhec.Menu11/translate/ReadMe.md +++ b/com.github.adhec.Menu11/translate/ReadMe.md @@ -35,11 +35,11 @@ Or if you know how to make a pull request ## Status | Locale | Lines | % Done| |----------|---------|-------| -| Template | 34 | | -| fr | 20/34 | 58% | -| ko | 17/34 | 50% | -| nl | 13/34 | 38% | -| pl | 15/34 | 44% | -| pt_BR | 20/34 | 58% | -| ru | 34/34 | 100% | -| tr | 15/34 | 44% | +| Template | 35 | | +| fr | 20/35 | 57% | +| ko | 17/35 | 48% | +| nl | 13/35 | 37% | +| pl | 15/35 | 42% | +| pt_BR | 20/35 | 57% | +| ru | 34/35 | 97% | +| tr | 15/35 | 42% | diff --git a/com.github.adhec.Menu11/translate/fr.po b/com.github.adhec.Menu11/translate/fr.po index 443b7d2..f42c3cf 100644 --- a/com.github.adhec.Menu11/translate/fr.po +++ b/com.github.adhec.Menu11/translate/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: omano\n" "Language-Team: LANGUAGE \n" @@ -155,6 +155,10 @@ msgstr "Toutes les applications" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "Ditto Menu" #~ msgstr "Ditto Menu" diff --git a/com.github.adhec.Menu11/translate/ko.po b/com.github.adhec.Menu11/translate/ko.po index d478209..80c7c24 100644 --- a/com.github.adhec.Menu11/translate/ko.po +++ b/com.github.adhec.Menu11/translate/ko.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: 2021-09-29 09:43+0900\n" "Last-Translator: \n" "Language-Team: \n" @@ -152,6 +152,10 @@ msgstr "모든 프로그램" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "Ditto Menu" #~ msgstr "Ditto 메뉴" diff --git a/com.github.adhec.Menu11/translate/nl.po b/com.github.adhec.Menu11/translate/nl.po index 65c5d14..a91a81a 100644 --- a/com.github.adhec.Menu11/translate/nl.po +++ b/com.github.adhec.Menu11/translate/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: 2022-01-01 20:09+0100\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: \n" @@ -156,6 +156,10 @@ msgstr "" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "Ditto Menu" #~ msgstr "Ditto-menu" diff --git a/com.github.adhec.Menu11/translate/pl.po b/com.github.adhec.Menu11/translate/pl.po index 164f618..c5deb56 100644 --- a/com.github.adhec.Menu11/translate/pl.po +++ b/com.github.adhec.Menu11/translate/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: 2022-04-05 10:40+0100\n" "Last-Translator: Krzysztof Korab \n" "Language-Team: \n" @@ -155,6 +155,10 @@ msgstr "" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "A configurable launcher menu" #~ msgstr "Konfigurowalne menu uruchamiania programów" diff --git a/com.github.adhec.Menu11/translate/pt_BR.po b/com.github.adhec.Menu11/translate/pt_BR.po index 90ff7f7..8b46c42 100644 --- a/com.github.adhec.Menu11/translate/pt_BR.po +++ b/com.github.adhec.Menu11/translate/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -155,6 +155,10 @@ msgstr "Todos os programas" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "Ditto Menu" #~ msgstr "Ditto Menu" diff --git a/com.github.adhec.Menu11/translate/ru.po b/com.github.adhec.Menu11/translate/ru.po index 49a529f..6b50865 100644 --- a/com.github.adhec.Menu11/translate/ru.po +++ b/com.github.adhec.Menu11/translate/ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Edward Karate \n" "Language-Team: LANGUAGE \n" @@ -155,6 +155,10 @@ msgstr "Все приложения" msgid "Recent documents" msgstr "Последние документы" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "Показать больше" + #~ msgid "Ditto Menu" #~ msgstr "Ditto Menu" diff --git a/com.github.adhec.Menu11/translate/template.pot b/com.github.adhec.Menu11/translate/template.pot index bbf6476..805a16a 100644 --- a/com.github.adhec.Menu11/translate/template.pot +++ b/com.github.adhec.Menu11/translate/template.pot @@ -1,5 +1,5 @@ # Translation of Menu11 in LANGUAGE -# Copyright (C) 2024 +# Copyright (C) 2025 # This file is distributed under the same license as the Menu11 package. # FIRST AUTHOR , YEAR. # @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Menu11\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -154,3 +154,7 @@ msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "Recent documents" msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" diff --git a/com.github.adhec.Menu11/translate/tr.po b/com.github.adhec.Menu11/translate/tr.po index 74c7bde..14d1419 100644 --- a/com.github.adhec.Menu11/translate/tr.po +++ b/com.github.adhec.Menu11/translate/tr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" "Report-Msgid-Bugs-To: https://github.com/prateekmedia/Menu11\n" -"POT-Creation-Date: 2024-09-24 13:00+0500\n" +"POT-Creation-Date: 2025-07-13 14:15+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -158,6 +158,10 @@ msgstr "" msgid "Recent documents" msgstr "" +#: ../contents/ui/MenuRepresentation.qml +msgid "Show more" +msgstr "" + #~ msgid "Ditto Menu" #~ msgstr "Ditto Menu"