From 5fabf6a77320236833f39bcdda05d7902b97630e Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Mon, 25 Jun 2018 04:06:53 -0400 Subject: [PATCH] Fixed layout bug in QML --- package/appimage/.gitignore | 2 ++ virtscreen/assets/AppWindow.qml | 13 ++++++----- virtscreen/assets/VncPage.qml | 40 +++++++++++++++------------------ 3 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 package/appimage/.gitignore diff --git a/package/appimage/.gitignore b/package/appimage/.gitignore new file mode 100644 index 0000000..a874d89 --- /dev/null +++ b/package/appimage/.gitignore @@ -0,0 +1,2 @@ +VirtScreen-x86_64.AppImage +virtscreen.AppDir diff --git a/virtscreen/assets/AppWindow.qml b/virtscreen/assets/AppWindow.qml index 992eb8c..adbad9f 100644 --- a/virtscreen/assets/AppWindow.qml +++ b/virtscreen/assets/AppWindow.qml @@ -64,7 +64,7 @@ ApplicationWindow { ToolButton { id: menuButton - anchors.right: parent.right + Layout.alignment: Qt.AlignRight text: qsTr("⋮") contentItem: Text { text: parent.text @@ -154,13 +154,13 @@ ApplicationWindow { ColumnLayout { anchors.fill: parent Text { - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter font { weight: Font.Bold; pixelSize: 20 } text: "VirtScreen" + " v" + settings.version } Text { - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter font { pixelSize: 13 } text: "Make your iPad/tablet/computer
as a secondary monitor.
" @@ -177,7 +177,7 @@ ApplicationWindow { } Text { font { pixelSize: 14 } - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter lineHeight: 0.7 text: "
Copyright © 2018 Bumsik Kim Homepage
" @@ -185,7 +185,7 @@ ApplicationWindow { } Text { font { pixelSize: 11 } - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter text: "This program comes with absolutely no warranty.
" + "See the " + @@ -240,7 +240,8 @@ ApplicationWindow { ColumnLayout { anchors.fill: parent ScrollView { - anchors.fill: parent + Layout.fillHeight: true + Layout.fillWidth: true TextArea { // readOnly: true selectByMouse: true diff --git a/virtscreen/assets/VncPage.qml b/virtscreen/assets/VncPage.qml index 19f1627..ea66ed8 100644 --- a/virtscreen/assets/VncPage.qml +++ b/virtscreen/assets/VncPage.qml @@ -33,8 +33,6 @@ ColumnLayout { } } RowLayout { - anchors.left: parent.left - anchors.right: parent.right Label { text: "Password"; Layout.fillWidth: true } Button { text: "Delete" @@ -90,28 +88,26 @@ ColumnLayout { GroupBox { title: "Available IP addresses" Layout.fillWidth: true + Layout.fillHeight: true implicitHeight: 145 - ColumnLayout { + ListView { + id: ipListView anchors.fill: parent - ListView { - id: ipListView - anchors.fill: parent - clip: true - ScrollBar.vertical: ScrollBar { - parent: ipListView.parent - anchors.top: ipListView.top - anchors.right: ipListView.right - anchors.bottom: ipListView.bottom - policy: ScrollBar.AlwaysOn - } - model: network.ipAddresses - delegate: TextEdit { - text: modelData - readOnly: true - selectByMouse: true - anchors.horizontalCenter: parent.horizontalCenter - font.pixelSize: 14 - } + clip: true + ScrollBar.vertical: ScrollBar { + parent: ipListView.parent + anchors.top: ipListView.top + anchors.right: ipListView.right + anchors.bottom: ipListView.bottom + policy: ScrollBar.AlwaysOn + } + model: network.ipAddresses + delegate: TextEdit { + text: modelData + readOnly: true + selectByMouse: true + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 14 } } }