diff --git a/README.md b/README.md index f2311a5..817423d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,4 @@ DittoMenu plasmoid [YooMoney](https://yoomoney.ru/to/4100115921160758) -[Qiwi](https://qiwi.com/n/VALERIAFADEEVA) - Etherium 0x981FBf878fe451BDB83BEaF68078394d4B13213f diff --git a/com.github.adhec.DittoMenu/contents/code/tools.js b/com.github.adhec.DittoMenu/contents/code/tools.js deleted file mode 100644 index ffc44d3..0000000 --- a/com.github.adhec.DittoMenu/contents/code/tools.js +++ /dev/null @@ -1,231 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Aurélien Gâteau * - * Copyright (C) 2013-2015 by Eike Hein * - * * - * 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 . * - ***************************************************************************/ - -.pragma library - -function fillActionMenu(i18n, actionMenu, actionList, favoriteModel, favoriteId) { - // Accessing actionList can be a costly operation, so we don't - // access it until we need the menu. - - var actions = createFavoriteActions(i18n, favoriteModel, favoriteId); - - if (actions) { - if (actionList && actionList.length > 0) { - var separator = { "type": "separator" }; - actionList.unshift(separator); - // actionList = actions.concat(actionList); // this crashes Qt O.o - actionList.unshift.apply(actionList, actions); - } else { - actionList = actions; - } - } - - actionMenu.actionList = actionList; -} - -function createFavoriteActions(i18n, favoriteModel, favoriteId) { - if (favoriteModel === null || !favoriteModel.enabled || favoriteId == null) { - return null; - } - - if ("initForClient" in favoriteModel) { - var activities = favoriteModel.activities.runningActivities; - - if (activities.length <= 1) { - var action = {}; - - if (favoriteModel.isFavorite(favoriteId)) { - action.text = i18n("Remove from Favorites"); - action.icon = "list-remove"; - action.actionId = "_kicker_favorite_remove"; - } else if (favoriteModel.maxFavorites == -1 || favoriteModel.count < favoriteModel.maxFavorites) { - action.text = i18n("Add to Favorites"); - action.icon = "bookmark-new"; - action.actionId = "_kicker_favorite_add"; - } else { - return null; - } - - action.actionArgument = { favoriteModel: favoriteModel, favoriteId: favoriteId }; - - return [action]; - - } else { - var actions = []; - - var linkedActivities = favoriteModel.linkedActivitiesFor(favoriteId); - - // Adding the item to link/unlink to all activities - - var linkedToAllActivities = - !(linkedActivities.indexOf(":global") === -1); - - actions.push({ - text : i18n("On All Activities"), - checkable : true, - - actionId : linkedToAllActivities ? - "_kicker_favorite_remove_from_activity" : - "_kicker_favorite_set_to_activity", - checked : linkedToAllActivities, - - actionArgument : { - favoriteModel: favoriteModel, - favoriteId: favoriteId, - favoriteActivity: "" - } - }); - - - // Adding items for each activity separately - - var addActivityItem = function(activityId, activityName) { - var linkedToThisActivity = - !(linkedActivities.indexOf(activityId) === -1); - - actions.push({ - text : activityName, - checkable : true, - checked : linkedToThisActivity && !linkedToAllActivities, - - actionId : - // If we are on all activities, and the user clicks just one - // specific activity, unlink from everything else - linkedToAllActivities ? "_kicker_favorite_set_to_activity" : - - // If we are linked to the current activity, just unlink from - // that single one - linkedToThisActivity ? "_kicker_favorite_remove_from_activity" : - - // Otherwise, link to this activity, but do not unlink from - // other ones - "_kicker_favorite_add_to_activity", - - actionArgument : { - favoriteModel : favoriteModel, - favoriteId : favoriteId, - favoriteActivity : activityId - } - }); - }; - - // Adding the item to link/unlink to the current activity - - addActivityItem(favoriteModel.activities.currentActivity, i18n("On The Current Activity")); - - actions.push({ - type: "separator", - actionId: "_kicker_favorite_separator" - }); - - // Adding the items for each activity - - activities.forEach(function(activityId) { - addActivityItem(activityId, favoriteModel.activityNameForId(activityId)); - }); - - return [{ - text : i18n("Show In Favorites"), - icon : "favorite", - subActions : actions - }]; - } - } else { - var action = {}; - - if (favoriteModel.isFavorite(favoriteId)) { - action.text = i18n("Remove from Favorites"); - action.icon = "list-remove"; - action.actionId = "_kicker_favorite_remove"; - } else if (favoriteModel.maxFavorites == -1 || favoriteModel.count < favoriteModel.maxFavorites) { - action.text = i18n("Add to Favorites"); - action.icon = "bookmark-new"; - action.actionId = "_kicker_favorite_add"; - } else { - return null; - } - - action.actionArgument = { favoriteModel: favoriteModel, favoriteId: favoriteId }; - - return [action]; - } -} - -function triggerAction(plasmoid, model, index, actionId, actionArgument) { - function startsWith(txt, needle) { - return txt.substr(0, needle.length) === needle; - } - - if (startsWith(actionId, "_kicker_favorite_")) { - handleFavoriteAction(actionId, actionArgument); - return; - } - - var closeRequested = model.trigger(index, actionId, actionArgument); - - if (closeRequested) { - plasmoid.expanded = false; - - return true; - } - - return false; -} - -function handleFavoriteAction(actionId, actionArgument) { - var favoriteId = actionArgument.favoriteId; - var favoriteModel = actionArgument.favoriteModel; - - console.log(actionId); - - if (favoriteModel === null || favoriteId == null) { - return null; - } - - if ("initForClient" in favoriteModel) { - if (actionId == "_kicker_favorite_remove") { - console.log("Removing from all activities"); - favoriteModel.removeFavoriteFrom(favoriteId, ":any"); - - } else if (actionId == "_kicker_favorite_add") { - console.log("Adding to global activity"); - favoriteModel.addFavoriteTo(favoriteId, ":global"); - - } else if (actionId == "_kicker_favorite_remove_from_activity") { - console.log("Removing from a specific activity"); - favoriteModel.removeFavoriteFrom(favoriteId, actionArgument.favoriteActivity); - - } else if (actionId == "_kicker_favorite_add_to_activity") { - console.log("Adding to another activity"); - favoriteModel.addFavoriteTo(favoriteId, actionArgument.favoriteActivity); - - } else if (actionId == "_kicker_favorite_set_to_activity") { - console.log("Removing the item from the favourites, and re-adding it just to be on a specific activity"); - favoriteModel.setFavoriteOn(favoriteId, actionArgument.favoriteActivity); - - } - } else { - if (actionId == "_kicker_favorite_remove") { - favoriteModel.removeFavorite(favoriteId); - } else if (actionId == "_kicker_favorite_add") { - favoriteModel.addFavorite(favoriteId); - } - } -} diff --git a/com.github.adhec.DittoMenu/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index 85301d9..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index 0b578db..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index d6767a5..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/ko/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index e50a1cd..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index 3407f0a..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/nl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index f090af2..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index 6cfe3a3..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/pl/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index 66e473a..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index 20eb703..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index 5eaa0dd..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index 5928c47..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/ru/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo b/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo deleted file mode 100644 index 5f68b1c..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.DittoMenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo deleted file mode 100644 index 0620168..0000000 Binary files a/com.github.adhec.DittoMenu/contents/locale/tr/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo and /dev/null differ diff --git a/com.github.adhec.DittoMenu/contents/ui/ConfigGeneral.qml b/com.github.adhec.DittoMenu/contents/ui/ConfigGeneral.qml deleted file mode 100644 index 3541930..0000000 --- a/com.github.adhec.DittoMenu/contents/ui/ConfigGeneral.qml +++ /dev/null @@ -1,212 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014 by Eike Hein * - * * - * 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.0 -import QtQuick.Controls 1.0 -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 - - -Kirigami.FormLayout { - id: configGeneral - - - property string cfg_icon: plasmoid.configuration.icon - property bool cfg_useCustomButtonImage: plasmoid.configuration.useCustomButtonImage - property string cfg_customButtonImage: plasmoid.configuration.customButtonImage - - //property alias cfg_appNameFormat: appNameFormat.currentIndex - //property alias cfg_switchCategoriesOnHover: switchCategoriesOnHover.checked - - //property alias cfg_useExtraRunners: useExtraRunners.checked - - property alias cfg_numberColumns: numberColumns.value - property alias cfg_numberRows: numberRows.value - property alias cfg_showFavoritesFirst: showFavoritesFirst.checked - - - property alias cfg_labels2lines: labels2lines.checked - property alias cfg_displayPosition: displayPosition.currentIndex - - - RowLayout { - spacing: PlasmaCore.Units.smallSpacing - Kirigami.FormData.label: i18n("Icon:") - - - Button { - id: iconButton - Layout.minimumWidth: previewFrame.width + PlasmaCore.Units.smallSpacing * 2 - Layout.maximumWidth: Layout.minimumWidth - Layout.minimumHeight: previewFrame.height + PlasmaCore.Units.smallSpacing * 2 - Layout.maximumHeight: Layout.minimumWidth - - DragDrop.DropArea { - id: dropArea - - property bool containsAcceptableDrag: false - - anchors.fill: parent - - onDragEnter: { - // Cannot use string operations (e.g. indexOf()) on "url" basic type. - var urlString = event.mimeData.url.toString(); - - // This list is also hardcoded in KIconDialog. - var extensions = [".png", ".xpm", ".svg", ".svgz"]; - containsAcceptableDrag = urlString.indexOf("file:///") === 0 && extensions.some(function (extension) { - return urlString.indexOf(extension) === urlString.length - extension.length; // "endsWith" - }); - - if (!containsAcceptableDrag) { - event.ignore(); - } - } - onDragLeave: containsAcceptableDrag = false - - onDrop: { - if (containsAcceptableDrag) { - // Strip file:// prefix, we already verified in onDragEnter that we have only local URLs. - iconDialog.setCustomButtonImage(event.mimeData.url.toString().substr("file://".length)); - } - containsAcceptableDrag = false; - } - } - - KQuickAddons.IconDialog { - id: iconDialog - - function setCustomButtonImage(image) { - cfg_customButtonImage = image || cfg_icon || "start-here-kde" - cfg_useCustomButtonImage = true; - } - - onIconNameChanged: setCustomButtonImage(iconName); - } - - // just to provide some visual feedback, cannot have checked without checkable enabled - checkable: true - checked: dropArea.containsAcceptableDrag - onClicked: { - checked = Qt.binding(function() { // never actually allow it being checked - return iconMenu.status === PlasmaComponents.DialogStatus.Open || dropArea.containsAcceptableDrag; - }) - - iconMenu.open(0, height) - } - - PlasmaCore.FrameSvgItem { - id: previewFrame - anchors.centerIn: parent - imagePath: plasmoid.location === PlasmaCore.Types.Vertical || plasmoid.location === PlasmaCore.Types.Horizontal - ? "widgets/panel-background" : "widgets/background" - width: PlasmaCore.Units.iconSizes.large + fixedMargins.left + fixedMargins.right - height: PlasmaCore.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom - - PlasmaCore.IconItem { - anchors.centerIn: parent - width: PlasmaCore.Units.iconSizes.large - height: width - source: cfg_useCustomButtonImage ? cfg_customButtonImage : cfg_icon - } - } - } - - // QQC Menu can only be opened at cursor position, not a random one - PlasmaComponents.ContextMenu { - id: iconMenu - visualParent: iconButton - - PlasmaComponents.MenuItem { - text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...") - icon: "document-open-folder" - onClicked: iconDialog.open() - } - PlasmaComponents.MenuItem { - text: i18nc("@item:inmenu Reset icon to default", "Clear Icon") - icon: "edit-clear" - onClicked: { - cfg_useCustomButtonImage = false; - } - } - } - } - - - CheckBox { - id: showFavoritesFirst - Kirigami.FormData.label: i18n("Show favorites first") - } - - ComboBox { - Kirigami.FormData.label: i18n("Menu position") - id: displayPosition - model: [ - i18n("Default"), - i18n("Center"), - i18n("Center bottom"), - ] - onActivated: cfg_displayPosition = currentIndex - } - - - CheckBox { - id: labels2lines - text: i18n("Show labels in two lines") - } - - SpinBox{ - id: numberColumns - minimumValue: 4 - maximumValue: 10 - Kirigami.FormData.label: i18n("Number of columns") - - } - - SpinBox{ - id: numberRows - minimumValue: 1 - maximumValue: 10 - Kirigami.FormData.label: i18n("Number of rows") - } - - RowLayout{ - - //Layout.fillWidth: true - Button { - text: i18n("Unhide all hidden applications") - onClicked: { - plasmoid.configuration.hiddenApplications = [""]; - unhideAllAppsPopup.text = i18n("Unhidden!"); - } - } - Label { - id: unhideAllAppsPopup - } - } - -} diff --git a/com.github.adhec.DittoMenu/contents/ui/ItemGridDelegate.qml b/com.github.adhec.DittoMenu/contents/ui/ItemGridDelegate.qml deleted file mode 100644 index 533f25c..0000000 --- a/com.github.adhec.DittoMenu/contents/ui/ItemGridDelegate.qml +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 by Eike Hein * - * * - * 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.0 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - -import "../code/tools.js" as Tools - -Item { - id: item - - width: GridView.view.cellWidth - height: GridView.view.cellHeight - - property bool showLabel: true - - property int itemIndex: model.index - property string favoriteId: model.favoriteId !== undefined ? model.favoriteId : "" - property url url: model.url !== undefined ? model.url : "" - property variant icon: model.decoration !== undefined ? model.decoration : "" - property var m: model - property bool hasActionList: ((model.favoriteId !== null) - || (("hasActionList" in model) && (model.hasActionList === true))) - - Accessible.role: Accessible.MenuItem - Accessible.name: model.display - - function openActionMenu(x, y) { - var actionList = hasActionList ? model.actionList : []; - Tools.fillActionMenu(i18n, actionMenu, actionList, GridView.view.model.favoritesModel, model.favoriteId); - actionMenu.visualParent = item; - actionMenu.open(x, y); - } - - function actionTriggered(actionId, actionArgument) { - var close = (Tools.triggerAction(plasmoid, GridView.view.model, model.index, actionId, actionArgument) === true); - if (close) root.toggle(); - } - - Item{ - height: iconSize + PlasmaCore.Units.gridUnit * 2 + PlasmaCore.Units.smallSpacing - width: parent.width - anchors.centerIn: parent - - PlasmaCore.IconItem { - id: icon - anchors{ - top: parent.top - horizontalCenter: parent.horizontalCenter - } - width: root.iconSize - height: width - colorGroup: PlasmaCore.Theme.ComplementaryColorGroup - animated: false - usesPlasmaTheme: item.GridView.view.usesPlasmaTheme - source: model.decoration - } - - PlasmaComponents.Label { - id: label - visible: showLabel - anchors { - top: icon.bottom - topMargin: PlasmaCore.Units.smallSpacing - horizontalCenter: parent.horizontalCenter - } - maximumLineCount: plasmoid.configuration.labels2lines ? 2 : 1 - horizontalAlignment: Text.AlignHCenter - width: parent.width - PlasmaCore.Units.largeSpacing - height: PlasmaCore.Units.gridUnit * 2 - elide: Text.ElideRight - wrapMode: Text.Wrap - color: theme.textColor - text: ("name" in model ? model.name : model.display) - } - } - PlasmaCore.ToolTipArea { - id: toolTip - property string text: model.display - anchors.fill: parent - active: root.visible && label.truncated - mainItem: toolTipDelegate - onContainsMouseChanged: item.GridView.view.itemContainsMouseChanged(containsMouse) - } - - Keys.onPressed: { - if (event.key === Qt.Key_Menu && hasActionList) { - event.accepted = true; - openActionMenu(item); - } else if ((event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) { - event.accepted = true; - if ("trigger" in GridView.view.model) { - GridView.view.model.trigger(index, "", null); - root.toggle(); - } - - itemGrid.itemActivated(index, "", null); - } - } -} diff --git a/com.github.adhec.DittoMenu/contents/ui/ItemGridView.qml b/com.github.adhec.DittoMenu/contents/ui/ItemGridView.qml deleted file mode 100644 index aefb9e9..0000000 --- a/com.github.adhec.DittoMenu/contents/ui/ItemGridView.qml +++ /dev/null @@ -1,485 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 by Eike Hein * - * * - * 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.4 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.kquickcontrolsaddons 2.0 -import org.kde.draganddrop 2.0 -import QtQuick.Controls 2.12 - -FocusScope { - id: itemGrid - - signal keyNavLeft - signal keyNavRight - signal keyNavUp - signal keyNavDown - - signal itemActivated(int index, string actionId, string argument) - - property bool dragEnabled: false - property bool dropEnabled: false - property bool showLabels: true - property alias usesPlasmaTheme: gridView.usesPlasmaTheme - - property alias currentIndex: gridView.currentIndex - property alias currentItem: gridView.currentItem - property alias contentItem: gridView.contentItem - property alias count: gridView.count - property alias model: gridView.model - - property alias cellWidth: gridView.cellWidth - property alias cellHeight: gridView.cellHeight - property alias iconSize: gridView.iconSize - property alias scrollBar: scrollArea - - //<>property alias horizontalScrollBarPolicy: scrollArea.horizontalScrollBarPolicy - //<>property alias verticalScrollBarPolicy: scrollArea.verticalScrollBarPolicy - - onDropEnabledChanged: { - if (!dropEnabled && "dropPlaceHolderIndex" in model) { - model.dropPlaceHolderIndex = -1; - } - } - - onFocusChanged: { - if (!focus) { - currentIndex = -1; - } - } - - function currentRow() { - if (currentIndex == -1) { - return -1; - } - - return Math.floor(currentIndex / Math.floor(width / itemGrid.cellWidth)); - } - - function currentCol() { - if (currentIndex == -1) { - return -1; - } - - return currentIndex - (currentRow() * Math.floor(width / itemGrid.cellWidth)); - } - - function lastRow() { - var columns = Math.floor(width / itemGrid.cellWidth); - return Math.ceil(count / columns) - 1; - } - - function tryActivate(row, col) { - if (count) { - var columns = Math.floor(width / itemGrid.cellWidth); - var rows = Math.ceil(count / columns); - row = Math.min(row, rows - 1); - col = Math.min(col, columns - 1); - currentIndex = Math.min(row ? ((Math.max(1, row) * columns) + col) - : col, - count - 1); - - focus = true; - } - } - - function forceLayout() { - gridView.forceLayout(); - } - - ActionMenu { - id: actionMenu - - onActionClicked: { - visualParent.actionTriggered(actionId, actionArgument); - } - } - - DropArea { - id: dropArea - - anchors.fill: parent - - onDragMove: { - if (!itemGrid.dropEnabled || gridView.animating || !kicker.dragSource) { - return; - } - - var x = Math.max(0, event.x - (width % itemGrid.cellWidth)); - var cPos = mapToItem(gridView.contentItem, x, event.y); - var item = gridView.itemAt(cPos.x, cPos.y); - - if (item) { - if (kicker.dragSource.parent === gridView.contentItem) { - if (item !== kicker.dragSource) { - item.GridView.view.model.moveRow(dragSource.itemIndex, item.itemIndex); - } - } else if (kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model - && !itemGrid.model.isFavorite(kicker.dragSource.favoriteId)) { - var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1); - - itemGrid.model.dropPlaceholderIndex = item.itemIndex; - - if (!hasPlaceholder) { - gridView.currentIndex = (item.itemIndex - 1); - } - } - } else if (kicker.dragSource.parent !== gridView.contentItem - && kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model - && !itemGrid.model.isFavorite(kicker.dragSource.favoriteId)) { - var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1); - - itemGrid.model.dropPlaceholderIndex = hasPlaceholder ? itemGrid.model.count - 1 : itemGrid.model.count; - - if (!hasPlaceholder) { - gridView.currentIndex = (itemGrid.model.count - 1); - } - } else { - itemGrid.model.dropPlaceholderIndex = -1; - gridView.currentIndex = -1; - } - } - - onDragLeave: { - if ("dropPlaceholderIndex" in itemGrid.model) { - itemGrid.model.dropPlaceholderIndex = -1; - gridView.currentIndex = -1; - } - } - - onDrop: { - if (kicker.dragSource && kicker.dragSource.parent !== gridView.contentItem && kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model) { - itemGrid.model.addFavorite(kicker.dragSource.favoriteId, itemGrid.model.dropPlaceholderIndex); - gridView.currentIndex = -1; - } - } - - Timer { - id: resetAnimationDurationTimer - - interval: 120 - repeat: false - - onTriggered: { - gridView.animationDuration = interval - 20; - } - } - - //PlasmaExtras.ScrollArea - Flickable{ - id: scrollArea - - clip: true - anchors.fill: parent - boundsBehavior: Flickable.StopAtBounds - interactive: false - focus: true - - GridView { - id: gridView - width: itemGrid.width - height: itemGrid.height - - signal itemContainsMouseChanged(bool containsMouse) - - property bool usesPlasmaTheme: false - - property int iconSize: PlasmaCore.Units.iconSizes.huge - - property bool animating: false - property int animationDuration: itemGrid.dropEnabled ? resetAnimationDurationTimer.interval : 0 - - focus: true - snapMode: GridView.SnapToRow - - ScrollBar.vertical: ScrollBar { - visible: true - active: true - policy: ScrollBar.AlwaysOn; - } - - currentIndex: -1 - - move: Transition { - enabled: itemGrid.dropEnabled - - SequentialAnimation { - PropertyAction { target: gridView; property: "animating"; value: true } - - NumberAnimation { - duration: gridView.animationDuration - properties: "x, y" - easing.type: Easing.OutQuad - } - - PropertyAction { target: gridView; property: "animating"; value: false } - } - } - - moveDisplaced: Transition { - enabled: itemGrid.dropEnabled - - SequentialAnimation { - PropertyAction { target: gridView; property: "animating"; value: true } - - NumberAnimation { - duration: gridView.animationDuration - properties: "x, y" - easing.type: Easing.OutQuad - } - - PropertyAction { target: gridView; property: "animating"; value: false } - } - } - - keyNavigationWraps: false - boundsBehavior: Flickable.StopAtBounds - - delegate: ItemGridDelegate { - showLabel: itemGrid.showLabels - } - - highlight: Item { - property bool isDropPlaceHolder: "dropPlaceholderIndex" in itemGrid.model && itemGrid.currentIndex === itemGrid.model.dropPlaceholderIndex - - PlasmaComponents.Highlight { - visible: gridView.currentItem && !isDropPlaceHolder - - anchors.fill: parent - } - - PlasmaCore.FrameSvgItem { - visible: gridView.currentItem && isDropPlaceHolder - - anchors.fill: parent - - imagePath: "widgets/viewitem" - prefix: "selected" - - opacity: 0.5 - - PlasmaCore.IconItem { - anchors { - right: parent.right - rightMargin: parent.margins.right - bottom: parent.bottom - bottomMargin: parent.margins.bottom - } - - width: PlasmaCore.Units.iconSizes.smallMedium - height: width - - source: "list-add" - active: false - } - } - } - - highlightFollowsCurrentItem: true - highlightMoveDuration: 0 - - onCurrentIndexChanged: { - if (currentIndex != -1) { - hoverArea.hoverEnabled = false - focus = true; - } - } - - onCountChanged: { - animationDuration = 0; - resetAnimationDurationTimer.start(); - } - - onModelChanged: { - currentIndex = -1; - } - - Keys.onLeftPressed: { - if (itemGrid.currentCol() !== 0) { - event.accepted = true; - moveCurrentIndexLeft(); - } else { - itemGrid.keyNavLeft(); - } - } - - Keys.onRightPressed: { - var columns = Math.floor(width / cellWidth); - - if (itemGrid.currentCol() !== columns - 1 && currentIndex != count -1) { - event.accepted = true; - moveCurrentIndexRight(); - } else { - itemGrid.keyNavRight(); - } - } - - Keys.onUpPressed: { - if (itemGrid.currentRow() !== 0) { - event.accepted = true; - moveCurrentIndexUp(); - positionViewAtIndex(currentIndex, GridView.Contain); - } else { - itemGrid.keyNavUp(); - } - } - - Keys.onDownPressed: { - if (itemGrid.currentRow() < itemGrid.lastRow()) { - // Fix moveCurrentIndexDown()'s lack of proper spatial nav down - // into partial columns. - event.accepted = true; - var columns = Math.floor(width / cellWidth); - var newIndex = currentIndex + columns; - currentIndex = Math.min(newIndex, count - 1); - positionViewAtIndex(currentIndex, GridView.Contain); - } else { - itemGrid.keyNavDown(); - } - } - - onItemContainsMouseChanged: { - if (!containsMouse) { - if (!actionMenu.opened) { - gridView.currentIndex = -1; - } - - hoverArea.pressX = -1; - hoverArea.pressY = -1; - hoverArea.lastX = -1; - hoverArea.lastY = -1; - hoverArea.pressedItem = null; - hoverArea.hoverEnabled = true; - } - } - } - } - - MouseArea { - id: hoverArea - - //anchors.fill: parent - width: itemGrid.width - PlasmaCore.Units.largeSpacing - height: itemGrid.height - - - property int pressX: -1 - property int pressY: -1 - property int lastX: -1 - property int lastY: -1 - property Item pressedItem: null - - acceptedButtons: Qt.LeftButton | Qt.RightButton - - hoverEnabled: true - - function updatePositionProperties(x, y) { - // Prevent hover event synthesis in QQuickWindow interfering - // with keyboard navigation by ignoring repeated events with - // identical coordinates. As the work done here would be re- - // dundant in any case, these are safe to ignore. - if (lastX === x && lastY === y) { - return; - } - - lastX = x; - lastY = y; - - var cPos = mapToItem(gridView.contentItem, x, y); - var item = gridView.itemAt(cPos.x, cPos.y); - - if (!item) { - gridView.currentIndex = -1; - pressedItem = null; - } else { - gridView.currentIndex = item.itemIndex; - itemGrid.focus = (itemGrid.currentIndex != -1) - } - - return item; - } - - onPressed: mouse => { - mouse.accepted = true; - - updatePositionProperties(mouse.x, mouse.y); - - pressX = mouse.x; - pressY = mouse.y; - - if (mouse.button == Qt.RightButton) { - if (gridView.currentItem) { - if (gridView.currentItem.hasActionList) { - var mapped = mapToItem(gridView.currentItem, mouse.x, mouse.y); - gridView.currentItem.openActionMenu(mapped.x, mapped.y); - } - } else { - var mapped = mapToItem(rootItem, mouse.x, mouse.y); - contextMenu.open(mapped.x, mapped.y); - } - } else { - pressedItem = gridView.currentItem; - } - } - - onReleased: mouse => { - mouse.accepted = true; - updatePositionProperties(mouse.x, mouse.y); - - if (gridView.currentItem && gridView.currentItem == pressedItem) { - if ("trigger" in gridView.model) { - gridView.model.trigger(pressedItem.itemIndex, "", null); - root.toggle(); - } - - itemGrid.itemActivated(pressedItem.itemIndex, "", null); - } else if (!dragHelper.dragging && !pressedItem && mouse.button == Qt.LeftButton) { - root.toggle(); - } - - pressX = -1; - pressY = -1; - pressedItem = null; - } - - onPositionChanged: mouse => { - var item = pressedItem? pressedItem : updatePositionProperties(mouse.x, mouse.y); - - if (gridView.currentIndex != -1) { - if (itemGrid.dragEnabled && pressX != -1 && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { - if ("pluginName" in item.m) { - dragHelper.startDrag(kicker, item.url, item.icon, - "text/x-plasmoidservicename", item.m.pluginName); - } else { - dragHelper.startDrag(kicker, item.url, item.icon); - } - - kicker.dragSource = item; - - pressX = -1; - pressY = -1; - } - } - } - } - } -} diff --git a/com.github.adhec.DittoMenu/contents/ui/ItemMultiGridView.qml b/com.github.adhec.DittoMenu/contents/ui/ItemMultiGridView.qml deleted file mode 100644 index 7bbeb3c..0000000 --- a/com.github.adhec.DittoMenu/contents/ui/ItemMultiGridView.qml +++ /dev/null @@ -1,210 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 by Eike Hein * - * * - * 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.4 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.extras 2.0 as PlasmaExtras - -import org.kde.plasma.private.kicker 0.1 as Kicker - -PlasmaExtras.ScrollArea { - id: itemMultiGrid - - //anchors { - // top: parent.top - //} - anchors.fill: parent - - //width: parent.width - - implicitHeight: itemColumn.implicitHeight - - signal keyNavLeft(int subGridIndex) - signal keyNavRight(int subGridIndex) - signal keyNavUp() - signal keyNavDown() - - property bool grabFocus: false - - property alias model: repeater.model - property alias count: repeater.count - - property int aCellHeight - property int aCellWidth - - verticalScrollBarPolicy: Qt.ScrollBarAsNeeded - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - - flickableItem.flickableDirection: Flickable.VerticalFlick - - onFocusChanged: { - if (!focus) { - for (var i = 0; i < repeater.count; i++) { - subGridAt(i).focus = false; - } - } - } - - function subGridAt(index) { - return repeater.itemAt(index).itemGrid; - } - - function tryActivate(row, col) { // FIXME TODO: Cleanup messy algo. - if (flickableItem.contentY > 0) { - row = 0; - } - - var target = null; - var rows = 0; - - for (var i = 0; i < repeater.count; i++) { - var grid = subGridAt(i); - - if (rows <= row) { - target = grid; - rows += grid.lastRow() + 2; // Header counts as one. - } else { - break; - } - } - - if (target) { - rows -= (target.lastRow() + 2); - target.tryActivate(row - rows, col); - } - } - - Column { - id: itemColumn - - width: itemMultiGrid.width //- PlasmaCore.Units.gridUnit - - Repeater { - id: repeater - - delegate: Item { - width: itemColumn.width - //height: gridViewLabel.height + gridView.height + (index == repeater.count - 1 ? 0 : PlasmaCore.Units.smallSpacing) - height: gridView.height - //visible: gridView.count > 0 - - property Item itemGrid: gridView - - - - MouseArea { - width: parent.width - height: parent.height - onClicked: root.toggle() - } - - ItemGridView { - id: gridView - - anchors { - top: parent.top - } - - width: parent.width - height: Math.ceil(count / plasmoid.configuration.numberColumns) * root.cellSize - cellWidth: root.cellSize - cellHeight: root.cellSize - iconSize: root.iconSize - //<> verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff - - model: repeater.model.modelForRow(index) - - onFocusChanged: { - if (focus) { - itemMultiGrid.focus = true; - } - } - - onCountChanged: { - if (itemMultiGrid.grabFocus && index == 0 && count > 0) { - currentIndex = 0; - focus = true; - } - } - - onCurrentItemChanged: { - if (!currentItem) { - return; - } - - if (index == 0 && currentRow() === 0) { - itemMultiGrid.flickableItem.contentY = 0; - return; - } - - var y = currentItem.y; - y = contentItem.mapToItem(itemMultiGrid.flickableItem.contentItem, 0, y).y; - - if (y < itemMultiGrid.flickableItem.contentY) { - itemMultiGrid.flickableItem.contentY = y; - } else { - y += root.cellSize; - y -= itemMultiGrid.flickableItem.contentY; - y -= itemMultiGrid.viewport.height; - - if (y > 0) { - itemMultiGrid.flickableItem.contentY += y; - } - } - } - - onKeyNavLeft: { - itemMultiGrid.keyNavLeft(index); - } - - onKeyNavRight: { - itemMultiGrid.keyNavRight(index); - } - - onKeyNavUp: { - if (index > 0) { - var prevGrid = subGridAt(index - 1); - prevGrid.tryActivate(prevGrid.lastRow(), currentCol()); - } else { - itemMultiGrid.keyNavUp(); - } - } - - onKeyNavDown: { - if (index < repeater.count - 1) { - 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.flickableItem) - } - } - } - } -} diff --git a/com.github.adhec.DittoMenu/metadata.json b/com.github.adhec.DittoMenu/metadata.json deleted file mode 100644 index aa0f111..0000000 --- a/com.github.adhec.DittoMenu/metadata.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "KPlugin": { - "Authors": [ - { - "Email": "adhemarks@gmail.com", - "Name": "adhe" - } - ], - "Category": "Application Launchers", - "Description": "A configurable launcher menu", - "Description[x-test]": "xxA configurable launcher menuxx", - "EnabledByDefault": true, - "Icon": "start-here-kde", - "Id": "com.github.adhec.DittoMenu", - "License": "GPL-2.0+", - "Name": "Ditto Menu", - "Name[x-test]": "xxDitto Menuxx", - "ServiceTypes": [ - "Plasma/Applet" - ], - "Version": "0.30", - "Website": "" - }, - "X-Plasma-API": "declarativeappletscript", - "X-Plasma-MainScript": "ui/main.qml", - "X-Plasma-Provides": [ - "org.kde.plasma.launchermenu" - ] -} diff --git a/com.github.adhec.DittoMenu/contents/config/config.qml b/com.github.adhec.MenuDitto/contents/config/config.qml similarity index 100% rename from com.github.adhec.DittoMenu/contents/config/config.qml rename to com.github.adhec.MenuDitto/contents/config/config.qml diff --git a/com.github.adhec.DittoMenu/contents/config/main.xml b/com.github.adhec.MenuDitto/contents/config/main.xml similarity index 89% rename from com.github.adhec.DittoMenu/contents/config/main.xml rename to com.github.adhec.MenuDitto/contents/config/main.xml index ba663f8..a4478e9 100644 --- a/com.github.adhec.DittoMenu/contents/config/main.xml +++ b/com.github.adhec.MenuDitto/contents/config/main.xml @@ -6,14 +6,13 @@ + + + 0 + - - - - - - - 2 + + 0 @@ -38,7 +37,7 @@ - 7 + 6 @@ -49,7 +48,8 @@ org.kde.dolphin.desktop,systemsettings.desktop,org.manjaro.pamac.manager.desktop,ar.com.softwareperonista.Pace.desktop,melawy-welcome.desktop,firefoxdeveloperedition.desktop,firefox.desktop,org.kde.kate.desktop,skypeforlinux.desktop,org.telegram.desktop.desktop,discord.desktop,Zoom.desktop,brave-browser.desktop,google-chrome.desktop,gimp.desktop,org.inkscape.Inkscape.desktop,com.obsproject.Studio.desktop,code.desktop,org.kde.kleopatra.desktop,org.kde.konsole.desktop,org.kde.kcalc.desktop,blender.desktop,gparted.desktop,org.kde.partitionmanager.desktop,org.kde.kinfocenter.desktop - logout,lock-screen,reboot,shutdown + + logout,lock-screen,reboot,shutdown @@ -77,7 +77,7 @@ true - + true @@ -86,8 +86,9 @@ true - + true + diff --git a/com.github.adhec.MenuDitto/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..57c3b52 Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/fr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.MenuDitto/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..d8dabd6 Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/ko/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.MenuDitto/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..62e2106 Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/nl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.MenuDitto/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..2cc6c5d Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/pl/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.MenuDitto/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..cdcd912 Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/pt_BR/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.MenuDitto/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..4cd4fd0 Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/ru/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.DittoMenu/contents/locale/template/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo b/com.github.adhec.MenuDitto/contents/locale/template/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo similarity index 100% rename from com.github.adhec.DittoMenu/contents/locale/template/LC_MESSAGES/plasma_applet_org.kde.plasma.dittomenu.mo rename to com.github.adhec.MenuDitto/contents/locale/template/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo diff --git a/com.github.adhec.MenuDitto/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo b/com.github.adhec.MenuDitto/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo new file mode 100644 index 0000000..99f474e Binary files /dev/null and b/com.github.adhec.MenuDitto/contents/locale/tr/LC_MESSAGES/plasma_applet_com.github.adhec.MenuDitto.mo differ diff --git a/com.github.adhec.DittoMenu/contents/ui/ActionMenu.qml b/com.github.adhec.MenuDitto/contents/ui/ActionMenu.qml similarity index 51% rename from com.github.adhec.DittoMenu/contents/ui/ActionMenu.qml rename to com.github.adhec.MenuDitto/contents/ui/ActionMenu.qml index 5109aef..be10f70 100644 --- a/com.github.adhec.DittoMenu/contents/ui/ActionMenu.qml +++ b/com.github.adhec.MenuDitto/contents/ui/ActionMenu.qml @@ -1,26 +1,13 @@ -/*************************************************************************** - * Copyright (C) 2013 by Aurélien Gâteau * - * Copyright (C) 2014-2015 by Eike Hein * - * * - * 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 . * - ***************************************************************************/ +/* + SPDX-FileCopyrightText: 2013 Aurélien Gâteau + SPDX-FileCopyrightText: 2014-2015 Eike Hein -import QtQuick 2.0 + SPDX-License-Identifier: GPL-2.0-or-later +*/ -import org.kde.plasma.components 2.0 as PlasmaComponents +import QtQuick 2.15 + +import org.kde.plasma.extras 2.0 as PlasmaExtras Item { id: root @@ -28,7 +15,7 @@ Item { property QtObject menu property Item visualParent property variant actionList - property bool opened: menu ? (menu.status != PlasmaComponents.DialogStatus.Closed) : false + property bool opened: menu ? (menu.status !== PlasmaExtras.Menu.Closed) : false signal actionClicked(string actionId, variant actionArgument) signal closed @@ -91,7 +78,7 @@ Item { Component { id: contextMenuComponent - PlasmaComponents.ContextMenu { + PlasmaExtras.Menu { visualParent: root.visualParent } } @@ -99,7 +86,7 @@ Item { Component { id: contextSubmenuItemComponent - PlasmaComponents.MenuItem { + PlasmaExtras.MenuItem { id: submenuItem property variant actionItem @@ -107,10 +94,7 @@ Item { text: actionItem.text ? actionItem.text : "" icon: actionItem.icon ? actionItem.icon : null - property variant submenu : submenu_ - - PlasmaComponents.ContextMenu { - id: submenu_ + property PlasmaExtras.Menu submenu: PlasmaExtras.Menu { visualParent: submenuItem.action } } @@ -119,19 +103,19 @@ Item { Component { id: contextMenuItemComponent - PlasmaComponents.MenuItem { + PlasmaExtras.MenuItem { property variant actionItem text : actionItem.text ? actionItem.text : "" - enabled : actionItem.type != "title" && ("enabled" in actionItem ? actionItem.enabled : true) - separator : actionItem.type == "separator" - section : actionItem.type == "title" + enabled : actionItem.type !== "title" && ("enabled" in actionItem ? actionItem.enabled : true) + separator : actionItem.type === "separator" + section : actionItem.type === "title" icon : actionItem.icon ? actionItem.icon : null checkable : actionItem.checkable ? actionItem.checkable : false checked : actionItem.checked ? actionItem.checked : false onClicked: { - actionClicked(actionItem.actionId, actionItem.actionArgument); + root.actionClicked(actionItem.actionId, actionItem.actionArgument); } } } diff --git a/com.github.adhec.DittoMenu/contents/ui/CompactRepresentation.qml b/com.github.adhec.MenuDitto/contents/ui/CompactRepresentation.qml similarity index 54% rename from com.github.adhec.DittoMenu/contents/ui/CompactRepresentation.qml rename to com.github.adhec.MenuDitto/contents/ui/CompactRepresentation.qml index eae3665..cc388de 100644 --- a/com.github.adhec.DittoMenu/contents/ui/CompactRepresentation.qml +++ b/com.github.adhec.MenuDitto/contents/ui/CompactRepresentation.qml @@ -20,8 +20,9 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.plasmoid import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.kirigami as Kirigami Item { id: root @@ -32,62 +33,18 @@ Item { || plasmoid.location == PlasmaCore.Types.BottomEdge || plasmoid.location == PlasmaCore.Types.LeftEdge) readonly property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) - readonly property bool useCustomButtonImage: (plasmoid.configuration.useCustomButtonImage - && plasmoid.configuration.customButtonImage.length != 0) + readonly property bool useCustomButtonImage: (Plasmoid.configuration.useCustomButtonImage + && Plasmoid.configuration.customButtonImage.length != 0) property QtObject dashWindow: null Plasmoid.status: dashWindow && dashWindow.visible ? PlasmaCore.Types.RequiresAttentionStatus : PlasmaCore.Types.PassiveStatus - - onWidthChanged: updateSizeHints() - onHeightChanged: updateSizeHints() - - function updateSizeHints() { - if (useCustomButtonImage) { - if (vertical) { - var scaledHeight = Math.floor(parent.width * (buttonIcon.implicitHeight / buttonIcon.implicitWidth)); - root.Layout.minimumHeight = scaledHeight; - root.Layout.maximumHeight = scaledHeight; - root.Layout.minimumWidth = PlasmaCore.Units.iconSizes.small; - root.Layout.maximumWidth = inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1; - } else { - var scaledWidth = Math.floor(parent.height * (buttonIcon.implicitWidth / buttonIcon.implicitHeight)); - root.Layout.minimumWidth = scaledWidth; - root.Layout.maximumWidth = scaledWidth; - root.Layout.minimumHeight = PlasmaCore.Units.iconSizes.small; - root.Layout.maximumHeight = inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1; - } - } else { - root.Layout.minimumWidth = PlasmaCore.Units.iconSizes.small; - root.Layout.maximumWidth = inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1; - root.Layout.minimumHeight = PlasmaCore.Units.iconSizes.small - root.Layout.maximumHeight = inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1; - } - } - - Connections { - target: PlasmaCore.Units.iconSizeHints - function onPanelChanged(){ updateSizeHints()} - } - - PlasmaCore.IconItem { + Kirigami.Icon { id: buttonIcon anchors.fill: parent - - readonly property double aspectRatio: (vertical ? implicitHeight / implicitWidth - : implicitWidth / implicitHeight) - - source: useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon - + source: useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icon active: mouseArea.containsMouse - smooth: true - - // A custom icon could also be rectangular. However, if a square, custom, icon is given, assume it - // to be an icon and round it to the nearest icon size again to avoid scaling artefacts. - roundToIconSize: !useCustomButtonImage || aspectRatio === 1 - - onSourceChanged: updateSizeHints() } MouseArea diff --git a/com.github.adhec.MenuDitto/contents/ui/ConfigGeneral.qml b/com.github.adhec.MenuDitto/contents/ui/ConfigGeneral.qml new file mode 100644 index 0000000..f900612 --- /dev/null +++ b/com.github.adhec.MenuDitto/contents/ui/ConfigGeneral.qml @@ -0,0 +1,233 @@ +/*************************************************************************** + * Copyright (C) 2014 by Eike Hein * + * * + * 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.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 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 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.kcmutils as KCM + + + +KCM.SimpleKCM { + id: configGeneral + + property string cfg_icon: plasmoid.configuration.icon + property bool cfg_useCustomButtonImage: plasmoid.configuration.useCustomButtonImage + property string cfg_customButtonImage: plasmoid.configuration.customButtonImage + property alias cfg_numberColumns: numberColumns.value + property alias cfg_numberRows: numberRows.value + property alias cfg_showFavoritesFirst: showFavoritesFirst.checked + + property alias cfg_labels2lines: labels2lines.checked + property alias cfg_displayPosition: displayPosition.currentIndex + + property alias cfg_appsIconSize: appsIconSize.currentIndex + property alias cfg_showInfoUser: showInfoUser.checked + + Kirigami.FormLayout { + anchors.left: parent.left + anchors.right: parent.right + + Button { + id: iconButton + + Kirigami.FormData.label: i18n("Icon:") + + implicitWidth: previewFrame.width + Kirigami.Units.smallSpacing * 2 + implicitHeight: previewFrame.height + Kirigami.Units.smallSpacing * 2 + + // Just to provide some visual feedback when dragging; + // cannot have checked without checkable enabled + checkable: true + checked: dropArea.containsAcceptableDrag + + onPressed: iconMenu.opened ? iconMenu.close() : iconMenu.open() + + DragDrop.DropArea { + id: dropArea + + property bool containsAcceptableDrag: false + + anchors.fill: parent + + onDragEnter: { + // Cannot use string operations (e.g. indexOf()) on "url" basic type. + var urlString = event.mimeData.url.toString(); + + // This list is also hardcoded in KIconDialog. + var extensions = [".png", ".xpm", ".svg", ".svgz"]; + containsAcceptableDrag = urlString.indexOf("file:///") === 0 && extensions.some(function (extension) { + return urlString.indexOf(extension) === urlString.length - extension.length; // "endsWith" + }); + + if (!containsAcceptableDrag) { + event.ignore(); + } + } + onDragLeave: containsAcceptableDrag = false + + onDrop: { + if (containsAcceptableDrag) { + // Strip file:// prefix, we already verified in onDragEnter that we have only local URLs. + iconDialog.setCustomButtonImage(event.mimeData.url.toString().substr("file://".length)); + } + containsAcceptableDrag = false; + } + } + + KIconThemes.IconDialog { + id: iconDialog + + function setCustomButtonImage(image) { + configGeneral.cfg_customButtonImage = image || configGeneral.cfg_icon || "start-here-kde-symbolic" + configGeneral.cfg_useCustomButtonImage = true; + } + + onIconNameChanged: setCustomButtonImage(iconName); + } + + KSvg.FrameSvgItem { + id: previewFrame + anchors.centerIn: parent + imagePath: Plasmoid.location === PlasmaCore.Types.Vertical || Plasmoid.location === PlasmaCore.Types.Horizontal + ? "widgets/panel-background" : "widgets/background" + width: Kirigami.Units.iconSizes.large + fixedMargins.left + fixedMargins.right + height: Kirigami.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom + + Kirigami.Icon { + anchors.centerIn: parent + width: Kirigami.Units.iconSizes.large + height: width + source: configGeneral.cfg_useCustomButtonImage ? configGeneral.cfg_customButtonImage : configGeneral.cfg_icon + } + } + + Menu { + id: iconMenu + + // Appear below the button + y: +parent.height + + onClosed: iconButton.checked = false; + + MenuItem { + text: i18nc("@item:inmenu Open icon chooser dialog", "Choose…") + icon.name: "document-open-folder" + onClicked: iconDialog.open() + } + MenuItem { + text: i18nc("@item:inmenu Reset icon to default", "Clear Icon") + icon.name: "edit-clear" + onClicked: { + configGeneral.cfg_icon = "start-here-kde-symbolic" + configGeneral.cfg_useCustomButtonImage = false + } + } + } + } + + Item { + Kirigami.FormData.isSection: true + } + + ComboBox { + id: appsIconSize + Kirigami.FormData.label: i18n("Icon size:") + Layout.fillWidth: true + model: [i18n("Small"),i18n("Medium"),i18n("Large"), i18n("Huge")] + } + + CheckBox { + id: showFavoritesFirst + Kirigami.FormData.label: i18n("Show favorites first") + } + + ComboBox { + + Kirigami.FormData.label: i18n("Menu position") + id: displayPosition + model: [ + i18n("Default"), + i18n("Center"), + i18n("Center bottom"), + ] + } + + + CheckBox { + id: labels2lines + text: i18n("Show labels in two lines") + visible: false // TODO + } + + SpinBox{ + id: numberColumns + + from: 3 + to: 15 + Kirigami.FormData.label: i18n("Number of columns") + + } + + SpinBox{ + id: numberRows + from: 1 + to: 15 + Kirigami.FormData.label: i18n("Number of rows") + } + + CheckBox { + id: showInfoUser + Kirigami.FormData.label: i18n("Show user") + } + + RowLayout{ + + visible: false + Button { + text: i18n("Unhide all hidden applications") + onClicked: { + plasmoid.configuration.hiddenApplications = [""]; + unhideAllAppsPopup.text = i18n("Unhidden!"); + } + } + Label { + id: unhideAllAppsPopup + } + } + + } +} diff --git a/com.github.adhec.MenuDitto/contents/ui/ItemGridDelegate.qml b/com.github.adhec.MenuDitto/contents/ui/ItemGridDelegate.qml new file mode 100644 index 0000000..320216f --- /dev/null +++ b/com.github.adhec.MenuDitto/contents/ui/ItemGridDelegate.qml @@ -0,0 +1,121 @@ +/* + SPDX-FileCopyrightText: 2015 Eike Hein + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +import QtQuick 2.15 + +import org.kde.plasma.components 3.0 as PlasmaComponents3 +import org.kde.plasma.core as PlasmaCore +import org.kde.kirigami 2.20 as Kirigami + +import "code/tools.js" as Tools + +Item { + id: item + + width: GridView.view.cellWidth + height: GridView.view.cellHeight + + enabled: !model.disabled + + property bool showLabel: true + + property int itemIndex: model.index + property string favoriteId: model.favoriteId !== undefined ? model.favoriteId : "" + property url url: model.url !== undefined ? model.url : "" + property variant icon: model.decoration !== undefined ? model.decoration : "" + property var m: model + property bool hasActionList: ((model.favoriteId !== null) + || (("hasActionList" in model) && (model.hasActionList === true))) + + Accessible.role: Accessible.MenuItem + Accessible.name: model.display + + function openActionMenu(x, y) { + var actionList = hasActionList ? model.actionList : []; + Tools.fillActionMenu(i18n, actionMenu, actionList, GridView.view.model.favoritesModel, model.favoriteId); + actionMenu.visualParent = item; + actionMenu.open(x, y); + } + + function actionTriggered(actionId, actionArgument) { + var close = (Tools.triggerAction(GridView.view.model, model.index, actionId, actionArgument) === true); + + if (close) { + root.toggle(); + } + } + + Kirigami.Icon { + id: icon + + y: item.showLabel ? (2 * highlightItemSvg.margins.top) : undefined + + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: item.showLabel ? undefined : parent.verticalCenter + + width: iconSize + height: width + + animated: false + + source: model.decoration + } + + PlasmaComponents3.Label { + id: label + + visible: item.showLabel + + anchors { + top: icon.bottom + topMargin: Kirigami.Units.smallSpacing + left: parent.left + leftMargin: highlightItemSvg.margins.left + right: parent.right + rightMargin: highlightItemSvg.margins.right + } + + horizontalAlignment: Text.AlignHCenter + + maximumLineCount: 2 + elide: Text.ElideMiddle + wrapMode: Text.Wrap + + color: Kirigami.Theme.textColor + + font.pointSize: Kirigami.Theme.defaultFont.pointSize + 0.5 + text: ("name" in model ? model.name : model.display) + textFormat: Text.PlainText + } + + PlasmaCore.ToolTipArea { + id: toolTip + + property string text: model.display + + anchors.fill: parent + active: root.visible && label.truncated + mainItem: toolTipDelegate + + onContainsMouseChanged: item.GridView.view.itemContainsMouseChanged(containsMouse) + } + + Keys.onPressed: event => { + if (event.key === Qt.Key_Menu && hasActionList) { + event.accepted = true; + openActionMenu(item); + } else if ((event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) { + event.accepted = true; + + if ("trigger" in GridView.view.model) { + GridView.view.model.trigger(index, "", null); + root.toggle(); + } + + itemGrid.itemActivated(index, "", null); + } + } +} diff --git a/com.github.adhec.MenuDitto/contents/ui/ItemGridView.qml b/com.github.adhec.MenuDitto/contents/ui/ItemGridView.qml new file mode 100644 index 0000000..e842de3 --- /dev/null +++ b/com.github.adhec.MenuDitto/contents/ui/ItemGridView.qml @@ -0,0 +1,469 @@ +/* + SPDX-FileCopyrightText: 2015 Eike Hein + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +import QtQuick 2.15 + +import org.kde.kquickcontrolsaddons 2.0 +import org.kde.ksvg 1.0 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 + +FocusScope { + id: itemGrid + + signal keyNavLeft + signal keyNavRight + signal keyNavUp + signal keyNavDown + + signal itemActivated(int index, string actionId, string argument) + + property bool dragEnabled: true + property bool dropEnabled: false + property bool showLabels: true + + property alias currentIndex: gridView.currentIndex + property alias currentItem: gridView.currentItem + property alias contentItem: gridView.contentItem + property alias count: gridView.count + property alias model: gridView.model + + property alias cellWidth: gridView.cellWidth + property alias cellHeight: gridView.cellHeight + property alias iconSize: gridView.iconSize + + property var horizontalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOff + property var verticalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOn + + onDropEnabledChanged: { + if (!dropEnabled && "dropPlaceHolderIndex" in model) { + model.dropPlaceHolderIndex = -1; + } + } + + onFocusChanged: { + //if (!focus && !root.keyEventProxy.activeFocus) { + if (!focus) { + currentIndex = -1; + } + } + + function currentRow() { + if (currentIndex === -1) { + return -1; + } + + return Math.floor(currentIndex / Math.floor(width / itemGrid.cellWidth)); + } + + function currentCol() { + if (currentIndex === -1) { + return -1; + } + + return currentIndex - (currentRow() * Math.floor(width / itemGrid.cellWidth)); + } + + function lastRow() { + var columns = Math.floor(width / itemGrid.cellWidth); + return Math.ceil(count / columns) - 1; + } + + function tryActivate(row, col) { + if (count) { + var columns = Math.floor(width / itemGrid.cellWidth); + var rows = Math.ceil(count / columns); + row = Math.min(row, rows - 1); + col = Math.min(col, columns - 1); + currentIndex = Math.min(row ? ((Math.max(1, row) * columns) + col) + : col, + count - 1); + + focus = true; + } + } + + function forceLayout() { + gridView.forceLayout(); + } + + ActionMenu { + id: actionMenu + + onActionClicked: { + visualParent.actionTriggered(actionId, actionArgument); + } + } + + DropArea { + id: dropArea + + //Rectangle { + //color: "red" + // anchors.fill: parent + //} + + anchors.fill: parent + + onPositionChanged: event => { + if (!itemGrid.dropEnabled || gridView.animating || !kicker.dragSource) { + return; + } + + var x = Math.max(0, event.x - (width % itemGrid.cellWidth)); + var cPos = mapToItem(gridView.contentItem, x, event.y); + var item = gridView.itemAt(cPos.x, cPos.y); + + if (item) { + if (kicker.dragSource.parent === gridView.contentItem) { + if (item !== kicker.dragSource) { + item.GridView.view.model.moveRow(dragSource.itemIndex, item.itemIndex); + } + } else if (kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model + && !itemGrid.model.isFavorite(kicker.dragSource.favoriteId)) { + var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1); + + itemGrid.model.dropPlaceholderIndex = item.itemIndex; + + if (!hasPlaceholder) { + gridView.currentIndex = (item.itemIndex - 1); + } + } + } else if (kicker.dragSource.parent !== gridView.contentItem + && kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model + && !itemGrid.model.isFavorite(kicker.dragSource.favoriteId)) { + var hasPlaceholder = (itemGrid.model.dropPlaceholderIndex !== -1); + + itemGrid.model.dropPlaceholderIndex = hasPlaceholder ? itemGrid.model.count - 1 : itemGrid.model.count; + + if (!hasPlaceholder) { + gridView.currentIndex = (itemGrid.model.count - 1); + } + } else { + itemGrid.model.dropPlaceholderIndex = -1; + gridView.currentIndex = -1; + } + } + + onExited: { + if ("dropPlaceholderIndex" in itemGrid.model) { + itemGrid.model.dropPlaceholderIndex = -1; + gridView.currentIndex = -1; + } + } + + onDropped: { + if (kicker.dragSource && kicker.dragSource.parent !== gridView.contentItem && kicker.dragSource.GridView.view.model.favoritesModel === itemGrid.model) { + itemGrid.model.addFavorite(kicker.dragSource.favoriteId, itemGrid.model.dropPlaceholderIndex); + gridView.currentIndex = -1; + } + } + + Timer { + id: resetAnimationDurationTimer + + interval: 120 + repeat: false + + onTriggered: { + gridView.animationDuration = interval - 20; + } + } + + PlasmaComponents.ScrollView { + id: scrollArea + + anchors.fill: parent + + + focus: true + + PlasmaComponents.ScrollBar.horizontal.policy: itemGrid.horizontalScrollBarPolicy + PlasmaComponents.ScrollBar.vertical.policy: itemGrid.verticalScrollBarPolicy + + GridView { + id: gridView + + width: itemGrid.width + height: itemGrid.height + + signal itemContainsMouseChanged(bool containsMouse) + + property int iconSize: Kirigami.Units.iconSizes.huge + + property bool animating: false + property int animationDuration: itemGrid.dropEnabled ? resetAnimationDurationTimer.interval : 0 + + focus: true + + currentIndex: -1 + + move: Transition { + enabled: itemGrid.dropEnabled + + SequentialAnimation { + PropertyAction { target: gridView; property: "animating"; value: true } + + NumberAnimation { + duration: gridView.animationDuration + properties: "x, y" + easing.type: Easing.OutQuad + } + + PropertyAction { target: gridView; property: "animating"; value: false } + } + } + + moveDisplaced: Transition { + enabled: itemGrid.dropEnabled + + SequentialAnimation { + PropertyAction { target: gridView; property: "animating"; value: true } + + NumberAnimation { + duration: gridView.animationDuration + properties: "x, y" + easing.type: Easing.OutQuad + } + + PropertyAction { target: gridView; property: "animating"; value: false } + } + } + + keyNavigationWraps: false + boundsBehavior: Flickable.StopAtBounds + + delegate: ItemGridDelegate { + showLabel: itemGrid.showLabels + } + + highlight: Item { + property bool isDropPlaceHolder: "dropPlaceholderIndex" in itemGrid.model && itemGrid.currentIndex === itemGrid.model.dropPlaceholderIndex + + PlasmaExtras.Highlight { + visible: gridView.currentItem && !isDropPlaceHolder + hovered: true + pressed: hoverArea.pressed + + anchors.fill: parent + } + + KSvg.FrameSvgItem { + visible: gridView.currentItem && isDropPlaceHolder + + anchors.fill: parent + + imagePath: "widgets/viewitem" + prefix: "selected" + + opacity: 0.5 + + Kirigami.Icon { + anchors { + right: parent.right + rightMargin: parent.margins.right + bottom: parent.bottom + bottomMargin: parent.margins.bottom + } + + width: Kirigami.Units.iconSizes.smallMedium + height: width + + source: "list-add" + active: false + } + } + } + + highlightFollowsCurrentItem: true + highlightMoveDuration: 0 + + onCurrentIndexChanged: { + if (currentIndex !== -1) { + hoverArea.hoverEnabled = false + focus = true; + } + } + + onCountChanged: { + animationDuration = 0; + resetAnimationDurationTimer.start(); + } + + onModelChanged: { + currentIndex = -1; + } + + Keys.onLeftPressed: event => { + if (itemGrid.currentCol() !== 0) { + event.accepted = true; + moveCurrentIndexLeft(); + } else { + itemGrid.keyNavLeft(); + } + } + + 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. + event.accepted = true; + var columns = Math.floor(width / cellWidth); + var newIndex = currentIndex + columns; + currentIndex = Math.min(newIndex, count - 1); + positionViewAtIndex(currentIndex, GridView.Contain); + } else { + itemGrid.keyNavDown(); + } + } + + onItemContainsMouseChanged: containsMouse => { + if (!containsMouse) { + //if (!actionMenu.opened) { + // gridView.currentIndex = -1; + //} + + hoverArea.pressX = -1; + hoverArea.pressY = -1; + hoverArea.lastX = -1; + hoverArea.lastY = -1; + hoverArea.pressedItem = null; + hoverArea.hoverEnabled = true; + } + } + } + } + + MouseArea { + id: hoverArea + + //anchors.fill: parent + width: itemGrid.width - Kirigami.Units.gridUnit + height: itemGrid.height + + property int pressX: -1 + property int pressY: -1 + property int lastX: -1 + property int lastY: -1 + property Item pressedItem: null + + acceptedButtons: Qt.LeftButton | Qt.RightButton + + hoverEnabled: true + + function updatePositionProperties(x, y) { + // Prevent hover event synthesis in QQuickWindow interfering + // with keyboard navigation by ignoring repeated events with + // identical coordinates. As the work done here would be re- + // dundant in any case, these are safe to ignore. + if (lastX === x && lastY === y) { + return; + } + + lastX = x; + lastY = y; + + var cPos = mapToItem(gridView.contentItem, x, y); + var item = gridView.itemAt(cPos.x, cPos.y); + + if (!item) { + gridView.currentIndex = -1; + pressedItem = null; + } else { + itemGrid.focus = (item.itemIndex !== -1) + gridView.currentIndex = item.itemIndex; + } + + return item; + } + + onPressed: mouse => { + mouse.accepted = true; + + updatePositionProperties(mouse.x, mouse.y); + + pressX = mouse.x; + pressY = mouse.y; + + if (mouse.button === Qt.RightButton) { + if (gridView.currentItem) { + if (gridView.currentItem.hasActionList) { + var mapped = mapToItem(gridView.currentItem, mouse.x, mouse.y); + gridView.currentItem.openActionMenu(mapped.x, mapped.y); + } + } else { + var mapped = mapToItem(rootItem, mouse.x, mouse.y); + contextMenu.open(mapped.x, mapped.y); + } + } else { + pressedItem = gridView.currentItem; + } + } + + onReleased: mouse => { + mouse.accepted = true; + updatePositionProperties(mouse.x, mouse.y); + + if (!dragHelper.dragging) { + if (pressedItem) { + if ("trigger" in gridView.model) { + gridView.model.trigger(pressedItem.itemIndex, "", null); + root.toggle(); + } + + itemGrid.itemActivated(pressedItem.itemIndex, "", null); + } else if (mouse.button === Qt.LeftButton) { + root.toggle(); + } + } + + pressX = pressY = -1; + pressedItem = null; + } + + onPositionChanged: mouse => { + var item = pressedItem? pressedItem : updatePositionProperties(mouse.x, mouse.y); + + if (gridView.currentIndex !== -1) { + if (itemGrid.dragEnabled && pressX !== -1 && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { + if ("pluginName" in item.m) { + dragHelper.startDrag(kicker, item.url, item.icon, + "text/x-plasmoidservicename", item.m.pluginName); + } else { + // dragHelper.startDrag(kicker, item.url, item.icon); + dragHelper.startDrag(kicker,item.url); + } + kicker.dragSource = item; + pressX = -1; + pressY = -1; + } + } + } + } + } +} diff --git a/com.github.adhec.MenuDitto/contents/ui/ItemMultiGridView.qml b/com.github.adhec.MenuDitto/contents/ui/ItemMultiGridView.qml new file mode 100644 index 0000000..dc273d5 --- /dev/null +++ b/com.github.adhec.MenuDitto/contents/ui/ItemMultiGridView.qml @@ -0,0 +1,257 @@ +/* + SPDX-FileCopyrightText: 2015 Eike Hein + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +import QtQuick + +import org.kde.ksvg 1.0 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.plasmoid + +PlasmaComponents.ScrollView { + id: itemMultiGrid + + anchors { + top: parent.top + } + + width: parent.width + + implicitHeight: itemColumn.implicitHeight + + signal keyNavLeft(int subGridIndex) + signal keyNavRight(int subGridIndex) + signal keyNavUp() + signal keyNavDown() + + property bool grabFocus: false + + property alias model: repeater.model + property alias count: repeater.count + property alias flickableItem: flickable + + property int cellWidth + property int cellHeight + + function subGridAt(index) { + return repeater.itemAt(index).itemGrid; + } + + function tryActivate(row, col) { // FIXME TODO: Cleanup messy algo. + if (flickable.contentY > 0) { + row = 0; + } + + var target = null; + var rows = 0; + + for (var i = 0; i < repeater.count; i++) { + var grid = subGridAt(i); + if(grid.count > 0 ){ + if (rows <= row) { + target = grid; + rows += grid.lastRow() + 2; // Header counts as one. + } else { + break; + } + } + } + + if (target) { + rows -= (target.lastRow() + 2); + target.tryActivate(row - rows, col); + } + } + + onFocusChanged: { + if (!focus) { + for (var i = 0; i < repeater.count; i++) { + subGridAt(i).focus = false; + } + } + } + + Flickable { + id: flickable + + flickableDirection: Flickable.VerticalFlick + contentHeight: itemColumn.implicitHeight + //focusPolicy: Qt.NoFocus + + Column { + id: itemColumn + + width: itemMultiGrid.width - Kirigami.Units.gridUnit + + Repeater { + id: repeater + + delegate: Item { + width: itemColumn.width + height: gridView.height + gridViewLabel.height + Kirigami.Units.largeSpacing * 2 + visible: gridView.count > 0 + + property Item itemGrid: gridView + + Kirigami.Heading { + id: gridViewLabel + + anchors.top: parent.top + + x: Kirigami.Units.smallSpacing + width: parent.width - x + height: dummyHeading.height + + elide: Text.ElideRight + wrapMode: Text.NoWrap + opacity: 0.8 + + color: Kirigami.Theme.textColor + + level: 3 + font.bold: true + font.weight: Font.DemiBold + + text: repeater.model.modelForRow(index).description + textFormat: Text.PlainText + } + + Rectangle{ + anchors.right: parent.right + anchors.left: gridViewLabel.right + anchors.leftMargin: Kirigami.Units.largeSpacing + anchors.rightMargin: Kirigami.Units.largeSpacing + anchors.verticalCenter: gridViewLabel.verticalCenter + height: 1 + color: Kirigami.Theme.textColor + opacity: 0.15 + } + + MouseArea { + width: parent.width + height: parent.height + onClicked: root.toggle() + } + + ItemGridView { + id: gridView + + anchors { + top: gridViewLabel.bottom + topMargin: Kirigami.Units.largeSpacing + } + + width: parent.width + height: Math.ceil(count / Plasmoid.configuration.numberColumns) * itemMultiGrid.cellHeight + cellWidth: itemMultiGrid.cellWidth + cellHeight: itemMultiGrid.cellHeight + iconSize: root.iconSize + + verticalScrollBarPolicy: PlasmaComponents.ScrollBar.AlwaysOff + + model: repeater.model.modelForRow(index) + + onFocusChanged: { + if (focus) { + itemMultiGrid.focus = true; + } + } + + onCountChanged: { + if (itemMultiGrid.grabFocus && index == 0 && count > 0) { + currentIndex = 0; + focus = true; + } + } + + onCurrentItemChanged: { + if (!currentItem) { + return; + } + + if (index == 0 && currentRow() === 0) { + flickable.contentY = 0; + return; + } + + var y = currentItem.y; + y = contentItem.mapToItem(flickable.contentItem, 0, y).y; + + if (y < flickable.contentY) { + flickable.contentY = y; + } else { + y += itemMultiGrid.cellHeight; + y -= flickable.contentY; + y -= itemMultiGrid.height; + + if (y > 0) { + flickable.contentY += y; + } + } + } + + 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) + } + } + } + } + } +} diff --git a/com.github.adhec.DittoMenu/contents/ui/MenuRepresentation.qml b/com.github.adhec.MenuDitto/contents/ui/MenuRepresentation.qml similarity index 55% rename from com.github.adhec.DittoMenu/contents/ui/MenuRepresentation.qml rename to com.github.adhec.MenuDitto/contents/ui/MenuRepresentation.qml index 2c5a1bf..5cfa82b 100644 --- a/com.github.adhec.DittoMenu/contents/ui/MenuRepresentation.qml +++ b/com.github.adhec.MenuDitto/contents/ui/MenuRepresentation.qml @@ -20,63 +20,96 @@ 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 2.0 as PlasmaComponents -import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.private.kicker 0.1 as Kicker -import org.kde.kcoreaddons 1.0 as KCoreAddons // kuser +import org.kde.coreaddons 1.0 as KCoreAddons // kuser import org.kde.plasma.private.shell 2.0 import org.kde.kwindowsystem 1.0 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import org.kde.kquickcontrolsaddons 2.0 + +import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.private.quicklaunch 1.0 -import QtQuick.Controls 2.12 + +import org.kde.kirigami as Kirigami +import org.kde.plasma.plasma5support 2.0 as P5Support + +import org.kde.plasma.private.sessions as Sessions + +import org.kde.ksvg 1.0 as KSvg +import org.kde.kcmutils as KCM +import org.kde.plasma.plasmoid 2.0 + Item{ - id: main - property int sizeImage: PlasmaCore.Units.iconSizes.large * 2 + property int sizeImage: Kirigami.Units.iconSizes.large * 2.5 onVisibleChanged: { root.visible = !root.visible } + PlasmaExtras.Menu { + id: contextMenu + + PlasmaExtras.MenuItem { + action: Plasmoid.internalAction("configure") + } + } + + PlasmaCore.Dialog { id: root objectName: "popupWindow" - //flags: Qt.Window - flags: Qt.WindowStaysOnTopHint - location: PlasmaCore.Types.Floating + //flags: Qt.WindowStaysOnTopHint + flags: Qt.Dialog | Qt.FramelessWindowHint + location:{ + if (Plasmoid.configuration.displayPosition === 1) + return PlasmaCore.Types.Floating + else if (Plasmoid.configuration.displayPosition === 2) + return PlasmaCore.Types.BottomEdge + else + return Plasmoid.location + } hideOnWindowDeactivate: true - property int iconSize: PlasmaCore.Units.iconSizes.large - property int cellSize: iconSize - + PlasmaCore.Units.gridUnit * 2 - + (2 * Math.max(highlightItemSvg.margins.top + highlightItemSvg.margins.bottom, - highlightItemSvg.margins.left + highlightItemSvg.margins.right)) + 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 cellSizeHeight: iconSize + + Kirigami.Units.gridUnit * 2 + + (2 * Math.max(highlightItemSvg.margins.top + highlightItemSvg.margins.bottom, + highlightItemSvg.margins.left + highlightItemSvg.margins.right)) + property int cellSizeWidth: cellSizeHeight + Kirigami.Units.gridUnit + property bool searching: (searchField.text != "") property bool showFavorites onVisibleChanged: { - if (visible) { - root.showFavorites = plasmoid.configuration.showFavoritesFirst + root.showFavorites = Plasmoid.configuration.showFavoritesFirst var pos = popupPosition(width, height); x = pos.x; y = pos.y; - requestActivate(); reset(); - animation1.start() - + //animation1.start() }else{ - rootItem.opacity = 0 + //rootItem.opacity = 0 } } @@ -96,6 +129,7 @@ Item{ main.visible = !main.visible } + function reset() { searchField.text = ""; @@ -108,16 +142,15 @@ Item{ } function popupPosition(width, height) { - var screenAvail = plasmoid.availableScreenRect; - var screenGeom = plasmoid.screenGeometry; - + var screenAvail = kicker.availableScreenRect; + var screenGeom = kicker.screenGeometry; var screen = Qt.rect(screenAvail.x + screenGeom.x, screenAvail.y + screenGeom.y, screenAvail.width, screenAvail.height); - var offset = PlasmaCore.Units.smallSpacing + var offset = Kirigami.Units.smallSpacing; // Fall back to bottom-left of screen area when the applet is on the desktop or floating. var x = offset; @@ -127,62 +160,65 @@ Item{ var vertMidPoint; - if (plasmoid.configuration.displayPosition === 1) { + if (Plasmoid.configuration.displayPosition === 1) { horizMidPoint = screen.x + (screen.width / 2); vertMidPoint = screen.y + (screen.height / 2); x = horizMidPoint - width / 2; y = vertMidPoint - height / 2; - } else if (plasmoid.configuration.displayPosition === 2) { + } else if (Plasmoid.configuration.displayPosition === 2) { horizMidPoint = screen.x + (screen.width / 2); vertMidPoint = screen.y + (screen.height / 2); x = horizMidPoint - width / 2; y = screen.y + screen.height - height - offset - panelSvg.margins.top; - } else if (plasmoid.location === PlasmaCore.Types.BottomEdge) { + } else if (Plasmoid.location === PlasmaCore.Types.BottomEdge) { horizMidPoint = screen.x + (screen.width / 2); appletTopLeft = parent.mapToGlobal(0, 0); x = (appletTopLeft.x < horizMidPoint) ? screen.x + offset : (screen.x + screen.width) - width - offset; y = screen.y + screen.height - height - offset - panelSvg.margins.top; - } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { + } else if (Plasmoid.location === PlasmaCore.Types.TopEdge) { horizMidPoint = screen.x + (screen.width / 2); var appletBottomLeft = parent.mapToGlobal(0, parent.height); x = (appletBottomLeft.x < horizMidPoint) ? screen.x + offset : (screen.x + screen.width) - width - offset; - y = parent.height + panelSvg.margins.bottom + offset; - y = screen.y + y + (plasmoid.configuration.viewUser ? main.sizeImage*0.5 : 0); - } else if (plasmoid.location === PlasmaCore.Types.LeftEdge) { + //y = screen.y + parent.height + panelSvg.margins.bottom + offset; + y = screen.y + panelSvg.margins.bottom + offset; + } else if (Plasmoid.location === PlasmaCore.Types.LeftEdge) { vertMidPoint = screen.y + (screen.height / 2); appletTopLeft = parent.mapToGlobal(0, 0); - x = parent.width + panelSvg.margins.right + offset; - y = (appletTopLeft.y < vertMidPoint) ? screen.y + offset : (screen.y + screen.height) - height - offset; - y = screen.y + y + (plasmoid.configuration.viewUser ? main.sizeImage*0.5 : 0); - } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { + x = appletTopLeft.x*2 + parent.width + panelSvg.margins.right + offset; + y = screen.y + (appletTopLeft.y < vertMidPoint) ? screen.y + offset : (screen.y + screen.height) - height - offset; + } else if (Plasmoid.location === PlasmaCore.Types.RightEdge) { vertMidPoint = screen.y + (screen.height / 2); appletTopLeft = parent.mapToGlobal(0, 0); x = appletTopLeft.x - panelSvg.margins.left - offset - width; - y = (appletTopLeft.y < vertMidPoint) ? screen.y + offset : (screen.y + screen.height) - height - offset; - y = screen.y + y + (plasmoid.configuration.viewUser ? main.sizeImage*0.5 : 0); + y = screen.y + (appletTopLeft.y < vertMidPoint) ? screen.y + offset : (screen.y + screen.height) - height - offset; } return Qt.point(x, y); } FocusScope { - id: rootItem - Layout.minimumWidth: (root.cellSize * plasmoid.configuration.numberColumns)+ PlasmaCore.Units.largeSpacing - Layout.maximumWidth: (root.cellSize * plasmoid.configuration.numberColumns)+ PlasmaCore.Units.largeSpacing - Layout.minimumHeight: (root.cellSize * plasmoid.configuration.numberRows) + searchField.implicitHeight + (plasmoid.configuration.viewUser ? main.sizeImage*0.5 : PlasmaCore.Units.largeSpacing * 1.5 ) + PlasmaCore.Units.largeSpacing * 6 - Layout.maximumHeight: (root.cellSize * plasmoid.configuration.numberRows) + searchField.implicitHeight + (plasmoid.configuration.viewUser ? main.sizeImage*0.5 : PlasmaCore.Units.largeSpacing * 1.5 ) + PlasmaCore.Units.largeSpacing * 6 - - + Layout.minimumWidth: (root.cellSizeWidth * Plasmoid.configuration.numberColumns)+ Kirigami.Units.gridUnit*1.5 + Layout.maximumWidth: (root.cellSizeWidth * Plasmoid.configuration.numberColumns)+ Kirigami.Units.gridUnit*1.5 + Layout.minimumHeight: (root.cellSizeHeight * Plasmoid.configuration.numberRows) + searchField.implicitHeight + (Plasmoid.configuration.showInfoUser ? main.sizeImage*0.5 : Kirigami.Units.gridUnit * 1.5 ) + Kirigami.Units.gridUnit * 5 + Layout.maximumHeight: (root.cellSizeHeight * Plasmoid.configuration.numberRows) + searchField.implicitHeight + (Plasmoid.configuration.showInfoUser ? main.sizeImage*0.5 : Kirigami.Units.gridUnit * 1.5 ) + Kirigami.Units.gridUnit * 5 focus: true - opacity: 0 + KCoreAddons.KUser { id: kuser } - Logic { id: logic } + Logic { id: logic } - OpacityAnimator { id: animation1; target: rootItem; from: 0; to: 1; } + OpacityAnimator { id: animation1; target: rootItem; from: 0; to: 1; easing.type: Easing.InOutQuad; } - PlasmaCore.DataSource { + Sessions.SessionManagement { + id: sm + } + + Sessions.SessionsModel { + id: sessionsModel + } + + P5Support.DataSource { id: pmEngine engine: "powermanagement" connectedSources: ["PowerDevil", "Sleep States"] @@ -193,7 +229,7 @@ Item{ } } - PlasmaCore.DataSource { + P5Support.DataSource { id: executable engine: "executable" connectedSources: [] @@ -213,13 +249,13 @@ Item{ signal exited(string cmd, int exitCode, int exitStatus, string stdout, string stderr) } - PlasmaComponents.Highlight { + PlasmaExtras.Highlight { id: delegateHighlight visible: false z: -1 // otherwise it shows ontop of the icon/label and tints them slightly } - PlasmaExtras.Heading { + Kirigami.Heading { id: dummyHeading visible: false width: 0 @@ -231,30 +267,14 @@ Item{ font: dummyHeading.font } - ActionMenu { - id: actionMenu - onActionClicked: visualParent.actionTriggered(actionId, actionArgument) - } - - PlasmaCore.FrameSvgItem { - id : headingSvg - width: parent.width + backgroundSvg.margins.right + backgroundSvg.margins.left - height: root.cellSize * plasmoid.configuration.numberRows + PlasmaCore.Units.largeSpacing * 2 + backgroundSvg.margins.bottom - 1 //<>+ paginationBar.height - y: globalFavoritesGrid.y - PlasmaCore.Units.largeSpacing - x: - backgroundSvg.margins.left - imagePath: "widgets/plasmoidheading" - prefix: "footer" - opacity: 0.7 - } - RowLayout{ id: rowTop anchors { left: parent.left right: parent.right top: parent.top - margins: PlasmaCore.Units.smallSpacing - topMargin: PlasmaCore.Units.largeSpacing / 2 + margins: Kirigami.Units.smallSpacing + topMargin: Kirigami.Units.largeSpacing } PlasmaComponents3.ToolButton { @@ -281,8 +301,9 @@ Item{ PlasmaComponents3.ToolButton { icon.name: "system-lock-screen" - onClicked: pmEngine.performOperation("lockScreen") - enabled: pmEngine.data["Sleep States"]["LockScreen"] + //onClicked: pmEngine.performOperation("lockScreen") + //enabled: pmEngine.data["Sleep States"]["LockScreen"] + onClicked: sm.lock() ToolTip.delay: 200 ToolTip.timeout: 1000 ToolTip.visible: hovered @@ -290,36 +311,46 @@ Item{ } PlasmaComponents3.ToolButton { - icon.name: "system-shutdown" - onClicked: pmEngine.performOperation("requestShutDown") + icon.name: "system-switch-user" + onClicked: sm.switchUser() ToolTip.delay: 200 ToolTip.timeout: 1000 ToolTip.visible: hovered - ToolTip.text: i18n("Leave ...") + 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") } } - PlasmaExtras.Heading { + Kirigami.Heading { anchors { top: rowTop.bottom - topMargin: PlasmaCore.Units.largeSpacing + topMargin: Kirigami.Units.gridUnit horizontalCenter: parent.horizontalCenter } level: 1 - color: theme.textColor + color: Kirigami.Theme.textColor text: i18n("Hi, ")+ kuser.fullName - font.bold: true - visible: plasmoid.configuration.viewUser + font.weight: Font.Bold + visible: Plasmoid.configuration.showInfoUser } RowLayout { id: rowSearchField anchors{ - top: plasmoid.configuration.viewUser ? parent.top : rowTop.bottom - topMargin: plasmoid.configuration.viewUser ? PlasmaCore.Units.largeSpacing*3 + sizeImage/2 : PlasmaCore.Units.largeSpacing/2 + top: Plasmoid.configuration.showInfoUser ? parent.top : rowTop.bottom + topMargin: Plasmoid.configuration.showInfoUser ? Kirigami.Units.gridUnit*3 + sizeImage/2 : Kirigami.Units.gridUnit/2 left: parent.left right: parent.right - margins: PlasmaCore.Units.smallSpacing + margins: Kirigami.Units.smallSpacing } Item{ @@ -329,31 +360,39 @@ Item{ id: searchField Layout.fillWidth: true placeholderText: i18n("Type here to search ...") - leftPadding: PlasmaCore.Units.largeSpacing + PlasmaCore.Units.iconSizes.small + topPadding: 10 + bottomPadding: 10 + leftPadding: Kirigami.Units.gridUnit + Kirigami.Units.iconSizes.small text: "" - //clearButtonShown: true // TODO: kubuntu 20.04 + font.pointSize: Kirigami.Theme.defaultFont.pointSize + 2 + onTextChanged: { runnerModel.query = text; } - Keys.onPressed: { - 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; - if(root.showFavorites) - globalFavoritesGrid.tryActivate(0,0) - else - mainColumn.visibleGrid.tryActivate(0,0) - } - } + if (event.key === Qt.Key_Down || event.key === Qt.Key_Tab || event.key === Qt.Key_Backtab) { + event.accepted = true; + if(root.searching){ + runnerGrid.tryActivate(0,0) + } + else{ + if(root.showFavorites) + globalFavoritesGrid.tryActivate(0,0) + else + mainColumn.visibleGrid.tryActivate(0,0) + } + } + } function backspace() { if (!root.visible) { @@ -370,15 +409,15 @@ Item{ focus = true; text = text + newText; } - PlasmaCore.IconItem { + Kirigami.Icon { source: 'search' anchors { left: searchField.left verticalCenter: searchField.verticalCenter - leftMargin: PlasmaCore.Units.smallSpacing * 2 + leftMargin: Kirigami.Units.smallSpacing * 2 } - height: PlasmaCore.Units.iconSizes.small + height: Kirigami.Units.iconSizes.small width: height } @@ -425,35 +464,30 @@ Item{ ItemGridView { id: globalFavoritesGrid - visible: (plasmoid.configuration.showFavoritesFirst || root.showFavorites ) && !root.searching && root.showFavorites + visible: (Plasmoid.configuration.showFavoritesFirst || root.showFavorites ) && !root.searching && root.showFavorites anchors { top: rowSearchField.bottom - topMargin: PlasmaCore.Units.largeSpacing * 2 - left: parent.left - right: parent.right + topMargin: Kirigami.Units.gridUnit } - - width: root.cellSize * plasmoid.configuration.numberColumns + PlasmaCore.Units.largeSpacing - height: root.cellSize * plasmoid.configuration.numberRows - focus: true - cellWidth: root.cellSize - cellHeight: root.cellSize - iconSize: root.iconSize dragEnabled: true dropEnabled: true - usesPlasmaTheme: true - + width: rootItem.width + height: root.cellSizeHeight * Plasmoid.configuration.numberRows + focus: true + cellWidth: root.cellSizeWidth + cellHeight: root.cellSizeHeight + iconSize: root.iconSize onKeyNavUp: searchField.focus = true - Keys.onPressed: { - if(event.modifiers & Qt.ControlModifier ||event.modifiers & Qt.ShiftModifier){ - searchField.focus = true; - return - } - if (event.key === Qt.Key_Tab) { - event.accepted = true; - searchField.focus = true - } - } + Keys.onPressed:(event)=> { + if(event.modifiers & Qt.ControlModifier ||event.modifiers & Qt.ShiftModifier){ + searchField.focus = true; + return + } + if (event.key === Qt.Key_Tab) { + event.accepted = true; + searchField.focus = true + } + } } // @@ -464,22 +498,21 @@ Item{ Item{ id: mainGrids - visible: (!plasmoid.configuration.showFavoritesFirst && !root.showFavorites ) || root.searching || !root.showFavorites //TODO + visible: (!Plasmoid.configuration.showFavoritesFirst && !root.showFavorites ) || root.searching || !root.showFavorites //TODO anchors { top: rowSearchField.bottom - topMargin: PlasmaCore.Units.largeSpacing * 2 - left: parent.left - right: parent.right - + topMargin: Kirigami.Units.gridUnit } - width: root.cellSize * plasmoid.configuration.numberColumns + PlasmaCore.Units.largeSpacing - height: root.cellSize * plasmoid.configuration.numberRows + + width: rootItem.width + height: root.cellSizeHeight * Plasmoid.configuration.numberRows Item { id: mainColumn - width: root.cellSize * plasmoid.configuration.numberColumns + PlasmaCore.Units.largeSpacing - height: root.cellSize * plasmoid.configuration.numberRows + //width: root.cellSize * Plasmoid.configuration.numberColumns + Kirigami.Units.gridUnit + width: rootItem.width + height: root.cellSizeHeight * Plasmoid.configuration.numberRows property Item visibleGrid: allAppsGrid @@ -492,17 +525,17 @@ Item{ ItemGridView { id: allAppsGrid - width: root.cellSize * plasmoid.configuration.numberColumns + PlasmaCore.Units.largeSpacing - height: root.cellSize * plasmoid.configuration.numberRows - - cellWidth: root.cellSize - cellHeight: root.cellSize + //width: root.cellSize * Plasmoid.configuration.numberColumns + Kirigami.Units.gridUnit + width: rootItem.width + height: root.cellSizeHeight * Plasmoid.configuration.numberRows + cellWidth: root.cellSizeWidth + cellHeight: root.cellSizeHeight iconSize: root.iconSize enabled: (opacity == 1) ? 1 : 0 + z: enabled ? 5 : -1 dropEnabled: false dragEnabled: false opacity: root.searching ? 0 : 1 - onOpacityChanged: { if (opacity == 1) { //allAppsGrid.scrollBar.flickableItem.contentY = 0; @@ -514,12 +547,12 @@ Item{ ItemMultiGridView { id: runnerGrid - width: root.cellSize * plasmoid.configuration.numberColumns + PlasmaCore.Units.largeSpacing - height: root.cellSize * plasmoid.configuration.numberRows - z: (opacity == 1.0) ? 1 : 0 - aCellWidth: parent.width - PlasmaCore.Units.largeSpacing - aCellHeight: root.cellSize + width: rootItem.width + height: root.cellSizeHeight * Plasmoid.configuration.numberRows + cellWidth: root.cellSizeWidth + cellHeight: root.cellSizeHeight enabled: (opacity == 1.0) ? 1 : 0 + z: enabled ? 5 : -1 model: runnerModel grabFocus: true opacity: root.searching ? 1.0 : 0.0 @@ -531,65 +564,65 @@ Item{ onKeyNavUp: searchField.focus = true } - Keys.onPressed: { - if(event.modifiers & Qt.ControlModifier ||event.modifiers & Qt.ShiftModifier){ - searchField.focus = true; - return - } - if (event.key === Qt.Key_Tab) { - event.accepted = true; - searchField.focus = true - } else if (event.key === Qt.Key_Backspace) { - event.accepted = true; - if(root.searching) - searchField.backspace(); - else - searchField.focus = true - } else if (event.key === Qt.Key_Escape) { - event.accepted = true; - if(root.searching){ - searchField.clear() - } else { - root.toggle() + Keys.onPressed: (event)=> { + if(event.modifiers & Qt.ControlModifier ||event.modifiers & Qt.ShiftModifier){ + searchField.focus = true; + return + } + if (event.key === Qt.Key_Tab) { + event.accepted = true; + searchField.focus = true + } else if (event.key === Qt.Key_Backspace) { + event.accepted = true; + if(root.searching) + searchField.backspace(); + else + searchField.focus = true + } else if (event.key === Qt.Key_Escape) { + event.accepted = true; + if(root.searching){ + searchField.clear() + } else { + root.toggle() + } + } else if (event.text !== "") { + event.accepted = true; + searchField.appendText(event.text); + } + } + } + } + + + + + 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); + } } - } else if (event.text !== "") { - event.accepted = true; - searchField.appendText(event.text); - } - } - } - } - - - - - Keys.onPressed: { - 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); - } - } } @@ -633,22 +666,18 @@ Item{ Image { id: iconUser - //anchors.centerIn: parent - source: kuser.faceIconUrl.toString() || "user-identity" + source: kuser.faceIconUrl cache: false - visible: source !== "" && plasmoid.configuration.viewUser + visible: source !== "" && Plasmoid.configuration.showInfoUser sourceSize.width: main.sizeImage sourceSize.height: main.sizeImage - fillMode: Image.PreserveAspectFit - // Crop the avatar to fit in a circle, like the lock and login screens - // but don't on software rendering where this won't render - layer.enabled:true // iconUser.GraphicsInfo.api !== GraphicsInfo.Software + layer.enabled:true layer.effect: OpacityMask { // this Rectangle is a circle due to radius size maskSource: Rectangle { - width: main.sizeImage - height: width + width: iconUser.width + height: iconUser.height radius: height / 2 visible: false } @@ -658,22 +687,21 @@ Item{ State { name: "show" when: dialog.visible - PropertyChanges { target: iconUser; y: 0; opacity: 1; } + PropertyChanges { target: iconUser; opacity: 1; } }, State { name: "hide" when: !dialog.visible - PropertyChanges { target: iconUser; y: sizeImage/2 ; opacity: 0; } + PropertyChanges { target: iconUser; opacity: 0; } } ] transitions: Transition { - PropertyAnimation { properties: "opacity,y"; easing.type: Easing.InOutQuad; } + PropertyAnimation { properties: "opacity"; easing.type: Easing.InOutQuad; } } MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton - onClicked: KCMShell.openSystemSettings("kcm_users") - visible: KCMShell.authorize("user_manager.desktop").length > 0 + onClicked: KCM.KCMLauncher.openSystemSettings("kcm_users") } } } diff --git a/com.github.adhec.MenuDitto/contents/ui/code/tools.js b/com.github.adhec.MenuDitto/contents/ui/code/tools.js new file mode 100644 index 0000000..fa1cbd3 --- /dev/null +++ b/com.github.adhec.MenuDitto/contents/ui/code/tools.js @@ -0,0 +1,181 @@ +/* + SPDX-FileCopyrightText: 2013 Aurélien Gâteau + SPDX-FileCopyrightText: 2013-2015 Eike Hein + SPDX-FileCopyrightText: 2017 Ivan Cukic + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +.pragma library + +function fillActionMenu(i18n, actionMenu, actionList, favoriteModel, favoriteId) { + // Accessing actionList can be a costly operation, so we don't + // access it until we need the menu. + + var actions = createFavoriteActions(i18n, favoriteModel, favoriteId); + + if (actions) { + if (actionList && actionList.length > 0) { + var actionListCopy = Array.from(actionList); + var separator = { "type": "separator" }; + actionListCopy.push(separator); + // actionList = actions.concat(actionList); // this crashes Qt O.o + actionListCopy.push.apply(actionListCopy, actions); + actionList = actionListCopy; + } else { + actionList = actions; + } + } + + actionMenu.actionList = actionList; +} + +function createFavoriteActions(i18n, favoriteModel, favoriteId) { + if (!favoriteModel || !favoriteModel.enabled || !favoriteId) { + return null; + } + + + if (favoriteModel.activities === undefined || + favoriteModel.activities.runningActivities.length <= 1) { + var action = {}; + + if (favoriteModel.isFavorite(favoriteId)) { + action.text = i18n("Remove from Favorites"); + action.icon = "bookmark-remove"; + action.actionId = "_kicker_favorite_remove"; + } else if (favoriteModel.maxFavorites === -1 || favoriteModel.count < favoriteModel.maxFavorites) { + action.text = i18n("Add to Favorites"); + action.icon = "bookmark-new"; + action.actionId = "_kicker_favorite_add"; + } else { + return null; + } + + action.actionArgument = { favoriteModel: favoriteModel, favoriteId: favoriteId }; + + return [action]; + + } else { + var actions = []; + + var linkedActivities = favoriteModel.linkedActivitiesFor(favoriteId); + + var activities = favoriteModel.activities.runningActivities; + + // Adding the item to link/unlink to all activities + + var linkedToAllActivities = + !(linkedActivities.indexOf(":global") === -1); + + actions.push({ + text : i18n("On All Activities"), + checkable : true, + + actionId : linkedToAllActivities ? + "_kicker_favorite_remove_from_activity" : + "_kicker_favorite_set_to_activity", + checked : linkedToAllActivities, + + actionArgument : { + favoriteModel: favoriteModel, + favoriteId: favoriteId, + favoriteActivity: "" + } + }); + + + // Adding items for each activity separately + + var addActivityItem = function(activityId, activityName) { + var linkedToThisActivity = + !(linkedActivities.indexOf(activityId) === -1); + + actions.push({ + text : activityName, + checkable : true, + checked : linkedToThisActivity && !linkedToAllActivities, + + actionId : + // If we are on all activities, and the user clicks just one + // specific activity, unlink from everything else + linkedToAllActivities ? "_kicker_favorite_set_to_activity" : + + // If we are linked to the current activity, just unlink from + // that single one + linkedToThisActivity ? "_kicker_favorite_remove_from_activity" : + + // Otherwise, link to this activity, but do not unlink from + // other ones + "_kicker_favorite_add_to_activity", + + actionArgument : { + favoriteModel : favoriteModel, + favoriteId : favoriteId, + favoriteActivity : activityId + } + }); + }; + + // Adding the item to link/unlink to the current activity + + addActivityItem(favoriteModel.activities.currentActivity, i18n("On the Current Activity")); + + actions.push({ + type: "separator", + actionId: "_kicker_favorite_separator" + }); + + // Adding the items for each activity + + activities.forEach(function(activityId) { + addActivityItem(activityId, favoriteModel.activityNameForId(activityId)); + }); + + return [{ + text : i18n("Show in Favorites"), + icon : "favorite", + subActions : actions + }]; + } +} + +function triggerAction(model, index, actionId, actionArgument) { + function startsWith(txt, needle) { + return txt.substr(0, needle.length) === needle; + } + + if (startsWith(actionId, "_kicker_favorite_")) { + handleFavoriteAction(actionId, actionArgument); + return; + } + + var closeRequested = model.trigger(index, actionId, actionArgument); + + if (closeRequested) { + return true; + } + + return false; +} + +function handleFavoriteAction(actionId, actionArgument) { + var favoriteId = actionArgument.favoriteId; + var favoriteModel = actionArgument.favoriteModel; + + if (favoriteModel === null || favoriteId === null) { + return null; + } + + if (actionId === "_kicker_favorite_remove") { + favoriteModel.removeFavorite(favoriteId); + } else if (actionId === "_kicker_favorite_add") { + favoriteModel.addFavorite(favoriteId); + } else if (actionId === "_kicker_favorite_remove_from_activity") { + favoriteModel.removeFavoriteFrom(favoriteId, actionArgument.favoriteActivity); + } else if (actionId === "_kicker_favorite_add_to_activity") { + favoriteModel.addFavoriteTo(favoriteId, actionArgument.favoriteActivity); + } else if (actionId === "_kicker_favorite_set_to_activity") { + favoriteModel.setFavoriteOn(favoriteId, actionArgument.favoriteActivity); + } +} diff --git a/com.github.adhec.DittoMenu/contents/ui/main.qml b/com.github.adhec.MenuDitto/contents/ui/main.qml similarity index 50% rename from com.github.adhec.DittoMenu/contents/ui/main.qml rename to com.github.adhec.MenuDitto/contents/ui/main.qml index 99fe435..a7f817b 100644 --- a/com.github.adhec.DittoMenu/contents/ui/main.qml +++ b/com.github.adhec.MenuDitto/contents/ui/main.qml @@ -19,32 +19,31 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 + +import org.kde.plasma.plasmoid import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.private.kicker 0.1 as Kicker +import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.kirigami as Kirigami +import org.kde.ksvg 1.0 as KSvg + +PlasmoidItem { -Item { id: kicker anchors.fill: parent signal reset - property bool isDash: false - - Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation - - Plasmoid.compactRepresentation: null - Plasmoid.fullRepresentation: compactRepresentation + preferredRepresentation: compactRepresentation + compactRepresentation: compactRepresentation + fullRepresentation: compactRepresentation property Item dragSource: null - property QtObject globalFavorites: rootModel.favoritesModel - property QtObject systemFavorites: rootModel.systemFavoritesModel - function action_menuedit() { processRunner.runMenuEditor(); } @@ -54,45 +53,60 @@ Item { CompactRepresentation {} } - Component { - id: menuRepresentation - MenuRepresentation {} + property QtObject globalFavorites: rootModel.favoritesModel + property QtObject systemFavorites: rootModel.systemFavoritesModel + + Plasmoid.icon: Plasmoid.configuration.useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icon + + onSystemFavoritesChanged: { + systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions; } - readonly property Kicker.RootModel rootModel: Kicker.RootModel { + Kicker.RootModel { id: rootModel autoPopulate: false - appNameFormat: plasmoid.configuration.appNameFormat + appNameFormat: 0 flat: true sorted: true showSeparators: false - appletInterface: plasmoid + appletInterface: kicker showAllApps: true showRecentApps: false showRecentDocs: false - showRecentContacts: false showPowerSession: false + onShowRecentAppsChanged: { + Plasmoid.configuration.showRecentApps = showRecentApps; + } + + onShowRecentDocsChanged: { + Plasmoid.configuration.showRecentDocs = showRecentDocs; + } + + onRecentOrderingChanged: { + Plasmoid.configuration.recentOrdering = recentOrdering; + } + Component.onCompleted: { + favoritesModel.initForClient("org.kde.plasma.kicker.favorites.instance-" + Plasmoid.id) - favoritesModel.initForClient("org.kde.plasma.kickoff.favorites.instance-" + plasmoid.id) - - if (!plasmoid.configuration.favoritesPortedToKAstats) { + if (!Plasmoid.configuration.favoritesPortedToKAstats) { if (favoritesModel.count < 1) { - favoritesModel.portOldFavorites(plasmoid.configuration.favorites); + favoritesModel.portOldFavorites(Plasmoid.configuration.favoriteApps); } - plasmoid.configuration.favoritesPortedToKAstats = true; + Plasmoid.configuration.favoritesPortedToKAstats = true; } } } + Connections { target: globalFavorites - function onFavoritesChanged () { - plasmoid.configuration.favoriteApps = target.favorites; + function onFavoritesChanged() { + Plasmoid.configuration.favoriteApps = target.favorites; } } @@ -100,19 +114,19 @@ Item { target: systemFavorites function onFavoritesChanged() { - plasmoid.configuration.favoriteSystemActions = target.favorites; + Plasmoid.configuration.favoriteSystemActions = target.favorites; } } Connections { - target: plasmoid.configuration + target: Plasmoid.configuration function onFavoriteAppsChanged () { - globalFavorites.favorites = plasmoid.configuration.favoriteApps; + globalFavorites.favorites = Plasmoid.configuration.favoriteApps; } function onFavoriteSystemActionsChanged () { - systemFavorites.favorites = plasmoid.configuration.favoriteSystemActions; + systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions; } function onHiddenApplicationsChanged(){ @@ -121,13 +135,28 @@ Item { } Kicker.RunnerModel { - id: runnerModel + id: runnerModel + + appletInterface: kicker + + favoritesModel: globalFavorites + + runners: { + const results = ["krunner_services", + "krunner_systemsettings", + "krunner_sessions", + "krunner_powerdevil", + "calculator", + "unitconverter"]; + + if (Plasmoid.configuration.useExtraRunners) { + results.push(...Plasmoid.configuration.extraRunners); + } + + return results; + } + } - appletInterface: plasmoid - favoritesModel: globalFavorites - deleteWhenEmpty: false - mergeResults: true - } Kicker.DragHelper { id: dragHelper @@ -137,7 +166,11 @@ Item { id: processRunner; } - PlasmaCore.FrameSvgItem { + Kicker.WindowSystem { + id: windowSystem + } + + KSvg.FrameSvgItem { id : highlightItemSvg visible: false @@ -146,7 +179,7 @@ Item { prefix: "hover" } - PlasmaCore.FrameSvgItem { + KSvg.FrameSvgItem { id : panelSvg visible: false @@ -154,7 +187,7 @@ Item { imagePath: "widgets/panel-background" } - PlasmaCore.FrameSvgItem { + KSvg.FrameSvgItem { id : scrollbarSvg visible: false @@ -162,7 +195,7 @@ Item { imagePath: "widgets/scrollbar" } - PlasmaCore.FrameSvgItem { + KSvg.FrameSvgItem { id : backgroundSvg visible: false @@ -171,25 +204,51 @@ Item { } - PlasmaComponents.Label { + PC3.Label { id: toolTipDelegate width: contentWidth - height: contentHeight + height: undefined property Item toolTip - text: (toolTip != null) ? toolTip.text : "" + text: toolTip ? toolTip.text : "" + textFormat: Text.PlainText } function resetDragSource() { dragSource = null; } - Component.onCompleted: { - plasmoid.setAction("menuedit", i18n("Edit Applications...")); + function enableHideOnWindowDeactivate() { + kicker.hideOnWindowDeactivate = true; + } + Plasmoid.contextualActions: [ + PlasmaCore.Action { + text: i18n("Edit Applications…") + icon.name: "kmenuedit" + visible: Plasmoid.immutability !== PlasmaCore.Types.SystemImmutable + onTriggered: processRunner.runMenuEditor() + } + ] + + Component.onCompleted: { + // plasmoid.setAction("menuedit", i18n("Edit Applications...")); + // //rootModel.refreshed.connect(reset); + // //dragHelper.dropped.connect(resetDragSource); + + if (Plasmoid.hasOwnProperty("activationTogglesExpanded")) { + Plasmoid.activationTogglesExpanded = !kicker.isDash + } + + windowSystem.focusIn.connect(enableHideOnWindowDeactivate); + kicker.hideOnWindowDeactivate = true; + + //updateSvgMetrics(); + //PlasmaCore.Theme.themeChanged.connect(updateSvgMetrics); //rootModel.refreshed.connect(reset); - //dragHelper.dropped.connect(resetDragSource); + dragHelper.dropped.connect(resetDragSource); + } } diff --git a/com.github.adhec.MenuDitto/metadata.json b/com.github.adhec.MenuDitto/metadata.json new file mode 100644 index 0000000..db85929 --- /dev/null +++ b/com.github.adhec.MenuDitto/metadata.json @@ -0,0 +1,25 @@ +{ + "KPackageStructure": "Plasma/Applet", + "KPlugin": { + "Authors": [ + { + "Email": "adhemarks@gmail.com", + "Name": "Ademir" + } + ], + "Category": "Application Launchers", + "Description": "Configurable grid of application icons", + "Description[x-test]": "xxConfigurable grid of application iconsxx", + "EnabledByDefault": true, + "Icon": "start-here-kde", + "Id": "com.github.adhec.MenuDitto", + "License": "GPL-2.0+", + "Name": "Menu Ditto", + "Name[x-test]": "xxMenu Dittoxx", + "Website": "https://kde.org/plasma-desktop" + }, + "X-Plasma-API-Minimum-Version": "6.0", + "X-Plasma-Provides": [ + "org.kde.plasma.launchermenu" + ] +} diff --git a/com.github.adhec.DittoMenu/translate/ReadMe.md b/com.github.adhec.MenuDitto/translate/ReadMe.md similarity index 74% rename from com.github.adhec.DittoMenu/translate/ReadMe.md rename to com.github.adhec.MenuDitto/translate/ReadMe.md index cd0a557..1eb94e3 100644 --- a/com.github.adhec.DittoMenu/translate/ReadMe.md +++ b/com.github.adhec.MenuDitto/translate/ReadMe.md @@ -4,11 +4,11 @@ With KDE Frameworks v5.37 and above, translations are bundled with the `*.plasmo ## Install Translations -Go to `~/.local/share/plasma/plasmoids/com.github.adhec.DittoMenu/translate/` and run `sh ./build --restartplasma`. +Go to `~/.local/share/plasma/plasmoids/com.github.adhec.MenuDitto/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/adhec/dittoMenuKDE/issues/new), name the file `spanish.txt`, attach the txt file to the issue (drag and drop). +1. Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/prateekmedia/MenuDitto/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 @@ -35,11 +35,11 @@ Or if you know how to make a pull request ## Status | Locale | Lines | % Done| |----------|---------|-------| -| Template | 28 | | -| fr | 27/28 | 96% | -| ko | 25/28 | 89% | -| nl | 18/28 | 64% | -| pl | 21/28 | 75% | -| pt_BR | 28/28 | 100% | -| ru | 28/28 | 100% | -| tr | 21/28 | 75% | +| Template | 35 | | +| fr | 23/35 | 65% | +| ko | 20/35 | 57% | +| nl | 14/35 | 40% | +| pl | 17/35 | 48% | +| pt_BR | 23/35 | 65% | +| ru | 35/35 | 100% | +| tr | 17/35 | 48% | diff --git a/com.github.adhec.DittoMenu/translate/build b/com.github.adhec.MenuDitto/translate/build similarity index 93% rename from com.github.adhec.DittoMenu/translate/build rename to com.github.adhec.MenuDitto/translate/build index 338bb05..2adca25 100755 --- a/com.github.adhec.DittoMenu/translate/build +++ b/com.github.adhec.MenuDitto/translate/build @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Version: 6 # This script will convert the *.po files to *.mo files, rebuilding the package/contents/locale folder. @@ -6,9 +6,9 @@ # Eg: contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` -plasmoidName=com.github.adhec.DittoMenu +plasmoidName=com.github.adhec.MenuDitto widgetName="${plasmoidName##*.}" # Strip namespace -website=https://github.com/adhec/dittoMenuKDE +website=https://github.com/prateekmedia/MenuDitto bugAddress="$website" packageRoot=".." # Root of translatable sources projectName="plasma_applet_${plasmoidName}" # project name diff --git a/com.github.adhec.DittoMenu/translate/fr.po b/com.github.adhec.MenuDitto/translate/fr.po similarity index 70% rename from com.github.adhec.DittoMenu/translate/fr.po rename to com.github.adhec.MenuDitto/translate/fr.po index ccffaa8..d273f4a 100644 --- a/com.github.adhec.DittoMenu/translate/fr.po +++ b/com.github.adhec.MenuDitto/translate/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: omano\n" "Language-Team: LANGUAGE \n" @@ -17,44 +17,64 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Enlever des Favoris" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Ajouter aux Favoris" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "Sur toutes les Activités" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "Sur l'Activité actuelle" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Voir dans les Favoris" - #: ../contents/config/config.qml msgid "General" msgstr "Général" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Enlever des Favoris" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Ajouter aux Favoris" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "Sur toutes les Activités" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Icône:" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Choisir..." +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Supprimer l'icône" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "Voir les Favoris en premier" @@ -87,6 +107,10 @@ msgstr "Nombre de colonnes" msgid "Number of rows" msgstr "Nombre de lignes" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Ne plus cacher les applications" @@ -96,7 +120,7 @@ msgid "Unhidden!" msgstr "Plus cachées!" #: ../contents/ui/main.qml -msgid "Edit Applications..." +msgid "Edit Applications…" msgstr "" #: ../contents/ui/MenuRepresentation.qml @@ -112,8 +136,12 @@ msgid "Lock Screen" msgstr "Verrouiller l'écran" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." -msgstr "Quitter ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "Hi, " @@ -136,3 +164,16 @@ msgstr "Toutes les applications" #~ msgid "A configurable launcher menu" #~ msgstr "Un menu de lancement configurable" + +#~ msgid "On The Current Activity" +#~ msgstr "Sur l'Activité actuelle" + +#~ msgid "Show In Favorites" +#~ msgstr "Voir dans les Favoris" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Choisir..." + +#~ msgid "Leave ..." +#~ msgstr "Quitter ..." diff --git a/com.github.adhec.DittoMenu/translate/ko.po b/com.github.adhec.MenuDitto/translate/ko.po similarity index 67% rename from com.github.adhec.DittoMenu/translate/ko.po rename to com.github.adhec.MenuDitto/translate/ko.po index 5e71c23..248059a 100644 --- a/com.github.adhec.DittoMenu/translate/ko.po +++ b/com.github.adhec.MenuDitto/translate/ko.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: 2021-09-29 09:43+0900\n" "Last-Translator: \n" "Language-Team: \n" @@ -14,44 +14,64 @@ msgstr "" "X-Poedit-Basepath: .\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "즐겨찾기에서 제거" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "즐겨찾기에 추가" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "모든 활동" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "현재 활동만" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "즐겨찾기에 표시" - #: ../contents/config/config.qml msgid "General" msgstr "일반" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "즐겨찾기에서 제거" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "즐겨찾기에 추가" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "모든 활동" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "아이콘:" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "선택..." +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "아이콘 초기화" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "즐겨찾기 먼저 표시" @@ -84,6 +104,10 @@ msgstr "" msgid "Number of rows" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "모든 숨겨진 프로그램 복구" @@ -93,8 +117,8 @@ msgid "Unhidden!" msgstr "복구됨!" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "프로그램 편집..." +msgid "Edit Applications…" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -109,8 +133,12 @@ msgid "Lock Screen" msgstr "잠금" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." -msgstr "떠나기..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "Hi, " @@ -133,3 +161,19 @@ msgstr "모든 프로그램" #~ msgid "A configurable launcher menu" #~ msgstr "프로그램 실행기" + +#~ msgid "On The Current Activity" +#~ msgstr "현재 활동만" + +#~ msgid "Show In Favorites" +#~ msgstr "즐겨찾기에 표시" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "선택..." + +#~ msgid "Edit Applications..." +#~ msgstr "프로그램 편집..." + +#~ msgid "Leave ..." +#~ msgstr "떠나기..." diff --git a/com.github.adhec.DittoMenu/translate/merge b/com.github.adhec.MenuDitto/translate/merge similarity index 98% rename from com.github.adhec.DittoMenu/translate/merge rename to com.github.adhec.MenuDitto/translate/merge index 633d0cb..feeb6ee 100755 --- a/com.github.adhec.DittoMenu/translate/merge +++ b/com.github.adhec.MenuDitto/translate/merge @@ -6,9 +6,9 @@ # https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/extract-messages.sh DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` -plasmoidName=com.github.adhec.DittoMenu +plasmoidName=com.github.adhec.MenuDitto widgetName="${plasmoidName##*.}" # Strip namespace -website=https://github.com/adhec/dittoMenuKDE +website=https://github.com/prateekmedia/MenuDitto bugAddress="$website" packageRoot=".." # Root of translatable sources projectName="plasma_applet_${plasmoidName}" # project name diff --git a/com.github.adhec.DittoMenu/translate/nl.po b/com.github.adhec.MenuDitto/translate/nl.po similarity index 75% rename from com.github.adhec.DittoMenu/translate/nl.po rename to com.github.adhec.MenuDitto/translate/nl.po index 778c2f9..6f8f8ee 100644 --- a/com.github.adhec.DittoMenu/translate/nl.po +++ b/com.github.adhec.MenuDitto/translate/nl.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: 2022-01-01 20:09+0100\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: \n" @@ -18,44 +18,64 @@ msgstr "" "X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Verwijderen uit favorieten" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Toevoegen aan favorieten" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "Op alle activiteiten" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "Op de huidige activiteit" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Toevoegen aan favorieten" - #: ../contents/config/config.qml msgid "General" msgstr "Algemeen" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Verwijderen uit favorieten" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Toevoegen aan favorieten" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "Op alle activiteiten" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Pictogram:" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Kiezen…" +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Pictogram verwijderen" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "Favorieten bovenaan tonen" @@ -88,6 +108,10 @@ msgstr "" msgid "Number of rows" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Alle verborgen programma's zichtbaar maken" @@ -97,8 +121,8 @@ msgid "Unhidden!" msgstr "Alles programma's zijn weer zichtbaar!" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "Programma's bewerken…" +msgid "Edit Applications…" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -113,7 +137,11 @@ msgid "Lock Screen" msgstr "" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" msgstr "" #: ../contents/ui/MenuRepresentation.qml @@ -138,6 +166,19 @@ msgstr "" #~ msgid "A configurable launcher menu" #~ msgstr "Een instelbare programmastarter" +#~ msgid "On The Current Activity" +#~ msgstr "Op de huidige activiteit" + +#~ msgid "Show In Favorites" +#~ msgstr "Toevoegen aan favorieten" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Kiezen…" + +#~ msgid "Edit Applications..." +#~ msgstr "Programma's bewerken…" + #~ msgctxt "@action" #~ msgid "Lock Screen" #~ msgstr "Scherm vergrendelen" diff --git a/com.github.adhec.DittoMenu/translate/pl.po b/com.github.adhec.MenuDitto/translate/pl.po similarity index 74% rename from com.github.adhec.DittoMenu/translate/pl.po rename to com.github.adhec.MenuDitto/translate/pl.po index d945f0c..d631c59 100644 --- a/com.github.adhec.DittoMenu/translate/pl.po +++ b/com.github.adhec.MenuDitto/translate/pl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: 2022-04-05 10:40+0100\n" "Last-Translator: Krzysztof Korab \n" "Language-Team: \n" @@ -17,44 +17,64 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Usuń z ulubionych" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Dodaj do ulubionych" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "Na wszystkich aktywnościach" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "Na bieżącej aktywności" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Pokaż w ulubionych" - #: ../contents/config/config.qml msgid "General" msgstr "Ogólne" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Usuń z ulubionych" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Dodaj do ulubionych" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "Na wszystkich aktywnościach" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Ikona:" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Wybierz..." +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Wyczyść ikonę" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "Najpierw pokaż ulubione" @@ -87,6 +107,10 @@ msgstr "" msgid "Number of rows" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Uwidocznij wszystkie ukryte aplikacje" @@ -96,8 +120,8 @@ msgid "Unhidden!" msgstr "Wszystkie programy są widoczne!" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "Edytuj programy..." +msgid "Edit Applications…" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -112,7 +136,11 @@ msgid "Lock Screen" msgstr "" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" msgstr "" #: ../contents/ui/MenuRepresentation.qml @@ -134,6 +162,19 @@ msgstr "" #~ msgid "A configurable launcher menu" #~ msgstr "Konfigurowalne menu uruchamiania programów" +#~ msgid "On The Current Activity" +#~ msgstr "Na bieżącej aktywności" + +#~ msgid "Show In Favorites" +#~ msgstr "Pokaż w ulubionych" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Wybierz..." + +#~ msgid "Edit Applications..." +#~ msgstr "Edytuj programy..." + #~ msgctxt "@action" #~ msgid "Lock Screen" #~ msgstr "Zablokuj ekran" diff --git a/com.github.adhec.DittoMenu/translate/plasmoidlocaletest b/com.github.adhec.MenuDitto/translate/plasmoidlocaletest similarity index 100% rename from com.github.adhec.DittoMenu/translate/plasmoidlocaletest rename to com.github.adhec.MenuDitto/translate/plasmoidlocaletest diff --git a/com.github.adhec.DittoMenu/translate/pt_BR.po b/com.github.adhec.MenuDitto/translate/pt_BR.po similarity index 69% rename from com.github.adhec.DittoMenu/translate/pt_BR.po rename to com.github.adhec.MenuDitto/translate/pt_BR.po index 332c871..99b1a81 100644 --- a/com.github.adhec.DittoMenu/translate/pt_BR.po +++ b/com.github.adhec.MenuDitto/translate/pt_BR.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,44 +17,64 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Remover dos favoritos" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Adicionar aos Favoritos" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "Em todas as atividades" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "Na atividade atual" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Exibir nos favoritos" - #: ../contents/config/config.qml msgid "General" msgstr "Geral" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Remover dos favoritos" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Adicionar aos Favoritos" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "Em todas as atividades" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Ícone" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Procurar" +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Resetar Ícone" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "Exbir os Favoritros primeiro" @@ -87,6 +107,10 @@ msgstr "Numero de colunas" msgid "Number of rows" msgstr "Numero de filas" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Mostrar aplicativos ocultos" @@ -96,8 +120,8 @@ msgid "Unhidden!" msgstr "Reexibido" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "Editar Programa" +msgid "Edit Applications…" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -112,8 +136,12 @@ msgid "Lock Screen" msgstr "Tela de bloqueio" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." -msgstr "Sair ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "Hi, " @@ -136,3 +164,19 @@ msgstr "Todos os programas" #~ msgid "A configurable launcher menu" #~ msgstr "Configuração do Menu Iniciar" + +#~ msgid "On The Current Activity" +#~ msgstr "Na atividade atual" + +#~ msgid "Show In Favorites" +#~ msgstr "Exibir nos favoritos" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Procurar" + +#~ msgid "Edit Applications..." +#~ msgstr "Editar Programa" + +#~ msgid "Leave ..." +#~ msgstr "Sair ..." diff --git a/com.github.adhec.DittoMenu/translate/ru.po b/com.github.adhec.MenuDitto/translate/ru.po similarity index 67% rename from com.github.adhec.DittoMenu/translate/ru.po rename to com.github.adhec.MenuDitto/translate/ru.po index 66e6995..9c22a09 100644 --- a/com.github.adhec.DittoMenu/translate/ru.po +++ b/com.github.adhec.MenuDitto/translate/ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Edward Karate \n" "Language-Team: LANGUAGE \n" @@ -17,47 +17,67 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Убрать из избранного" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Добавить в избранное" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "По всем видам деятельности" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "О текущей деятельности" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Показать в Избранном" - #: ../contents/config/config.qml msgid "General" msgstr "Общие" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Убрать из избранных" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Добавить в избранные" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "По всем видам деятельности" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "В текущей активности" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "Показать в Избранных" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Значок" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Выбрать..." +msgid "Choose…" +msgstr "Выбрать…" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Очистить значок" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "Размер значков" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "Маленький" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "Средний" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "Большой" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "Огромный" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" -msgstr "Сначала показать избранное" +msgstr "Сначала показать избранные" #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" @@ -65,7 +85,7 @@ msgstr "Положение меню" #: ../contents/ui/ConfigGeneral.qml msgid "Default" -msgstr "По умолчанию" +msgstr "По-умолчанию" #: ../contents/ui/ConfigGeneral.qml msgid "Center" @@ -87,6 +107,10 @@ msgstr "Количество колонок" msgid "Number of rows" msgstr "Количество строк" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "Показывать пользователя" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Показать все скрытые приложения" @@ -96,8 +120,8 @@ msgid "Unhidden!" msgstr "Показаны!" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "Редактировать меню..." +msgid "Edit Applications…" +msgstr "Редактировать приложения…" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -112,8 +136,12 @@ msgid "Lock Screen" msgstr "Заблокировать" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." -msgstr "Выход ..." +msgid "Switch User" +msgstr "Сменить пользователя" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" +msgstr "Выключение" #: ../contents/ui/MenuRepresentation.qml msgid "Hi, " @@ -121,11 +149,11 @@ msgstr "Привет, " #: ../contents/ui/MenuRepresentation.qml msgid "Type here to search ..." -msgstr "Введите текст для поиска..." +msgstr "Введите текст для поиска ..." #: ../contents/ui/MenuRepresentation.qml msgid "Favorites" -msgstr "Избранное" +msgstr "Избранные" #: ../contents/ui/MenuRepresentation.qml msgid "All apps" @@ -137,6 +165,22 @@ msgstr "Все приложения" #~ msgid "A configurable launcher menu" #~ msgstr "Настраиваемое меню приложений" +#~ msgid "On The Current Activity" +#~ msgstr "О текущей деятельности" + +#~ msgid "Show In Favorites" +#~ msgstr "Показать в Избранных" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Выбрать..." + +#~ msgid "Edit Applications..." +#~ msgstr "Редактировать меню..." + +#~ msgid "Leave ..." +#~ msgstr "Выход ..." + #~ msgctxt "@action" #~ msgid "Lock Screen" #~ msgstr "Заблокировать" diff --git a/com.github.adhec.DittoMenu/translate/template.pot b/com.github.adhec.MenuDitto/translate/template.pot similarity index 68% rename from com.github.adhec.DittoMenu/translate/template.pot rename to com.github.adhec.MenuDitto/translate/template.pot index bb4006b..630b8b9 100644 --- a/com.github.adhec.DittoMenu/translate/template.pot +++ b/com.github.adhec.MenuDitto/translate/template.pot @@ -1,14 +1,14 @@ -# Translation of DittoMenu in LANGUAGE +# Translation of MenuDitto in LANGUAGE # Copyright (C) 2024 -# This file is distributed under the same license as the DittoMenu package. +# This file is distributed under the same license as the MenuDitto package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: DittoMenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Project-Id-Version: MenuDitto\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,28 +17,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../contents/code/tools.js +#: ../contents/config/config.qml +msgid "General" +msgstr "" + +#: ../contents/ui/code/tools.js msgid "Remove from Favorites" msgstr "" -#: ../contents/code/tools.js +#: ../contents/ui/code/tools.js msgid "Add to Favorites" msgstr "" -#: ../contents/code/tools.js +#: ../contents/ui/code/tools.js msgid "On All Activities" msgstr "" -#: ../contents/code/tools.js -msgid "On The Current Activity" +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" msgstr "" -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "" - -#: ../contents/config/config.qml -msgid "General" +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" msgstr "" #: ../contents/ui/ConfigGeneral.qml @@ -47,7 +47,7 @@ msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." +msgid "Choose…" msgstr "" #: ../contents/ui/ConfigGeneral.qml @@ -55,6 +55,26 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "" @@ -87,6 +107,10 @@ msgstr "" msgid "Number of rows" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "" @@ -96,7 +120,7 @@ msgid "Unhidden!" msgstr "" #: ../contents/ui/main.qml -msgid "Edit Applications..." +msgid "Edit Applications…" msgstr "" #: ../contents/ui/MenuRepresentation.qml @@ -112,7 +136,11 @@ msgid "Lock Screen" msgstr "" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" msgstr "" #: ../contents/ui/MenuRepresentation.qml diff --git a/com.github.adhec.DittoMenu/translate/tr.po b/com.github.adhec.MenuDitto/translate/tr.po similarity index 75% rename from com.github.adhec.DittoMenu/translate/tr.po rename to com.github.adhec.MenuDitto/translate/tr.po index c827734..b83311c 100644 --- a/com.github.adhec.DittoMenu/translate/tr.po +++ b/com.github.adhec.MenuDitto/translate/tr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: dittomenu\n" -"Report-Msgid-Bugs-To: https://github.com/adhec/dittoMenuKDE\n" -"POT-Creation-Date: 2024-01-03 17:25+0500\n" +"Report-Msgid-Bugs-To: https://github.com/prateekmedia/MenuDitto\n" +"POT-Creation-Date: 2024-10-07 22:12+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,44 +20,64 @@ msgstr "" "X-Language: tr_TR\n" "X-Source-Language: C\n" -#: ../contents/code/tools.js -msgid "Remove from Favorites" -msgstr "Favorilerden Çıkar" - -#: ../contents/code/tools.js -msgid "Add to Favorites" -msgstr "Favorilerden Ekle" - -#: ../contents/code/tools.js -msgid "On All Activities" -msgstr "Tüm Etkinliklerde" - -#: ../contents/code/tools.js -msgid "On The Current Activity" -msgstr "Mevcut Etkinlik Üzerine" - -#: ../contents/code/tools.js -msgid "Show In Favorites" -msgstr "Favorilerde Göster" - #: ../contents/config/config.qml msgid "General" msgstr "Genel" +#: ../contents/ui/code/tools.js +msgid "Remove from Favorites" +msgstr "Favorilerden Çıkar" + +#: ../contents/ui/code/tools.js +msgid "Add to Favorites" +msgstr "Favorilerden Ekle" + +#: ../contents/ui/code/tools.js +msgid "On All Activities" +msgstr "Tüm Etkinliklerde" + +#: ../contents/ui/code/tools.js +msgid "On the Current Activity" +msgstr "" + +#: ../contents/ui/code/tools.js +msgid "Show in Favorites" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Icon:" msgstr "Sİmge:" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Open icon chooser dialog" -msgid "Choose..." -msgstr "Seçmek..." +msgid "Choose…" +msgstr "" #: ../contents/ui/ConfigGeneral.qml msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Simgeyi Temizle" +#: ../contents/ui/ConfigGeneral.qml +msgid "Icon size:" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Small" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Medium" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Large" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Huge" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Show favorites first" msgstr "Önce favorileri göster" @@ -90,6 +110,10 @@ msgstr "" msgid "Number of rows" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgid "Show user" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Unhide all hidden applications" msgstr "Tüm gizli uygulamaları göster" @@ -99,8 +123,8 @@ msgid "Unhidden!" msgstr "Gizli!" #: ../contents/ui/main.qml -msgid "Edit Applications..." -msgstr "Uygulamaları Düzenle..." +msgid "Edit Applications…" +msgstr "" #: ../contents/ui/MenuRepresentation.qml msgid "System Preferences" @@ -115,7 +139,11 @@ msgid "Lock Screen" msgstr "" #: ../contents/ui/MenuRepresentation.qml -msgid "Leave ..." +msgid "Switch User" +msgstr "" + +#: ../contents/ui/MenuRepresentation.qml +msgid "Shutdown" msgstr "" #: ../contents/ui/MenuRepresentation.qml @@ -140,6 +168,19 @@ msgstr "" #~ msgid "A configurable launcher menu" #~ msgstr "Yapılandırılabilir bir başlatıcı menüsü" +#~ msgid "On The Current Activity" +#~ msgstr "Mevcut Etkinlik Üzerine" + +#~ msgid "Show In Favorites" +#~ msgstr "Favorilerde Göster" + +#~ msgctxt "@item:inmenu Open icon chooser dialog" +#~ msgid "Choose..." +#~ msgstr "Seçmek..." + +#~ msgid "Edit Applications..." +#~ msgstr "Uygulamaları Düzenle..." + #~ msgctxt "@action" #~ msgid "Lock Screen" #~ msgstr "Kilit Ekranı" diff --git a/push.sh b/push.sh index 345883e..434d0f3 100755 --- a/push.sh +++ b/push.sh @@ -1,5 +1,6 @@ #!/bin/bash -git add . && git commit -m "Update" && git push +git add . && git commit -m "Update" +git push echo "Ready"