[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kube/develop] components/package/contents/ui: display attchments as flow
From:       Michael Bohlender <michael.bohlender () kdemail ! net>
Date:       2016-12-07 21:25:47
Message-ID: E1cEjil-0005D2-4c () code ! kde ! org
[Download RAW message or body]

Git commit f3fe0d6d2c52604bf0dc077676f84f5bc87e600b by Michael Bohlender.
Committed on 07/12/2016 at 21:25.
Pushed by mbohlender into branch 'develop'.

display attchments as flow

M  +3    -2    components/package/contents/ui/AttachmentDelegate.qml
M  +3    -44   components/package/contents/ui/MailViewer.qml
M  +29   -1    components/package/contents/ui/SingleMailView.qml

https://commits.kde.org/kube/f3fe0d6d2c52604bf0dc077676f84f5bc87e600b

diff --git a/components/package/contents/ui/AttachmentDelegate.qml \
b/components/package/contents/ui/AttachmentDelegate.qml index 91e07d4..ffacb46 100644
--- a/components/package/contents/ui/AttachmentDelegate.qml
+++ b/components/package/contents/ui/AttachmentDelegate.qml
@@ -21,6 +21,7 @@ import QtQuick.Layouts 1.1
 import org.kde.kirigami 1.0 as Kirigami
 
 Item {
+    id: root
 
     property string name
     property string icon
@@ -54,12 +55,12 @@ Item {
                 height: parent.height
                 width: height
 
-                source: "text-csv"
+                source: root.icon
             }
         }
 
         Text {
-            text: "some attachment.csv"
+            text: root.name
             color: Kirigami.Theme.textColor
         }
     }
diff --git a/components/package/contents/ui/MailViewer.qml \
b/components/package/contents/ui/MailViewer.qml index 28414ca..f5e10c8 100644
--- a/components/package/contents/ui/MailViewer.qml
+++ b/components/package/contents/ui/MailViewer.qml
@@ -27,7 +27,8 @@ Item {
     id: root
     property variant message;
     property string html;
-    property int desiredHeight: topPartLoader.height + newMailViewer.height + \
attachments.height + 20 +    property int desiredHeight: topPartLoader.height + \
newMailViewer.height + 20 +    property variant attachments
 
     clip: true
 
@@ -57,48 +58,6 @@ Item {
     //END old mail viewer
 
     Controls1.TreeView {
-        id: attachments
-        anchors {
-            top: newMailViewer.bottom
-            topMargin: 20
-        }
-        //visible: messageParser.attachments.rowCount() > 0
-        width: parent.width
-        height: 200
-        Controls1.TableViewColumn {
-            role: "name"
-            title: "Filename"
-            width: 300
-        }
-        Controls1.TableViewColumn {
-            role: "type"
-            title: "Type"
-            width: 60
-        }
-        Controls1.TableViewColumn {
-            role: "icon"
-            title: "Icon"
-            width: 60
-        }
-        Controls1.TableViewColumn {
-            role: "size"
-            title: "Size"
-            width: 60
-        }
-        Controls1.TableViewColumn {
-            role: "encrypted"
-            title: "Encrypted"
-            width: 60
-        }
-        Controls1.TableViewColumn {
-            role: "signed"
-            title: "Signed"
-            width: 60
-        }
-        model: messageParser.attachments
-    }
-
-    Controls1.TreeView {
         id: mailStructure
         anchors.top: messageParser.attachments.rowCount() > 0 ? attachments.bottom : \
newMailViewer.bottom  visible: newMailViewer.debug
@@ -131,6 +90,6 @@ Item {
         id: messageParser
         message: root.message
     }
+    attachments: messageParser.attachments
     html: messageParser.html
-
 }
diff --git a/components/package/contents/ui/SingleMailView.qml \
b/components/package/contents/ui/SingleMailView.qml index 76f0ef2..732bec3 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -72,7 +72,6 @@ Rectangle {
         }
 
         Rectangle {
-
             anchors.bottom: parent.bottom
 
             height: 1
@@ -124,6 +123,8 @@ Rectangle {
                     implicitHeight: header.height + body.height + \
(Kirigami.Units.gridUnit * 2.5) * 2 + footer.height  width: parent.width - \
Kirigami.Units.gridUnit * 4  
+                    color: Kirigami.Theme.viewBackgroundColor
+
                     //TODO bookmark
                     /*
                     ToolButton {
@@ -255,6 +256,33 @@ Rectangle {
                     }
                     //END header
 
+                    Flow {
+                        id: attachments
+
+                        anchors {
+                            top: header.bottom
+                            topMargin: Kirigami.Units.smallSpacing
+                            horizontalCenter: parent.horizontalCenter
+                        }
+
+                        width: parent.width - Kirigami.Units.gridUnit * 2
+                        height: Kirigami.Units.gridUnit * 2
+
+                        layoutDirection: Qt.RightToLeft
+                        spacing: Kirigami.Units.smallSpacing
+
+                        Repeater {
+                            model: body.attachments
+
+                            delegate: AttachmentDelegate {
+                                name: model.name
+                                icon: "mail-attachment"
+
+                                //TODO size encrypted signed type
+                            }
+                        }
+                    }
+
                     MailViewer {
                         id: body
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic