1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-02-12 19:31:50 +00:00

QML: Switched to use layout instead of anchors

This commit is contained in:
Bumsik Kim 2018-05-14 15:45:39 -04:00
parent ce1debd8ad
commit 67b0e43c89
No known key found for this signature in database
GPG key ID: E31041C8EC5B01C6

View file

@ -18,8 +18,8 @@ ApplicationWindow {
// Material.background: Material.Grey
width: 380
height: 525
property int margin: 8
height: 540
property int margin: 10
property int popupWidth: width - 26
// hide screen when loosing focus
@ -113,7 +113,6 @@ ApplicationWindow {
y: parent.height / 2 - height
BusyIndicator {
anchors.fill: parent
Material.accent: Material.Cyan
running: true
}
background: Rectangle {
@ -204,20 +203,20 @@ ApplicationWindow {
onRejected: passwordFIeld.text = ""
}
StackLayout {
width: parent.width
SwipeView {
anchors.top: tabBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: margin
clip: true
currentIndex: tabBar.currentIndex
ColumnLayout {
anchors.fill: parent
anchors.margins: margin
GroupBox {
title: "Virtual Display"
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
enabled: backend.virtScreenCreated ? false : true
ColumnLayout {
anchors.left: parent.left
@ -294,14 +293,14 @@ ApplicationWindow {
}
}
}
ColumnLayout {
Layout.margins: margin / 2
Button {
id: virtScreenButton
Layout.fillWidth: true
text: virtScreenAction.text
highlighted: true
anchors.left: parent.left
anchors.right: parent.right
// Material.accent: Material.Teal
// Material.theme: Material.Dark
enabled: virtScreenAction.enabled
onClicked: {
busyDialog.open();
@ -313,11 +312,8 @@ ApplicationWindow {
}
Button {
id: displaySettingButton
Layout.fillWidth: true
text: "Open Display Setting"
anchors.left: parent.left
anchors.right: parent.right
// Material.accent: Material.Teal
// Material.theme: Material.Dark
enabled: backend.virtScreenCreated ? true : false
onClicked: {
busyDialog.open();
@ -346,13 +342,16 @@ ApplicationWindow {
}
}
RowLayout {
// Empty layout
Layout.fillHeight: true
}
}
ColumnLayout {
anchors.fill: parent
anchors.margins: margin
GroupBox {
title: "VNC Server"
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
enabled: backend.vncState == Backend.OFF ? true : false
ColumnLayout {
anchors.left: parent.left
@ -392,25 +391,19 @@ ApplicationWindow {
}
}
}
RowLayout {
Layout.fillWidth: true
Layout.margins: margin / 2
Button {
id: vncButton
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: 0
highlighted: true
Layout.fillWidth: true
text: vncAction.text
highlighted: true
enabled: vncAction.enabled
// Material.background: Material.Teal
// Material.foreground: Material.Grey
onClicked: vncAction.onTriggered()
}
RowLayout {
id: autoSwitchLayout
anchors.top: vncButton.top
anchors.right: parent.right
anchors.topMargin: vncButton.height - 10
Label { text: "Auto start"; }
Switch {
CheckBox {
checked: autostart
onToggled: {
autostart = checked;
@ -420,22 +413,19 @@ ApplicationWindow {
}
}
}
Label { text: "Auto"; }
}
GroupBox {
title: "Available IP addresses"
anchors.top: autoSwitchLayout.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
implicitHeight: 150
ColumnLayout {
anchors.fill: parent
ListView {
id: ipListView
anchors.fill: parent
// anchors.top: parent.top
// anchors.left: parent.left
// anchors.right: parent.right
// height: 100
clip: true
ScrollBar.vertical: ScrollBar {
parent: ipListView.parent
anchors.top: ipListView.top
@ -454,6 +444,11 @@ ApplicationWindow {
}
}
}
RowLayout {
// Empty layout
Layout.fillHeight: true
}
}
}
}