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

List:       kde-commits
Subject:    [minuet/convergence] src/app: Minor QML improvements
From:       Sandro S. Andrade <sandroandrade () kde ! org>
Date:       2016-11-17 1:56:06
Message-ID: E1c7Bvq-0001IZ-Ij () code ! kde ! org
[Download RAW message or body]

Git commit f65484606a026a741369c84350c4c1c288891fc9 by Sandro S. Andrade.
Committed on 17/11/2016 at 01:55.
Pushed by sandroandrade into branch 'convergence'.

Minor QML improvements

D  +0    -7    src/app/+android/qtquickcontrols2.conf
M  +1    -1    src/app/main.cpp
M  +1    -2    src/app/qml.qrc
M  +42   -45   src/app/qml/Main.qml
M  +6    -1    src/app/qtquickcontrols2.conf

http://commits.kde.org/minuet/f65484606a026a741369c84350c4c1c288891fc9

diff --git a/src/app/+android/qtquickcontrols2.conf \
b/src/app/+android/qtquickcontrols2.conf deleted file mode 100644
index c228e8c..0000000
--- a/src/app/+android/qtquickcontrols2.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-[Controls]
-Style=Material
-
-[Material]
-Theme=Light
-Primary=Indigo
-Accent=Indigo
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 2a8f992..15630e1 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
     aboutData.addAuthor("Alessandro Longo", i18n("Minuet Icon Designer"), \
QStringLiteral("alessandro.longo@kdemail.net"));  #endif
 
-    application.setWindowIcon(QIcon::fromTheme(QStringLiteral("minuet")));
+    application.setWindowIcon(QIcon(QStringLiteral(":/minuet.png")));
 
     QCommandLineParser parser;
     parser.addHelpOption();
diff --git a/src/app/qml.qrc b/src/app/qml.qrc
index 858cc3c..5606647 100644
--- a/src/app/qml.qrc
+++ b/src/app/qml.qrc
@@ -6,9 +6,8 @@
         <file>qml/images/minuet-drawer.png</file>
         <file>qml/images/menu.png</file>
         <file>qml/images/more_vert.png</file>
-        <file alias="minuet.png">icons/48-apps-minuet.png</file>
+        <file alias="minuet.png">icons/64-apps-minuet.png</file>
         <file>qtquickcontrols2.conf</file>
-        <file>+android/qtquickcontrols2.conf</file>
         <file>+windows/qtquickcontrols2.conf</file>
     </qresource>
 </RCC>
diff --git a/src/app/qml/Main.qml b/src/app/qml/Main.qml
index 612e7b8..dad0213 100644
--- a/src/app/qml/Main.qml
+++ b/src/app/qml/Main.qml
@@ -27,7 +27,7 @@ import QtQuick.Layouts 1.3
 ApplicationWindow {
     id: applicationWindow
     visible: true
-    width: 360; height: 520
+    width: 460; height: 620
 /*
     function exerciseViewStateChanged() {
         if (exerciseView.state == "waitingForAnswer"){
@@ -39,51 +39,49 @@ ApplicationWindow {
     property string titleText: "Minuet"
 //    property var aboutDialog
 
-    Component {
-        id: androidHeader
-        ToolBar {
-            id:toolBar
-
-            RowLayout {
-                spacing: 20
-                anchors.fill: parent
-                height: parent.height / 5
-
-                ToolButton {
-                    contentItem: Image {
-                        fillMode: Image.Pad
-                        horizontalAlignment: Image.AlignHCenter
-                        verticalAlignment: Image.AlignVCenter
-                        source: "qrc:/qml/images/menu.png"
-                    }
-                    onClicked: drawer.open()
-                }
-    
-                Label {
-                    text: titleText
-                    elide: Label.ElideRight
-                    horizontalAlignment: Qt.AlignHCenter
-                    verticalAlignment: Qt.AlignVCenter
-                    Layout.fillWidth: true
+
+    header: ToolBar {
+        id:toolBar
+
+        RowLayout {
+            spacing: 20
+            anchors.fill: parent
+            height: parent.height / 5
+
+            ToolButton {
+                contentItem: Image {
+                    fillMode: Image.Pad
+                    horizontalAlignment: Image.AlignHCenter
+                    verticalAlignment: Image.AlignVCenter
+                    source: "qrc:/qml/images/menu.png"
                 }
+                onClicked: drawer.open()
+            }
 
-                ToolButton {
-                    contentItem: Image {
-                        fillMode: Image.Pad
-                        horizontalAlignment: Image.AlignHCenter
-                        verticalAlignment: Image.AlignVCenter
-                        source: "qrc:/qml/images/more_vert.png"
-                    }
-                    onClicked: optionsMenu.open()
-
-                    Menu {
-                        id: optionsMenu
-                        x: parent.width - width
-                        transformOrigin: Menu.TopRight
-                        MenuItem {
-                            text: "About"
-                            onTriggered: aboutDialog.open()
-                        }
+            Label {
+                text: (Qt.platform.os == "android") ? titleText:""
+                elide: Label.ElideRight
+                horizontalAlignment: Qt.AlignHCenter
+                verticalAlignment: Qt.AlignVCenter
+                Layout.fillWidth: true
+            }
+
+            ToolButton {
+                contentItem: Image {
+                    fillMode: Image.Pad
+                    horizontalAlignment: Image.AlignHCenter
+                    verticalAlignment: Image.AlignVCenter
+                    source: "qrc:/qml/images/more_vert.png"
+                }
+                onClicked: optionsMenu.open()
+
+                Menu {
+                    id: optionsMenu
+                    x: parent.width - width
+                    transformOrigin: Menu.TopRight
+                    MenuItem {
+                        text: "About"
+                        onTriggered: aboutDialog.open()
                     }
                 }
             }
@@ -377,5 +375,4 @@ ApplicationWindow {
         onStateChanged: applicationWindow.exerciseViewStateChanged()
     }
 */
-    Component.onCompleted: if (Qt.platform.os == "android") header = \
androidHeader.createObject(applicationWindow)  }
diff --git a/src/app/qtquickcontrols2.conf b/src/app/qtquickcontrols2.conf
index caace6d..c228e8c 100644
--- a/src/app/qtquickcontrols2.conf
+++ b/src/app/qtquickcontrols2.conf
@@ -1,2 +1,7 @@
 [Controls]
-Style=Default
+Style=Material
+
+[Material]
+Theme=Light
+Primary=Indigo
+Accent=Indigo


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

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