mirror of
https://github.com/kbumsik/VirtScreen.git
synced 2025-03-09 15:40:18 +00:00
QML: Moved popup
This commit is contained in:
parent
abba868446
commit
ca6ec24d49
1 changed files with 77 additions and 44 deletions
119
main.qml
119
main.qml
|
|
@ -17,11 +17,13 @@ ApplicationWindow {
|
||||||
title: "Basic layouts"
|
title: "Basic layouts"
|
||||||
|
|
||||||
Material.theme: Material.Light
|
Material.theme: Material.Light
|
||||||
|
Material.primary: Material.Teal
|
||||||
Material.accent: Material.Teal
|
Material.accent: Material.Teal
|
||||||
|
// Material.background: Material.Grey
|
||||||
|
|
||||||
property int margin: 11
|
property int margin: 11
|
||||||
width: 380
|
width: 380
|
||||||
height: 500
|
height: 550
|
||||||
|
|
||||||
// hide screen when loosing focus
|
// hide screen when loosing focus
|
||||||
onActiveFocusItemChanged: {
|
onActiveFocusItemChanged: {
|
||||||
|
|
@ -64,10 +66,14 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// menuBar: MenuBar {
|
||||||
|
// }
|
||||||
|
|
||||||
header: TabBar {
|
header: TabBar {
|
||||||
id: tabBar
|
id: tabBar
|
||||||
position: TabBar.Header
|
position: TabBar.Footer
|
||||||
width: parent.width
|
// Material.primary: Material.Teal
|
||||||
|
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
|
|
@ -79,12 +85,72 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuBar: ToolBar {
|
||||||
|
id: toolbar
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.pointSize: 11 //parent.font.pointSize + 1
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.leftMargin: margin + 10
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: vncStateLabel
|
||||||
|
text: !backend.virtScreenCreated ? "Enable Virtual Screen first." :
|
||||||
|
backend.vncState == Backend.OFF ? "Turn on VNC Server in the VNC tab." :
|
||||||
|
backend.vncState == Backend.WAITING ? "VNC Server is waiting for a client..." :
|
||||||
|
backend.vncState == Backend.CONNECTED ? "Connected." :
|
||||||
|
"Server state error!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// footer: ToolBar {
|
||||||
|
// font.weight: Font.Medium
|
||||||
|
// font.pointSize: 11 //parent.font.pointSize + 1
|
||||||
|
// anchors { horizontalCenter: parent.horizontalCenter }
|
||||||
|
// width: 200
|
||||||
|
// }
|
||||||
|
|
||||||
|
Popup {
|
||||||
|
id: busyDialog
|
||||||
|
modal: true
|
||||||
|
closePolicy: Popup.NoAutoClose
|
||||||
|
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
y: (parent.height - height) / 2
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
Material.accent: Material.Cyan
|
||||||
|
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
y: (parent.height - height) / 2
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: "transparent"
|
||||||
|
implicitWidth: 100
|
||||||
|
implicitHeight: 100
|
||||||
|
// border.color: "#444"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StackLayout {
|
StackLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
currentIndex: tabBar.currentIndex
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: margin
|
anchors.margins: margin
|
||||||
|
|
@ -185,29 +251,16 @@ ApplicationWindow {
|
||||||
Button {
|
Button {
|
||||||
id: virtScreenButton
|
id: virtScreenButton
|
||||||
text: backend.virtScreenCreated ? "Disable Virtual Screen" : "Enable Virtual Screen"
|
text: backend.virtScreenCreated ? "Disable Virtual Screen" : "Enable Virtual Screen"
|
||||||
|
highlighted: true
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
// Material.background: Material.Teal
|
// Material.accent: Material.Teal
|
||||||
// Material.foreground: Material.Grey
|
// Material.theme: Material.Dark
|
||||||
|
|
||||||
enabled: window.vncAutoStart ? true :
|
enabled: window.vncAutoStart ? true :
|
||||||
backend.vncState == Backend.OFF ? true : false
|
backend.vncState == Backend.OFF ? true : false
|
||||||
|
|
||||||
Popup {
|
|
||||||
id: busyDialog
|
|
||||||
modal: true
|
|
||||||
closePolicy: Popup.NoAutoClose
|
|
||||||
|
|
||||||
x: (parent.width - width) / 2
|
|
||||||
y: (parent.height - height) / 2
|
|
||||||
|
|
||||||
BusyIndicator {
|
|
||||||
x: (parent.width - width) / 2
|
|
||||||
y: (parent.height - height) / 2
|
|
||||||
running: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
busyDialog.open();
|
busyDialog.open();
|
||||||
// Give a very short delay to show busyDialog.
|
// Give a very short delay to show busyDialog.
|
||||||
|
|
@ -246,6 +299,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: margin
|
anchors.margins: margin
|
||||||
|
|
@ -302,6 +356,7 @@ ApplicationWindow {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottomMargin: 0
|
anchors.bottomMargin: 0
|
||||||
|
highlighted: true
|
||||||
|
|
||||||
text: window.vncAutoStart ? "Auto start enabled" :
|
text: window.vncAutoStart ? "Auto start enabled" :
|
||||||
backend.vncState == Backend.OFF ? "Start VNC Server" : "Stop VNC Server"
|
backend.vncState == Backend.OFF ? "Start VNC Server" : "Stop VNC Server"
|
||||||
|
|
@ -331,7 +386,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
// width: 180;
|
id: ipListView
|
||||||
height: 200
|
height: 200
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
@ -344,28 +399,6 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: ToolBar {
|
|
||||||
font.weight: Font.Medium
|
|
||||||
font.pointSize: 11 //parent.font.pointSize + 1
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.leftMargin: margin + 10
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: vncStateLabel
|
|
||||||
text: !backend.virtScreenCreated ? "Enable Virtual Screen first." :
|
|
||||||
backend.vncState == Backend.OFF ? "Turn on VNC Server in the VNC tab." :
|
|
||||||
backend.vncState == Backend.WAITING ? "VNC Server is waiting for a client..." :
|
|
||||||
backend.vncState == Backend.CONNECTED ? "Connected." :
|
|
||||||
"Server state error!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sytray Icon
|
// Sytray Icon
|
||||||
Labs.SystemTrayIcon {
|
Labs.SystemTrayIcon {
|
||||||
id: sysTrayIcon
|
id: sysTrayIcon
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue