Skip to content

Commit

Permalink
Porting to KF6.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrTall committed Apr 5, 2024
1 parent 2caffd0 commit b170556
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 125 deletions.
Empty file added .gitignore
Empty file.
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.16)

project(org.chrtall.kppleMenu)

set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS 1)

find_package(ECM 6.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
include(QtVersionOption)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)

find_package(Qt6 CONFIG REQUIRED COMPONENTS
Qml
Core
)

find_package(Plasma REQUIRED)

plasma_install_package(package org.chrtall.kppleMenu)

#add_subdirectory(package)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Forked

The original maintainer does not seem actively maintaining the project anymore.
In order to port the plasmoid to KF6 I created this fork.

# Kpple Menu

<p align="center">
Expand Down
9 changes: 5 additions & 4 deletions package/contents/ui/ListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import QtQuick 2.2
import QtQuick.Layouts 1.1

import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kirigami 2.5 as Kirigami

Item {
id: item
Expand Down Expand Up @@ -62,8 +63,8 @@ Item {
// set space before the text item with a empty icon
Item {
id: emptySpace
Layout.minimumWidth: 1 * units.gridUnit
Layout.maximumWidth: 1 * units.gridUnit
Layout.minimumWidth: 1 * Kirigami.Units.gridUnit
Layout.maximumWidth: 1 * Kirigami.Units.gridUnit
}

Item {
Expand Down
45 changes: 24 additions & 21 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1

import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.plasma5support as Plasma5Support
import org.kde.kirigami 2.5 as Kirigami

Item {
PlasmoidItem {
id: root

// define exec system ( call commands ) : by Uswitch applet!
PlasmaCore.DataSource {
Plasma5Support.DataSource {
id: executable
engine: "executable"
connectedSources: []
Expand All @@ -53,12 +56,12 @@ Item {
signal exited(string sourceName, string stdout)
}

Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
Plasmoid.compactRepresentation: null
Plasmoid.fullRepresentation: Item {
preferredRepresentation: Plasmoid.compactRepresentation
compactRepresentation: null
fullRepresentation: Item {
id: fullRoot

readonly property double iwSize: units.gridUnit * 12.6 // item width
readonly property double iwSize: Kirigami.Units.gridUnit * 12.6 // item width
readonly property double shSize: 1.1 // separator height

// config var
Expand All @@ -76,10 +79,10 @@ Item {
Layout.preferredHeight: aboutThisComputerItem.height * 11 // not the best way to code..

// define highlight
PlasmaComponents.Highlight {
id: delegateHighlight
visible: false
}
//PlasmaComponents3.Highlight {
// id: delegateHighlight
// visible: false
//}

ColumnLayout {
id: columm
Expand All @@ -88,7 +91,7 @@ Item {

ListDelegate {
id: aboutThisComputerItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("About This Computer")
onClicked: {
executable.exec(aboutThisComputerCMD); // cmd exec
Expand All @@ -109,7 +112,7 @@ Item {

ListDelegate {
id: systemPreferencesItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("System Preferences...")
onClicked: {
executable.exec(systemPreferencesCMD); // cmd exec
Expand All @@ -118,7 +121,7 @@ Item {

ListDelegate {
id: appStoreItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("App Store...")
onClicked: {
executable.exec(appStoreCMD); // cmd exec
Expand All @@ -139,7 +142,7 @@ Item {

ListDelegate {
id: forceQuitItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Force Quit...")
// right shortcut item
PlasmaComponents.Label {
Expand All @@ -166,7 +169,7 @@ Item {

ListDelegate {
id: sleepItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Sleep")
onClicked: {
executable.exec(sleepCMD); // cmd exec
Expand All @@ -175,7 +178,7 @@ Item {

ListDelegate {
id: restartItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Restart...")
onClicked: {
executable.exec(restartCMD); // cmd exec
Expand All @@ -184,7 +187,7 @@ Item {

ListDelegate {
id: shutDownItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Shut Down...")
onClicked: {
executable.exec(shutDownCMD); // cmd exec
Expand All @@ -205,7 +208,7 @@ Item {

ListDelegate {
id: lockScreenItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Lock Screen")
// right shortcut item
PlasmaComponents.Label {
Expand All @@ -220,7 +223,7 @@ Item {

ListDelegate {
id: logOutItem
highlight: delegateHighlight
//highlight: delegateHighlight
text: i18n("Log Out")
// right shortcut item
PlasmaComponents.Label {
Expand Down
100 changes: 0 additions & 100 deletions package/metadata.desktop

This file was deleted.

0 comments on commit b170556

Please sign in to comment.