[Pkg-privacy-commits] [tails-installer] 02/21: Add an architecture choice popover

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:27:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to tag 3.93.0
in repository tails-installer.

commit ed4b64f63bf4204368bee0fe528678022bf9c61d
Author: Martin Briza <mbriza at redhat.com>
Date:   Thu Apr 14 14:48:32 2016 +0200

    Add an architecture choice popover
---
 liveusb/components/ImageDetails.qml | 75 +++++++++++++++++++++++++------------
 liveusb/components/PopOver.qml      | 75 +++++++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+), 23 deletions(-)

diff --git a/liveusb/components/ImageDetails.qml b/liveusb/components/ImageDetails.qml
index 31a2716..da7890f 100644
--- a/liveusb/components/ImageDetails.qml
+++ b/liveusb/components/ImageDetails.qml
@@ -76,6 +76,7 @@ Item {
                 width: parent.width
                 spacing: $(24)
                 RowLayout {
+                    z: 1 // so the popover stays over the text below
                     anchors.left: parent.left
                     anchors.right: parent.right
                     spacing: $(24)
@@ -92,7 +93,7 @@ Item {
                     }
                     ColumnLayout {
                         Layout.fillHeight: true
-                        spacing: $(12)
+                        spacing: $(6)
                         RowLayout {
                             Layout.fillWidth: true
                             Text {
@@ -115,37 +116,65 @@ Item {
                             }
                         }
                         Item {
+                            Layout.fillWidth: true
                             height: childrenRect.height
 
                             ColumnLayout {
-                                spacing: $(12)
+                                width: parent.width
+                                spacing: $(6)
+                                Text {
+                                    font.pixelSize: $(13)
+                                    color: "gray"
+                                    text: liveUSBData.releaseProxyModel.archFilter
+                                }
+                                Text {
+                                    font.pixelSize: $(11)
+                                    color: "gray"
+                                    text: liveUSBData.releaseProxyModel.archFilterDetailed
+                                }
                                 RowLayout {
-                                    visible: liveUSBData.currentImage.arch.length
-                                    spacing: $(12)
-                                    ExclusiveGroup {
-                                        id: archEG
+                                    width: parent.width
+                                    Text {
+                                        // I'm sorry, everyone, I can't find a better way to determine if the date is valid
+                                        text: liveUSBData.currentImage.version ? (qsTranslate("", "Version %1").arg(liveUSBData.currentImage.version) +
+                                            (liveUSBData.currentImage.releaseDate.toLocaleDateString().length > 0 ? (qsTranslate("", ", released on %1").arg(liveUSBData.currentImage.releaseDate.toLocaleDateString())) : "")) : ""
+                                        font.pixelSize: $(11)
+                                        color: "gray"
                                     }
-                                    Repeater {
-                                        model: liveUSBData.currentImage.arch
-                                        AdwaitaRadioButton {
-                                            text: modelData
-                                            Layout.alignment: Qt.AlignVCenter
-                                            exclusiveGroup: archEG
-                                            checked: liveUSBData.releaseProxyModel.archFilter == modelData
-                                            onCheckedChanged: {
-                                                if (checked && liveUSBData.releaseProxyModel.archFilter != modelData)
-                                                    liveUSBData.releaseProxyModel.archFilter = modelData
+                                    Item {
+                                        Layout.fillWidth: true
+                                    }
+                                    Text {
+                                        Layout.alignment: Qt.AlignRight
+                                        visible: liveUSBData.currentImage.arch.length
+                                        text: "Other architectures..."
+                                        font.pixelSize: $(11)
+                                        color: mouse.containsPress ? "#284875" : mouse.containsMouse ? "#447BC7" : "#315FA0"
+                                        Behavior on color { ColorAnimation { duration: 100 } }
+                                        MouseArea {
+                                            id: mouse
+                                            anchors.fill: parent
+                                            hoverEnabled: true
+                                            onClicked: popover.open = !popover.open
+                                        }
+
+                                        Rectangle {
+                                            anchors {
+                                                left: parent.left
+                                                right: parent.right
+                                                top: parent.bottom
+                                                topMargin: $(1.5)
                                             }
+                                            radius: height / 2
+                                            color: parent.color
+                                            height: $(1.2)
+                                        }
+
+                                        PopOver {
+                                            id: popover
                                         }
                                     }
                                 }
-                                Text {
-                                    // I'm sorry, everyone, I can't find a better way to determine if the date is valid
-                                    text: liveUSBData.currentImage.version ? (qsTranslate("", "Version %1").arg(liveUSBData.currentImage.version) +
-                                        (liveUSBData.currentImage.releaseDate.toLocaleDateString().length > 0 ? (qsTranslate("", ", released on %1").arg(liveUSBData.currentImage.releaseDate.toLocaleDateString())) : "")) : ""
-                                    font.pixelSize: $(11)
-                                    color: "gray"
-                                }
                             }
 
                             RowLayout {
diff --git a/liveusb/components/PopOver.qml b/liveusb/components/PopOver.qml
new file mode 100644
index 0000000..58d87a6
--- /dev/null
+++ b/liveusb/components/PopOver.qml
@@ -0,0 +1,75 @@
+import QtQuick 2.4
+import QtQuick.Controls 1.3
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Layouts 1.1
+
+Item {
+    id: popover
+    z: -1
+    property bool open: false
+    anchors {
+        right: parent.right
+        top: parent.bottom
+        topMargin: $(8) + opacity * $(24)
+    }
+    visible: opacity > 0.0
+    opacity: open ? 1.0 : 0.0
+    Behavior on opacity { NumberAnimation { duration: 150 } }
+
+    height: popoverLayout.height + $(12)
+    width: popoverLayout.width + $(12)
+
+    Rectangle {
+        anchors.fill: popoverLayout
+        anchors.margins: - $(12)
+        color: palette.window
+        antialiasing: true
+        border {
+            width: 1
+            color: "black"
+        }
+        radius: $(6)
+        Rectangle {
+            z: -1
+            y: -$(6.5) - 1
+            antialiasing: true
+            border.color: "black"
+            border.width: 1
+            color: palette.window
+            anchors.horizontalCenter: parent.horizontalCenter
+            width: $(14)
+            height: $(14)
+            rotation: 45
+        }
+        Rectangle {
+            color: palette.window
+            y: -$(6.5) + 1
+            anchors.horizontalCenter: parent.horizontalCenter
+            width: $(14)
+            height: $(14)
+            rotation: 45
+        }
+    }
+
+    ColumnLayout {
+        id: popoverLayout
+        spacing: $(9)
+        ExclusiveGroup {
+            id: archEG
+        }
+        // TODO move the content outside
+        Repeater {
+            model: liveUSBData.currentImage.arch
+            AdwaitaRadioButton {
+                text: modelData
+                Layout.alignment: Qt.AlignVCenter
+                exclusiveGroup: archEG
+                checked: liveUSBData.releaseProxyModel.archFilter == modelData
+                onCheckedChanged: {
+                    if (checked && liveUSBData.releaseProxyModel.archFilter != modelData)
+                        liveUSBData.releaseProxyModel.archFilter = modelData
+                }
+            }
+        }
+    }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list