Show context menu on desktop right-click in convergence mode

Right-clicking the desktop or dock background opened the mobile
settings overlay, which is a long-press gesture for touchscreens.
In convergence mode show a popup menu instead with three items:
Desktop and Wallpaper, Add Widgets, and Configure Desktop.

Long-press still opens the settings overlay on all form factors.
This commit is contained in:
Marco Allegretti 2026-05-01 13:03:20 +02:00
parent 6d79f8ed05
commit 84a6fa8054
4 changed files with 45 additions and 4 deletions

View file

@ -559,9 +559,12 @@ MouseArea {
}
onClicked: (mouse) => {
// Right-click opens settings view (wallpaper/widgets), same as long-press
if (mouse.button === Qt.RightButton) {
folio.HomeScreenState.openSettingsView();
if (convergenceMode) {
root.homeScreen.showDesktopContextMenu();
} else {
folio.HomeScreenState.openSettingsView();
}
}
}

View file

@ -13,6 +13,7 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
import QtQuick.Templates as T
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
import "./delegate"
@ -78,6 +79,35 @@ Item {
Plasmoid.internalAction("configure").trigger();
}
function showDesktopContextMenu() {
desktopContextMenu.popup();
}
PC3.Menu {
id: desktopContextMenu
popupType: T.Popup.Window
PC3.MenuItem {
text: i18n("Desktop and Wallpaper...")
icon.name: "preferences-desktop-wallpaper"
onTriggered: root.wallpaperSelectorTriggered()
}
PC3.MenuItem {
text: i18n("Add Widgets...")
icon.name: "widget-alternatives"
onTriggered: {
folio.HomeScreenState.openSettingsView();
settings.openWidgetsBrowser();
}
}
PC3.MenuSeparator {}
PC3.MenuItem {
text: i18n("Configure Desktop...")
icon.name: "settings-configure"
onTriggered: root.openConfigure()
}
}
Keys.onPressed: (event) => {
// The root is focused when we aren't in key navigation mode
// Begin key navigation when arrow keys are pressed

View file

@ -7,6 +7,7 @@ import QtQuick.Layouts
import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
import org.kde.kirigami as Kirigami
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
@ -28,9 +29,12 @@ MouseArea {
}
onClicked: (mouse) => {
// Right-click opens settings view (wallpaper/widgets), same as long-press
if (mouse.button === Qt.RightButton) {
folio.HomeScreenState.openSettingsView();
if (ShellSettings.Settings.convergenceModeEnabled) {
root.homeScreen.showDesktopContextMenu();
} else {
folio.HomeScreenState.openSettingsView();
}
}
}

View file

@ -23,6 +23,10 @@ Item {
readonly property bool homeScreenInteractive: !appletListViewer.active
function openWidgetsBrowser() {
appletListViewer.active = true;
}
property real bottomMargin: 0
property real leftMargin: 0
property real rightMargin: 0