aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml17
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml49
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/plugins.pri9
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/BatteryButton.qml12
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/NetworkButton.qml23
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/TrayIcon.qml13
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/VolumeButton.qml13
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri1
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc5
9 files changed, 141 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml
index 556da5ec..44abb425 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml
@@ -7,8 +7,10 @@
import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1
+import QtQuick.Layouts 1.3
import Lumina.Backend.PanelObject 2.0
+import "./plugins" as PLUGINS
Rectangle {
//C++ backend object
@@ -21,4 +23,17 @@ Rectangle {
y: object.y
width: object.width
height: object.height
- }
+
+ GridLayout{
+ id: layout
+ anchors.fill: parent;
+ columns: (object.width>object.height) ? -1 : 1
+ rows: (object.width>object.height) ? 1 : -1
+
+ //hardcode the "status_tray" plugin at the moment
+ PLUGINS.StatusTray{
+ id: "statustray"
+ }
+ }
+
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml
new file mode 100644
index 00000000..4552ea39
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml
@@ -0,0 +1,49 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2018, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This is the QML plugin that displays the OS status/system tray
+//===========================================
+import QtQuick 2.2
+import QtQuick.Layouts 1.3
+
+import "./status_tray" as QML
+
+
+Rectangle {
+ property int prefsize: (parent.width < parent.height) ? parent.width : parent.height
+ id: "status_tray"
+ //color: "transparent"
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ GridLayout{
+ anchors.fill: parent
+ flow: GridLayout.LeftToRight
+ columnSpacing: 2
+ rowSpacing: 2
+
+ //Volume Status
+ QML.VolumeButton{
+ id: "volButton"
+ Layout.preferredHeight: status_tray.prefsize
+ Layout.preferredWidth: status_tray.prefsize
+ }
+ //Network Status
+ QML.NetworkButton{
+ Layout.preferredHeight: status_tray.prefsize
+ Layout.preferredWidth: status_tray.prefsize
+ }
+ //Battery Status
+ QML.BatteryButton{
+ id: "batButton"
+ Layout.preferredHeight: status_tray.prefsize
+ Layout.preferredWidth: status_tray.prefsize
+ }
+ //System Tray Menu Popup
+
+ } //end of layout
+
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/plugins.pri b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/plugins.pri
new file mode 100644
index 00000000..36cc581b
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/plugins.pri
@@ -0,0 +1,9 @@
+#Show the QML files to lupdate for translation purposes - not for the actual build
+lupdate_only{
+ SOURCES *= $${PWD}/StatusTray.qml \
+ $${PWD}/status_tray/TrayIcon.qml \
+ $${PWD}/status_tray/VolumeButton.qml \
+ $${PWD}/status_tray/NetworkButton.qml \
+ $${PWD}/status_tray/BatteryButton.qml
+
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/BatteryButton.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/BatteryButton.qml
new file mode 100644
index 00000000..0963165d
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/BatteryButton.qml
@@ -0,0 +1,12 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2018, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+import QtQuick 2.2
+import QtQuick.Controls 2
+
+Rectangle{
+ color: "red"
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/NetworkButton.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/NetworkButton.qml
new file mode 100644
index 00000000..387c130b
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/NetworkButton.qml
@@ -0,0 +1,23 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2018, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+import QtQuick 2.2
+import QtQuick.Controls 1
+
+import Lumina.Backend.RootDesktopObject 2.0
+import Lumina.Backend.OSInterface 2.0
+
+ToolButton{
+ id: "netButton"
+ property OSInterface os: RootObject.os_interface()
+ iconName: os.networkIcon
+ tooltip: os.networkStatus
+ visible: os.networkAvailable
+ enabled: os.hasNetworkManager()
+ onClicked: {
+ RootObject.launchApplication(os.networkManagerUtility())
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/TrayIcon.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/TrayIcon.qml
new file mode 100644
index 00000000..4207b156
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/TrayIcon.qml
@@ -0,0 +1,13 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2018, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+import QtQuick 2.2
+import QtQuick.Controls 2
+import Lumina.Backend.NativeWindowObject 2.0
+
+Rectangle{
+ color: "white"
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/VolumeButton.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/VolumeButton.qml
new file mode 100644
index 00000000..43992fc4
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/VolumeButton.qml
@@ -0,0 +1,13 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2018, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+import QtQuick 2.2
+import QtQuick.Controls 1
+
+ToolButton{
+ text: "volume"
+ tooltip: "volume"
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri
index 79941b82..fa29aa96 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.pri
@@ -6,5 +6,6 @@ lupdate_only{
$${PWD}/Panel.qml \
$${PWD}/NativeWindow.qml
}
+include(plugins/plugins.pri)
RESOURCES *= $${PWD}/src-qml.qrc
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc
index a4dc414f..ba143027 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc
@@ -5,5 +5,10 @@
<file>Screen.qml</file>
<file>Panel.qml</file>
<file>NativeWindow.qml</file>
+ <file>plugins/StatusTray.qml</file>
+ <file>plugins/status_tray/TrayIcon.qml</file>
+ <file>plugins/status_tray/VolumeButton.qml</file>
+ <file>plugins/status_tray/NetworkButton.qml</file>
+ <file>plugins/status_tray/BatteryButton.qml</file>
</qresource>
</RCC>
bgstack15