mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-30 08:14:45 +00:00
kscreenosd popup: auto-switch to convergenceMode
This popupprovider takes care of automatically enabling and disabling convergence / docked mode when a monitor is plugged in or unplugged. It uses the plugin that is provided with the kscreenosd quicksetting, which essentially notifies of outputs being added and removed. Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
parent
b849fb98ab
commit
569d268c49
3 changed files with 38 additions and 0 deletions
|
|
@ -80,6 +80,8 @@ ecm_target_qml_sources(mobileshellplugin SOURCES
|
||||||
qml/popups/notifications/NotificationPopupProvider.qml
|
qml/popups/notifications/NotificationPopupProvider.qml
|
||||||
qml/popups/notifications/PulseAudio.qml
|
qml/popups/notifications/PulseAudio.qml
|
||||||
|
|
||||||
|
qml/popups/kscreenosd/KScreenOSDProvider.qml
|
||||||
|
|
||||||
qml/popups/volumeosd/AudioApplet.qml
|
qml/popups/volumeosd/AudioApplet.qml
|
||||||
qml/popups/volumeosd/DeviceListItem.qml
|
qml/popups/volumeosd/DeviceListItem.qml
|
||||||
qml/popups/volumeosd/icon.js
|
qml/popups/volumeosd/icon.js
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ Item {
|
||||||
if (!volumeOSD.active) {
|
if (!volumeOSD.active) {
|
||||||
volumeOSD.active = true;
|
volumeOSD.active = true;
|
||||||
}
|
}
|
||||||
|
if (!kscreenOSD.active) {
|
||||||
|
kscreenOSD.active = true;
|
||||||
|
}
|
||||||
if (!notifications.active) {
|
if (!notifications.active) {
|
||||||
notifications.active = true;
|
notifications.active = true;
|
||||||
}
|
}
|
||||||
|
|
@ -38,6 +41,13 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: kscreenOSD
|
||||||
|
sourceComponent: Component {
|
||||||
|
MobileShell.KScreenOSDProvider {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: notifications
|
id: notifications
|
||||||
sourceComponent: Component {
|
sourceComponent: Component {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
// SPDX-FileCopyrightText: 2025 Sebastian Kügler <sebas@kde.org>
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQml
|
||||||
|
|
||||||
|
import org.kde.plasma.quicksetting.kscreenosd 1.0
|
||||||
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This switches between docked / convergence mode and normal when a monitor
|
||||||
|
* is plugged in or unplugged.
|
||||||
|
*/
|
||||||
|
QtObject {
|
||||||
|
id: component
|
||||||
|
|
||||||
|
property var apiListener: Connections {
|
||||||
|
target: KScreenOSDUtil
|
||||||
|
function onOutputsChanged() {
|
||||||
|
console.log("KScreenOSDProvider convergenceModeEnabled: "
|
||||||
|
+ (KScreenOSDUtil.outputs > 1 ? "true" : "false"));
|
||||||
|
ShellSettings.Settings.convergenceModeEnabled = KScreenOSDUtil.outputs > 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue