mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-12 09:17:42 +00:00
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:
parent
6d79f8ed05
commit
84a6fa8054
4 changed files with 45 additions and 4 deletions
|
|
@ -559,11 +559,14 @@ MouseArea {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: (mouse) => {
|
onClicked: (mouse) => {
|
||||||
// Right-click opens settings view (wallpaper/widgets), same as long-press
|
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
|
if (convergenceMode) {
|
||||||
|
root.homeScreen.showDesktopContextMenu();
|
||||||
|
} else {
|
||||||
folio.HomeScreenState.openSettingsView();
|
folio.HomeScreenState.openSettingsView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDoubleClicked: {
|
onDoubleClicked: {
|
||||||
if (folio.FolioSettings.doubleTapToLock) {
|
if (folio.FolioSettings.doubleTapToLock) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import org.kde.plasma.plasmoid 2.0
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
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 plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
||||||
|
|
||||||
import "./delegate"
|
import "./delegate"
|
||||||
|
|
@ -78,6 +79,35 @@ Item {
|
||||||
Plasmoid.internalAction("configure").trigger();
|
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) => {
|
Keys.onPressed: (event) => {
|
||||||
// The root is focused when we aren't in key navigation mode
|
// The root is focused when we aren't in key navigation mode
|
||||||
// Begin key navigation when arrow keys are pressed
|
// Begin key navigation when arrow keys are pressed
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
||||||
|
|
||||||
|
|
@ -28,11 +29,14 @@ MouseArea {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: (mouse) => {
|
onClicked: (mouse) => {
|
||||||
// Right-click opens settings view (wallpaper/widgets), same as long-press
|
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
|
if (ShellSettings.Settings.convergenceModeEnabled) {
|
||||||
|
root.homeScreen.showDesktopContextMenu();
|
||||||
|
} else {
|
||||||
folio.HomeScreenState.openSettingsView();
|
folio.HomeScreenState.openSettingsView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDoubleClicked: {
|
onDoubleClicked: {
|
||||||
if (folio.FolioSettings.doubleTapToLock) {
|
if (folio.FolioSettings.doubleTapToLock) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ Item {
|
||||||
|
|
||||||
readonly property bool homeScreenInteractive: !appletListViewer.active
|
readonly property bool homeScreenInteractive: !appletListViewer.active
|
||||||
|
|
||||||
|
function openWidgetsBrowser() {
|
||||||
|
appletListViewer.active = true;
|
||||||
|
}
|
||||||
|
|
||||||
property real bottomMargin: 0
|
property real bottomMargin: 0
|
||||||
property real leftMargin: 0
|
property real leftMargin: 0
|
||||||
property real rightMargin: 0
|
property real rightMargin: 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue