[Pkg-privacy-commits] [tails-installer] 07/210: QML: visual improvement, logic separation

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


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

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

commit 73c78fbd35f6a1f1d041f2d865a42b7e0cfcd789
Author: Martin Briza <mbriza at redhat.com>
Date:   Tue Jan 27 18:54:23 2015 +0100

    QML: visual improvement, logic separation
---
 liveusb/components/BackButton.qml     |  28 +++++++++
 liveusb/components/DownloadDialog.qml |   1 +
 liveusb/components/ImageDetails.qml   |   8 ++-
 liveusb/components/ImageList.qml      |   8 ++-
 liveusb/components/IndicatedImage.qml |  11 ++++
 liveusb/components/MenuButton.qml     |  22 +++++++
 liveusb/components/QuitButton.qml     |  24 +++++++
 liveusb/liveusb.qml                   | 115 +++++++++++-----------------------
 8 files changed, 134 insertions(+), 83 deletions(-)

diff --git a/liveusb/components/BackButton.qml b/liveusb/components/BackButton.qml
new file mode 100644
index 0000000..b894803
--- /dev/null
+++ b/liveusb/components/BackButton.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+
+Button {
+    Item {
+        anchors.centerIn: parent
+        rotation: -45
+        transformOrigin: Item.Center
+        width: 10
+        height: 10
+        Rectangle {
+            x: 1.5
+            y: 1.5
+            width: 2
+            height: 9
+            radius: 2
+            color: "#444444"
+        }
+        Rectangle {
+            y: 1.5
+            x: 1.5
+            width: 9
+            height: 2
+            radius: 2
+            color: "#444444"
+        }
+    }
+}
diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index 9c8eed8..16351a1 100644
--- a/liveusb/components/DownloadDialog.qml
+++ b/liveusb/components/DownloadDialog.qml
@@ -90,6 +90,7 @@ Dialog {
 
                 }
                 ComboBox {
+                    Layout.preferredWidth: implicitWidth * 2
                     model: ListModel {
                         ListElement { text: "SanDisk Cruzer 2.0 GB Drive"; device:"sdj1" }
                     }
diff --git a/liveusb/components/ImageDetails.qml b/liveusb/components/ImageDetails.qml
index 640997f..1bf8660 100644
--- a/liveusb/components/ImageDetails.qml
+++ b/liveusb/components/ImageDetails.qml
@@ -25,7 +25,7 @@ Item {
                     anchors.right: parent.right
                     spacing: 32
                     Layout.alignment: Qt.AlignLeft
-                    Image {
+                    IndicatedImage {
                         id: iconRect
                         source: "http://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg"
                         sourceSize.width: 64
@@ -87,12 +87,11 @@ Item {
                         text: "Boot with Boxes"
                     }
                 }
-                Image {
+                IndicatedImage {
                     Layout.fillWidth: true
                     fillMode: Image.PreserveAspectFit
                     source: "http://fedora.cz/wp-content/uploads/2013/12/fedora-20-gnome-10.png"
                     sourceSize.width: width
-                    //height: width / sourceSize.width * sourceSize.height / 5
                 }
             }
         }
@@ -100,5 +99,8 @@ Item {
     DownloadDialog {
         id: dialog
     }
+    Component.onCompleted: {
+        loaderIndicator.visible = false
+    }
 }
 
diff --git a/liveusb/components/ImageList.qml b/liveusb/components/ImageList.qml
index 14a3e36..a53b3f4 100644
--- a/liveusb/components/ImageList.qml
+++ b/liveusb/components/ImageList.qml
@@ -26,13 +26,17 @@ Rectangle {
         clip: true
         anchors.fill: parent
         model: osList
-        delegate: Rectangle {
+        delegate: imageDelegate
+    }
+    Component {
+        id: imageDelegate
+        Rectangle {
             width: parent.width - 2
             height: 84
             x: 1
             y: 1
             color: "transparent"
-            Image {
+            IndicatedImage {
                 id: iconRect
                 anchors {
                     top: parent.top
diff --git a/liveusb/components/IndicatedImage.qml b/liveusb/components/IndicatedImage.qml
new file mode 100644
index 0000000..e742eae
--- /dev/null
+++ b/liveusb/components/IndicatedImage.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+
+Image {
+    id: root
+    BusyIndicator {
+        anchors.centerIn: parent
+        visible: parent.status != Image.Ready
+    }
+}
+
diff --git a/liveusb/components/MenuButton.qml b/liveusb/components/MenuButton.qml
new file mode 100644
index 0000000..16d45f3
--- /dev/null
+++ b/liveusb/components/MenuButton.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+
+Button {
+    Item {
+        anchors.centerIn: parent
+        width: 10
+        height: 10
+        Column {
+            spacing: 2
+            Repeater {
+                model: 3
+                delegate: Rectangle {
+                    height: 2
+                    width: 10
+                    radius: 2
+                    color: "#444444"
+                }
+            }
+        }
+    }
+}
diff --git a/liveusb/components/QuitButton.qml b/liveusb/components/QuitButton.qml
new file mode 100644
index 0000000..750ef62
--- /dev/null
+++ b/liveusb/components/QuitButton.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+
+Button {
+    Item {
+        anchors.fill: parent
+        rotation: 45
+        transformOrigin: Item.Center
+        Rectangle {
+            width: 2
+            height: 12
+            radius: 1
+            anchors.centerIn: parent
+            color: "#a1a1a1"
+        }
+        Rectangle {
+            width: 12
+            height: 2
+            radius: 1
+            anchors.centerIn: parent
+            color: "#a1a1a1"
+        }
+    }
+}
diff --git a/liveusb/liveusb.qml b/liveusb/liveusb.qml
index b4deea7..7915698 100644
--- a/liveusb/liveusb.qml
+++ b/liveusb/liveusb.qml
@@ -62,7 +62,7 @@ ApplicationWindow {
             left: parent.left
         }
 
-        Button {
+        BackButton {
             id: backButton
             visible: canGoBack
             width: height
@@ -72,32 +72,9 @@ ApplicationWindow {
                 bottom: parent.bottom
                 margins: 6
             }
-            Item {
-                anchors.centerIn: parent
-                rotation: -45
-                transformOrigin: Item.Center
-                width: 10
-                height: 10
-                Rectangle {
-                    x: 1.5
-                    y: 1.5
-                    width: 2
-                    height: 9
-                    radius: 2
-                    color: "#444444"
-                }
-                Rectangle {
-                    y: 1.5
-                    x: 1.5
-                    width: 9
-                    height: 2
-                    radius: 2
-                    color: "#444444"
-                }
-            }
             onClicked: {
                 canGoBack = false
-                contentLoader.source = "components/ImageList.qml"
+                contentList.currentIndex--
             }
         }
 
@@ -108,7 +85,7 @@ ApplicationWindow {
 
         ComboBox {
             anchors {
-                right: searchButton.left
+                right: menuButton.left
                 top: parent.top
                 bottom: parent.bottom
                 margins: 6
@@ -117,8 +94,8 @@ ApplicationWindow {
             model: ["64bit (detected)", "32bit"]
         }
 
-        Button {
-            id: searchButton
+        MenuButton {
+            id: menuButton
             width: height
             anchors {
                 right: spacer.left
@@ -126,23 +103,6 @@ ApplicationWindow {
                 bottom: parent.bottom
                 margins: 6
             }
-            Item {
-                anchors.centerIn: parent
-                width: 10
-                height: 10
-                Column {
-                    spacing: 2
-                    Repeater {
-                        model: 3
-                        delegate: Rectangle {
-                            height: 2
-                            width: 10
-                            radius: 2
-                            color: "#444444"
-                        }
-                    }
-                }
-            }
         }
 
         Rectangle {
@@ -157,7 +117,7 @@ ApplicationWindow {
             }
         }
 
-        Button {
+        QuitButton {
             id: quitButton
             //flat: true
             anchors {
@@ -167,45 +127,44 @@ ApplicationWindow {
                 margins: 6
             }
             width: height
-            Item {
-                anchors.fill: parent
-                rotation: 45
-                transformOrigin: Item.Center
-                Rectangle {
-                    width: 2
-                    height: 12
-                    radius: 1
-                    anchors.centerIn: parent
-                    color: "#a1a1a1"
-                }
-                Rectangle {
-                    width: 12
-                    height: 2
-                    radius: 1
-                    anchors.centerIn: parent
-                    color: "#a1a1a1"
-                }
-            }
             onClicked: mainWindow.close()
         }
 
     }
 
-    Loader {
-        id: contentLoader
-        anchors {
-            fill: parent
+    ListView {
+        id: contentList
+        anchors.fill: parent
+        model: ["components/ImageList.qml", "components/ImageDetails.qml"]
+        orientation: ListView.Horizontal
+        snapMode: ListView.SnapOneItem
+        interactive: false
+        highlightMoveVelocity: 1500
+        cacheBuffer: 2*width
+        delegate: Item {
+            id: contentComponent
+            width: contentList.width
+            height: contentList.height
+            Loader {
+                id: contentLoader
+                source: contentList.model[index]
+                anchors.fill: parent
+            }
+            Connections {
+                target: contentLoader.item
+                onStepForward: {
+                    contentList.currentIndex = 1
+                    canGoBack = true
+                }
+            }
         }
-
-        source: "components/ImageList.qml"
     }
-    Connections {
-        target: contentLoader.item
-        onStepForward: {
-            currentImageIndex = index
-            canGoBack = true
-            contentLoader.source = "components/ImageDetails.qml"
-        }
+
+
+    BusyIndicator {
+        id: loaderIndicator
+        anchors.centerIn: parent
+        visible: true
     }
 }
 

-- 
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