From cacdeba97a8e8c21a440066acdc476a9e1224255 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Thu, 2 Mar 2017 00:16:09 +0900
Subject: [PATCH] Fix layout

---
 app/qml/main.qml      |   2 +-
 app/qml/ui/Dialog.qml | 108 ++++++++++++++++++++++--------------------
 2 files changed, 57 insertions(+), 53 deletions(-)

diff --git a/app/qml/main.qml b/app/qml/main.qml
index 61013c7..1fd39f4 100644
--- a/app/qml/main.qml
+++ b/app/qml/main.qml
@@ -130,7 +130,7 @@ ApplicationWindow {
         property alias progressText: progressText.text
         content: ColumnLayout {
             anchors.fill: parent
-            spacing: 8
+            spacing: 4
             ProgressBar {
                 id: progressBar
                 minimumValue: 0
diff --git a/app/qml/ui/Dialog.qml b/app/qml/ui/Dialog.qml
index ef94e20..b5360fe 100644
--- a/app/qml/ui/Dialog.qml
+++ b/app/qml/ui/Dialog.qml
@@ -2,13 +2,13 @@ import QtQuick 2.0
 import QtQuick.Layouts 1.0
 import QtQuick.Controls 1.0
 
-RowLayout {
+ColumnLayout {
     id: dialog
 
     visible: false
     anchors.fill: parent
     anchors.margins: 12
-    spacing: 8
+    spacing: 12
 
     property alias icon: icon.source
     property alias primaryText: primaryText.text
@@ -26,66 +26,70 @@ RowLayout {
         dialog.visible = false;
     }
 
-    Image {
-        id: icon
-        source: ""
-        visible: source.toString() ? true : false
-        Layout.preferredWidth: 32
-        Layout.preferredHeight: 32
+    RowLayout {
+        Layout.fillWidth: true
+        spacing: 12
+        Image {
+            id: icon
+            source: ""
+            visible: source.toString() ? true : false
+            Layout.preferredWidth: 32
+            Layout.preferredHeight: 32
+        }
+        ColumnLayout {
+            Layout.fillWidth: true
+            spacing: 4
+            Label {
+                id: primaryText
+                text: ""
+                visible: text ? true : false
+                Layout.fillWidth: true
+                wrapMode: Text.WrapAnywhere
+                font.bold: true
+            }
+            Label {
+                id: informativeText
+                text: ""
+                visible: text ? true : false
+                Layout.fillWidth: true
+                wrapMode: Text.WrapAnywhere
+            }
+        }
     }
 
-    ColumnLayout {
+    Label {
+        id: detailedText
+        text: ""
+        visible: text ? true : false
         Layout.fillWidth: true
-        spacing: parent.spacing
-        Label {
-            id: primaryText
-            text: ""
-            visible: text ? true : false
+        wrapMode: Text.WrapAnywhere
+        color: "#444444"
+    }
+
+    Item {
+        id: content
+        Layout.fillWidth: true
+    }
+
+    Item {
+        Layout.fillHeight: true
+    }
+
+    RowLayout {
+        Layout.fillWidth: true
+        spacing: 4
+        Item {
             Layout.fillWidth: true
-            wrapMode: Text.WrapAnywhere
-            font.bold: true
         }
-        Label {
-            id: informativeText
+        Button {
+            id: acceptButton
             text: ""
             visible: text ? true : false
-            Layout.fillWidth: true
-            wrapMode: Text.WrapAnywhere
         }
-        Item {
-            Layout.fillHeight: true
-        }
-        Label {
-            id: detailedText
+        Button {
+            id: rejectButton
             text: ""
             visible: text ? true : false
-            Layout.fillWidth: true
-            wrapMode: Text.WrapAnywhere
-            color: "#444444"
-        }
-        Item {
-            id: content
-            Layout.fillWidth: true
-        }
-        Item {
-            Layout.fillHeight: true
-        }
-        RowLayout {
-            Layout.fillWidth: true
-            spacing: parent.spacing
-            Item {
-                Layout.fillWidth: true
-            }
-            Button {
-                id: acceptButton
-                text: ""
-                visible: text ? true : false
-            }
-            Button {
-                id: rejectButton
-                text: ""
-                visible: text ? true : false
-            }
         }
     }
 }
-- 
GitLab