1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-03-09 15:40:18 +00:00

QML: Completed Systrayicon menu

This commit is contained in:
Bumsik Kim 2018-05-12 11:46:20 -04:00
parent 4ba6598725
commit fc803cc1af
No known key found for this signature in database
GPG key ID: E31041C8EC5B01C6

View file

@ -419,6 +419,7 @@ ApplicationWindow {
} }
RowLayout { RowLayout {
id: autoSwitchLayout
anchors.top: vncButton.top anchors.top: vncButton.top
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: vncButton.height - 10 anchors.topMargin: vncButton.height - 10
@ -439,11 +440,10 @@ ApplicationWindow {
GroupBox { GroupBox {
title: "Available IP addresses" title: "Available IP addresses"
anchors.top: vncButton.top anchors.top: autoSwitchLayout.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: 70
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -452,9 +452,26 @@ ApplicationWindow {
id: ipListView id: ipListView
anchors.fill: parent anchors.fill: parent
// anchors.top: parent.top
// anchors.left: parent.left
// anchors.right: parent.right
// height: 100
ScrollBar.vertical: ScrollBar {
parent: ipListView.parent
anchors.top: ipListView.top
anchors.right: ipListView.right
anchors.bottom: ipListView.bottom
policy: ScrollBar.AlwaysOn
}
model: backend.ipAddresses model: backend.ipAddresses
delegate: Label { delegate: TextEdit {
text: modelData text: modelData
readOnly: true
selectByMouse: true
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: 12
} }
} }
} }
@ -465,7 +482,9 @@ ApplicationWindow {
// Sytray Icon // Sytray Icon
Labs.SystemTrayIcon { Labs.SystemTrayIcon {
id: sysTrayIcon id: sysTrayIcon
iconSource: "icon/icon.png" iconSource: backend.vncState == Backend.CONNECTED ? "icon/icon_tablet_on.png" :
backend.virtScreenCreated ? "icon/icon_tablet_off.png" :
"icon/icon.png"
visible: true visible: true
property bool clicked: false property bool clicked: false
@ -513,6 +532,31 @@ ApplicationWindow {
} }
menu: Labs.Menu { menu: Labs.Menu {
Labs.MenuItem {
enabled: false
text: vncStateLabel.text
}
Labs.MenuItem {
separator: true
}
Labs.MenuItem {
text: virtScreenButton.text
enabled: virtScreenButton.enabled
onTriggered: virtScreenButton.onClicked()
}
Labs.MenuItem {
text: vncButton.text
enabled: vncButton.enabled
onTriggered: vncButton.onClicked()
}
Labs.MenuItem {
separator: true
}
Labs.MenuItem { Labs.MenuItem {
text: qsTr("&Quit") text: qsTr("&Quit")
onTriggered: { onTriggered: {