mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
Mobileshell: Reorganize File Structure of Popup Items
Consolidate the popup items into a single folder for better organization.
This commit is contained in:
parent
9303509258
commit
a3cfa885ee
17 changed files with 42 additions and 55 deletions
|
|
@ -23,8 +23,7 @@ set_source_files_properties(qml/dataproviders/AudioInfo.qml PROPERTIES QT_QML_SI
|
|||
set_source_files_properties(qml/dataproviders/BatteryInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
set_source_files_properties(qml/dataproviders/BluetoothInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
set_source_files_properties(qml/dataproviders/SignalStrengthInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
set_source_files_properties(qml/notificationpopup/NotificationPopupProviderLoader.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
set_source_files_properties(qml/volumeosd/VolumeOSDProviderLoader.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
set_source_files_properties(qml/popups/PopupProviderLoader.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
||||
|
||||
# Include qml and js files within ./qml/
|
||||
file(GLOB_RECURSE _qml_sources
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Micah Stanley <stanleymicah@proton.me>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
|
||||
pragma Singleton
|
||||
|
||||
/**
|
||||
* This wraps the NotificationPopupProvider component so that we can avoid loading side
|
||||
* effects from imports (since this is a singleton and initialized immediately on import).
|
||||
*/
|
||||
Loader {
|
||||
id: root
|
||||
sourceComponent: Component {
|
||||
MobileShell.NotificationPopupProvider {}
|
||||
}
|
||||
|
||||
function load() {
|
||||
root.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
40
components/mobileshell/qml/popups/PopupProviderLoader.qml
Normal file
40
components/mobileshell/qml/popups/PopupProviderLoader.qml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||
* SPDX-FileCopyrightText: 2024-2025 Micah Stanley <stanleymicah@proton.me>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
|
||||
pragma Singleton
|
||||
|
||||
/**
|
||||
* This wraps the popup components so that we can avoid loading side
|
||||
* effects from imports (since this is a singleton and initialized immediately on import).
|
||||
*/
|
||||
Item {
|
||||
id: root
|
||||
|
||||
// WARNING: only call this load from within the plasmashell process, because
|
||||
// multiple bindings of the shortcut may break it entirely (hardware volume keys)
|
||||
function load() {
|
||||
volumeOSD.active = true;
|
||||
notifications.active = true;
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: volumeOSD
|
||||
sourceComponent: Component {
|
||||
MobileShell.VolumeOSDProvider {}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: notifications
|
||||
sourceComponent: Component {
|
||||
MobileShell.NotificationPopupProvider {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||
// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
|
||||
import QtQuick
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
|
||||
pragma Singleton
|
||||
|
||||
/**
|
||||
* This wraps the VolumeOSDProvider component so that we can avoid loading side
|
||||
* effects from imports (since this is a singleton and initialized immediately on import).
|
||||
*/
|
||||
Loader {
|
||||
id: root
|
||||
sourceComponent: Component {
|
||||
MobileShell.VolumeOSDProvider {}
|
||||
}
|
||||
|
||||
// WARNING: only call this load from within the plasmashell process, because
|
||||
// multiple bindings of the shortcut may break it entirely (hardware volume keys)
|
||||
function load() {
|
||||
root.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,9 +132,8 @@ ContainmentItem {
|
|||
|
||||
// HACK: we need to initialize the DBus server somewhere, it might as well be here...
|
||||
// initialize the volume osd, and volume keys
|
||||
MobileShell.VolumeOSDProviderLoader.load();
|
||||
// initialize notification popups
|
||||
MobileShell.NotificationPopupProviderLoader.load();
|
||||
MobileShell.PopupProviderLoader.load();
|
||||
}
|
||||
|
||||
MobileShell.StartupFeedbackPanelFill {
|
||||
|
|
|
|||
Loading…
Reference in a new issue