aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-01-31 15:40:09 -0500
committerKen Moore <ken@ixsystems.com>2018-01-31 15:40:09 -0500
commit5a287a1132e787ded443c5fe954d7834447d705a (patch)
treead9afd9d7a144efd32c518ceaa46e1449dc56102 /src-qt5/core/lumina-desktop-unified/src-desktop/src-qml
parentGet a lot more cache system setup for OSInterface backend. (diff)
downloadlumina-5a287a1132e787ded443c5fe954d7834447d705a.tar.gz
lumina-5a287a1132e787ded443c5fe954d7834447d705a.tar.bz2
lumina-5a287a1132e787ded443c5fe954d7834447d705a.zip
Another large batch of work on Lumina 2.
1. Bypass a Qt bug in multi-session "DISPLAY" number detection 2. Start getting the system tray all setup. Not quite there yet (still some QML issues) 3. Convert all the Menu's to QtControls2 (actually works on multiple screens)
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-qml')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml13
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml10
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml41
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/status_tray/TrayIcon.qml15
4 files changed, 64 insertions, 15 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml
index 778d7568..ee98a8db 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/ContextMenu.qml
@@ -6,22 +6,25 @@
//===========================================
import QtQuick 2.2
import QtQuick.Window 2.2
-import QtQuick.Controls 1
+import QtQuick.Controls 2
import Lumina.Backend.RootDesktopObject 2.0
+
+
Menu {
id: contextMenu
+
MenuItem {
text: "Launch Terminal"
- iconName: "utilities-terminal"
+ //iconName: "utilities-terminal"
onTriggered: {
RootObject.launchApp("application/terminal")
}
}
MenuItem {
text: "Launch File Browser"
- iconName: "user-home"
+ //iconName: "user-home"
onTriggered: {
RootObject.launchApp("inode/directory")
}
@@ -29,7 +32,7 @@ Menu {
MenuItem {
text: "Lock Screen"
- iconName: "system-lock-screen"
+ //iconName: "system-lock-screen"
onTriggered: {
RootObject.lockscreen()
}
@@ -37,7 +40,7 @@ Menu {
MenuItem {
text: "Logout"
- iconName: "system-log-out"
+ //iconName: "system-log-out"
onTriggered: {
RootObject.logout()
}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml
index ddb2a490..7310fd50 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/RootDesktop.qml
@@ -17,7 +17,7 @@
//===========================================
import QtQuick 2.2
import QtQuick.Window 2.2
-import QtQuick.Controls 1
+import QtQuick.Controls 2
import "." as QML
@@ -34,10 +34,10 @@ Rectangle {
anchors.fill: rootCanvas
acceptedButtons: Qt.RightButton
onClicked: {
- //contextMenu.x = mouseX
- //contextMenu.y = mouseY
- //contextMenu.open()
- contextMenu.popup()
+ contextMenu.x = mouseX
+ contextMenu.y = mouseY
+ contextMenu.open()
+ //contextMenu.popup()
}
onPositionChanged: {
RootObject.mousePositionChanged()
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 e1e7cd10..0bec74f2 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,6 +8,10 @@
//===========================================
import QtQuick 2.2
import QtQuick.Layouts 1.3
+import QtQuick.Controls 2
+
+import Lumina.Backend.RootDesktopObject 2.0
+import Lumina.Backend.NativeWindowObject 2.0
import "./status_tray" as QML
@@ -45,8 +49,41 @@ Rectangle {
Layout.preferredHeight: status_tray.prefsize
Layout.preferredWidth: status_tray.prefsize
}
- //System Tray Menu Popup
-
+ //System Tray Menu Button
+ ToolButton{
+ id: "trayButton"
+ text: "Tray"
+ //iconName: "view-more-vertical"
+ visible: RootObject.hasTrayWindows
+ onClicked: trayMenu.open()
+ Menu{
+ id: "trayMenu"
+ //MenuItem{ text: "sample" }
+ //MenuItem{ text: "sample2" }
+ //Rectangle{ color: "blue"; width: 50; height: 50 }
+ GridLayout{
+ columns: 4
+ Repeater{
+ model: RootObject.trayWindows
+ QML.TrayIcon{
+
+ winObj: RootObject.trayWindow(modelData)
+ parent: trayMenu
+ Layout.preferredWidth: 48
+ Layout.preferredHeight: 48
+ }
+ }
+ }
+ }
+ } //end of system tray menu button
+ /*Repeater{
+ model: RootObject.trayWindows
+ QML.TrayIcon{
+ winObj: RootObject.trayWindow(modelData)
+ Layout.preferredHeight: status_tray.prefsize
+ Layout.preferredWidth: status_tray.prefsize
+ }
+ }*/
} //end of layout
}
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 26c50907..6012ba5d 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,21 +5,30 @@
// See the LICENSE file for full details
//===========================================
import QtQuick 2.2
-import QtQuick.Controls 1
+import QtQuick.Controls 2
import Lumina.Backend.NativeWindowObject 2.0
Image{
property NativeWindowObject winObj
source: winObj.icon
+ id: "trayIcon"
+ fillMode: Qt.PreserveAspectFit
+ smooth: true
+ cache: false
+ asynchronous: false
+ //text: winObj.name
+
+ onXChanged: { }
MouseArea{
+ //property point globalPos
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);
+ console.log("Enter Tray Icon:", parent.mapToGlobal(0,0));
+ winObj.updateGeometry( parent.mapToGlobal(0,0).x, parent.mapToGlobal(0,0).y, parent.width(), parent.height(), true)
}
}
}
bgstack15