From 080b6b4cdc5c80a12114c90c90dd2970e291f3fe Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Fri, 3 Mar 2017 00:22:20 +0900
Subject: [PATCH] Add toggle action for detailed content

---
 app/qml/ui/Dialog.qml | 46 +++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 15 deletions(-)

diff --git a/app/qml/ui/Dialog.qml b/app/qml/ui/Dialog.qml
index a89e464..d3aebe1 100644
--- a/app/qml/ui/Dialog.qml
+++ b/app/qml/ui/Dialog.qml
@@ -13,8 +13,12 @@ ColumnLayout {
     property alias icon: icon.source
     property alias primaryText: primaryText.text
     property alias informativeText: informativeText.text
+
+    property alias detailsVisible: details.visible
     property alias detailedText: detailedText.text
-    property alias content: content.children
+    property alias detailedContent: detailedContent.children
+
+    property alias actionButton: actionButton
     property alias acceptButton: acceptButton
     property alias rejectButton: rejectButton
 
@@ -26,6 +30,10 @@ ColumnLayout {
         dialog.visible = false;
     }
 
+    function toggleDetails() {
+        details.visible = details.visible ? false : true;
+    }
+
     RowLayout {
         Layout.fillWidth: true
         spacing: 12
@@ -48,6 +56,7 @@ ColumnLayout {
                 Layout.fillWidth: true
                 wrapMode: Text.WrapAnywhere
                 font.bold: true
+                font.pixelSize: 14
             }
             Label {
                 id: informativeText
@@ -59,27 +68,34 @@ ColumnLayout {
         }
     }
 
-    Label {
-        id: detailedText
-        text: ""
-        visible: text ? true : false
+    ColumnLayout {
+        id: details
+        visible: false
         Layout.fillWidth: true
-        wrapMode: Text.WrapAnywhere
-        color: "#444444"
-    }
-
-    Item {
-        id: content
-        Layout.fillWidth: true
-    }
-
-    Item {
         Layout.fillHeight: true
+        spacing: 12
+        Label {
+            id: detailedText
+            text: ""
+            visible: text ? true : false
+            Layout.fillWidth: true
+            wrapMode: Text.WrapAnywhere
+        }
+        Item {
+            id: detailedContent
+            visible: children ? true : false
+            Layout.fillWidth: true
+        }
     }
 
     RowLayout {
         Layout.fillWidth: true
         spacing: 4
+        Button {
+            id: actionButton
+            text: ""
+            visible: text ? true : false
+        }
         Item {
             Layout.fillWidth: true
         }
-- 
GitLab