aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml26
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml8
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml16
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml36
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/plugins.pri3
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml4
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/src-qml.qrc1
-rw-r--r--src-qt5/src-cpp/framework-OSInterface.h2
-rw-r--r--src-qt5/src-cpp/framework-OSInterface_private.cpp3
9 files changed, 67 insertions, 32 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 48046648..2a8579a8 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
@@ -27,21 +27,29 @@ Rectangle {
GridLayout{
id: layout
anchors.fill: parent;
- columns: (object.width>object.height) ? -1 : 1
- rows: (object.width>object.height) ? 1 : -1
+ columns: parent.object.isVertical ? 1 : -1
+ rows: parent.object.isVertical ? -1 : 1
+
+ //hardcode some plugins for the moment
+ //PLUGINS.Spacer{}
- //hardcode the "status_tray" plugin at the moment
PLUGINS.StatusTray{
id: "statustray"
- Layout.fillHeight: layout.parent.object.isVertical ? false : true
- Layout.fillWidth: layout.parent.object.isVertical ? true : false
-
+ vertical: layout.parent.object.isVertical
+ //Layout.fillWidth: layout.parent.object.isVertical ? true : false
+ //Layout.fillHeight: layout.parent.object.isVertical ? false : true
}
+
+ //PLUGINS.Spacer{}
+
PLUGINS.Clock_Digital{
id: "clock"
- Layout.fillHeight: layout.parent.object.isVertical ? false : true
- Layout.fillWidth: layout.parent.object.isVertical ? true : false
+ vertical: layout.parent.object.isVertical
+ //Layout.fillWidth: layout.parent.object.isVertical ? true : false
+ //Layout.fillHeight: layout.parent.object.isVertical ? false : true
}
- }
+ //PLUGINS.Spacer{}
+
+ } //end of grid layout
}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml
index aaa8ddd0..f82d398b 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml
@@ -12,6 +12,10 @@ import QtQuick.Controls 1
import Lumina.Backend.RootDesktopObject 2.0
-ToolButton{
- text: RootObject.currentTime
+Label{
+ property bool vertical
+ text: RootObject.currentTime
+ wrapMode: Text.WrapWord
+ rotation: vertical ? 90 : 0
+ transformOrigin: Item.Center
}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml
new file mode 100644
index 00000000..d46e486c
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml
@@ -0,0 +1,16 @@
+//===========================================
+// 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
+
+
+Item{
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+}
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
index 0bec74f2..a2d49b35 100644
--- 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
@@ -8,7 +8,7 @@
//===========================================
import QtQuick 2.2
import QtQuick.Layouts 1.3
-import QtQuick.Controls 2
+import QtQuick.Controls 1
import Lumina.Backend.RootDesktopObject 2.0
import Lumina.Backend.NativeWindowObject 2.0
@@ -16,38 +16,38 @@ import Lumina.Backend.NativeWindowObject 2.0
import "./status_tray" as QML
-Rectangle {
- property int prefsize: (parent.width < parent.height) ? parent.width : parent.height
+Item {
+ property bool vertical
+ property int prefsize: vertical ? 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
+ flow: parent.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight
+ columns: vertical ? 2 : -1
+ rows: vertical ? -1 : 2
+ //columnSpacing: 2
+ //rowSpacing: 2
//Volume Status
QML.VolumeButton{
- Layout.preferredHeight: status_tray.prefsize
- Layout.preferredWidth: status_tray.prefsize
+ //Layout.preferredHeight: status_tray.prefsize
+ //Layout.preferredWidth: status_tray.prefsize
}
//Network Status
QML.NetworkButton{
- Layout.preferredHeight: status_tray.prefsize
- Layout.preferredWidth: status_tray.prefsize
+ //Layout.preferredHeight: status_tray.prefsize
+ //Layout.preferredWidth: status_tray.prefsize
}
//Battery Status
QML.BatteryButton{
- Layout.preferredHeight: status_tray.prefsize
- Layout.preferredWidth: status_tray.prefsize
+ //Layout.preferredHeight: status_tray.prefsize
+ //Layout.preferredWidth: status_tray.prefsize
}
//Update Status
QML.UpdateButton{
- Layout.preferredHeight: status_tray.prefsize
- Layout.preferredWidth: status_tray.prefsize
+ //Layout.preferredHeight: status_tray.prefsize
+ //Layout.preferredWidth: status_tray.prefsize
}
//System Tray Menu Button
ToolButton{
@@ -56,7 +56,7 @@ Rectangle {
//iconName: "view-more-vertical"
visible: RootObject.hasTrayWindows
onClicked: trayMenu.open()
- Menu{
+ menu: Menu{
id: "trayMenu"
//MenuItem{ text: "sample" }
//MenuItem{ text: "sample2" }
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
index a6296e13..d1939616 100644
--- 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
@@ -6,5 +6,6 @@ lupdate_only{
$${PWD}/status_tray/NetworkButton.qml \
$${PWD}/status_tray/BatteryButton.qml \
$${PWD}/status_tray/UpdateButton.qml \
- $${PWD}/Clock_Digital.qml
+ $${PWD}/Clock_Digital.qml \
+ $${PWD}/Spacer.qml
}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml
index 881f164f..9ba824ae 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml
@@ -14,8 +14,8 @@ ToolButton{
id: "updateButton"
property OSInterface os: RootObject.os_interface()
iconName: os.updateIcon
- tooltip: os.networkStatus
- visible: (os.updateStatus == "")
+ tooltip: os.updateStatus
+ visible: os.updateInfoAvailable
/*enabled: os.hasUpdateManager()
onClicked: {
RootObject.launchApplication(os.updateManagerUtility())
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 292caea2..0513e467 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
@@ -12,5 +12,6 @@
<file>plugins/status_tray/BatteryButton.qml</file>
<file>plugins/status_tray/UpdateButton.qml</file>
<file>plugins/Clock_Digital.qml</file>
+ <file>plugins/Spacer.qml</file>
</qresource>
</RCC>
diff --git a/src-qt5/src-cpp/framework-OSInterface.h b/src-qt5/src-cpp/framework-OSInterface.h
index debc6c05..7f51764b 100644
--- a/src-qt5/src-cpp/framework-OSInterface.h
+++ b/src-qt5/src-cpp/framework-OSInterface.h
@@ -60,6 +60,7 @@ class OSInterface : public QObject{
//Updates
Q_PROPERTY( QString updateStatus READ updateStatus NOTIFY updateStatusChanged)
Q_PROPERTY( QString updateIcon READ updateIcon NOTIFY updateStatusChanged)
+ Q_PROPERTY( bool updateInfoAvailable READ updateInfoAvailable NOTIFY updateStatusChanged)
//Power options
Q_PROPERTY( bool canReboot READ canReboot NOTIFY powerAvailableChanged)
@@ -111,6 +112,7 @@ public:
// = Updates =
Q_INVOKABLE bool updatesSupported(); //is thie subsystem supported for the OS?
Q_INVOKABLE QString updateStatus(); //Current status ["","available","running","finished"]
+ Q_INVOKABLE bool updateInfoAvailable();
Q_INVOKABLE QString updateIcon();
Q_INVOKABLE QString updateStatusInfo(); //Extra information corresponding to the current status
Q_INVOKABLE QString updateDetails(); //Information about any available updates
diff --git a/src-qt5/src-cpp/framework-OSInterface_private.cpp b/src-qt5/src-cpp/framework-OSInterface_private.cpp
index 96356268..15ee6f8e 100644
--- a/src-qt5/src-cpp/framework-OSInterface_private.cpp
+++ b/src-qt5/src-cpp/framework-OSInterface_private.cpp
@@ -625,6 +625,9 @@ QString OSInterface::updateStatus(){
if(INFO.contains("updates/status")){ return INFO.value("updates/status").toString(); }
return "";
}
+bool OSInterface::updateInfoAvailable(){
+ return !updateStatus().isEmpty();
+}
QString OSInterface::updateIcon(){
if(INFO.contains("updates/icon")){ return INFO.value("updates/icon").toString(); }
bgstack15