From 4a2a6f3af5dab7effdb7c512e8b03adf2724b401 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 31 Jan 2018 12:04:36 -0500 Subject: Get a lot more cache system setup for OSInterface backend. Add a new "UpdateButton" to the StatusTray plugin. --- .../src-desktop/src-qml/plugins/StatusTray.qml | 5 +++++ .../src-desktop/src-qml/plugins/plugins.pri | 3 ++- .../src-qml/plugins/status_tray/TrayIcon.qml | 17 ++++++++++++--- .../src-qml/plugins/status_tray/UpdateButton.qml | 24 ++++++++++++++++++++++ .../src-desktop/src-qml/src-qml.qrc | 1 + 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-qml') 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 254ffff2..e1e7cd10 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 @@ -40,6 +40,11 @@ Rectangle { Layout.preferredHeight: status_tray.prefsize Layout.preferredWidth: status_tray.prefsize } + //Update Status + QML.UpdateButton{ + 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 index 36cc581b..50eb9c5c 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 @@ -4,6 +4,7 @@ lupdate_only{ $${PWD}/status_tray/TrayIcon.qml \ $${PWD}/status_tray/VolumeButton.qml \ $${PWD}/status_tray/NetworkButton.qml \ - $${PWD}/status_tray/BatteryButton.qml + $${PWD}/status_tray/BatteryButton.qml \ + $${PWD}/status_tray/UpdateButton.qml } 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 index 8b8367b0..26c50907 100644 --- 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 @@ -5,10 +5,21 @@ // See the LICENSE file for full details //=========================================== import QtQuick 2.2 -import QtQuick.Controls 2 +import QtQuick.Controls 1 import Lumina.Backend.NativeWindowObject 2.0 -Rectangle{ - color: "white" +Image{ + property NativeWindowObject winObj + source: winObj.icon + + MouseArea{ + anchors.fill: parent + acceptedButtons: Qt.NoButton + onEntered: { + //Need to ensure the invisible native window is over this place right now + point pt: parent.mapToGlobal(0,0) + winObj.updateGeometry( pt.x(), pt.y(), parent.width(), parent.height(), true); + } + } } 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 new file mode 100644 index 00000000..881f164f --- /dev/null +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/UpdateButton.qml @@ -0,0 +1,24 @@ +//=========================================== +// 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: "updateButton" + property OSInterface os: RootObject.os_interface() + iconName: os.updateIcon + tooltip: os.networkStatus + visible: (os.updateStatus == "") + /*enabled: os.hasUpdateManager() + onClicked: { + RootObject.launchApplication(os.updateManagerUtility()) + }*/ + //TODO - add a menu with update manager and start/view updates options +} 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 ba143027..1da9d5bd 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 @@ -10,5 +10,6 @@ plugins/status_tray/VolumeButton.qml plugins/status_tray/NetworkButton.qml plugins/status_tray/BatteryButton.qml + plugins/status_tray/UpdateButton.qml -- cgit