From 2892e762db6734fb8641a4ed86ad12d826b0a97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 26 Aug 2015 23:03:02 +0200 Subject: [PATCH] #1 ugly menu --- src/ui/MenuPanel.qml | 116 ++++++++++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 45 deletions(-) diff --git a/src/ui/MenuPanel.qml b/src/ui/MenuPanel.qml index d568ddb..25f3f33 100644 --- a/src/ui/MenuPanel.qml +++ b/src/ui/MenuPanel.qml @@ -2,58 +2,84 @@ import QtQuick 2.0 import QtQuick.Controls 1.2 import QtQuick.Layouts 1.0 -Rectangle { - Text { - id: text1 - x: 8 - y: 8 - text: qsTr("Text") - font.pixelSize: 12 - } -} - -/*ListView { - id: shareList - width: 400 - height: 400 - spacing: 40 - anchors.fill: parent - - highlight: Rectangle { color: "lightsteelblue"; radius: 5 } - focus: true +Item { + ListView { + id: shareList + width: 400 + height: 400 + anchors.rightMargin: 0 + anchors.bottomMargin: 0 + anchors.leftMargin: 0 + anchors.topMargin: 0 + spacing: 10 + anchors.fill: parent - model: ListModel { - ListElement { - name: "News" + highlight: Rectangle { + color: "lightsteelblue"; + radius: 5 + anchors.leftMargin: 30 } - ListElement { - name: "Inbox" - } - ListElement { - name: "My shares" - } - } + focus: true - delegate: Item { - height: menuLabel.lineHeight - width: parent.width - MouseArea { - anchors.fill: parent; - onClicked: { - shareList.currentIndex = index; + model: ListModel { + ListElement { + name: "News" + element: 3 + filter: "blah" + } + ListElement { + name: "Inbox" + element: 8 + filter: "bloh" + } + ListElement { + name: "My shares" + element: 4 + filter: "bluh" } } - Text { - id: menuLabel - text: ">" + name - //height: 15 - anchors.left: parent.left - anchors.leftMargin: 10 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + delegate: Text { + id: menuLabel + text: name + font.pointSize: 15 + anchors.left: parent.left + anchors.leftMargin: 30 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + + MouseArea { + anchors.fill: parent; + onClicked: { + // Todo something with filter + } + } + Image { + fillMode: Image.PreserveAspectFit + source: "plus.png" + anchors.left: parent.left + anchors.leftMargin: -30 + anchors.top: parent.top + anchors.bottom: parent.bottom + } + + Text { + anchors.left: parent.right + anchors.leftMargin: 5 + text: element + font.pointSize: 15 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + + Rectangle { + anchors.fill: parent + color: "blue" + radius: 9 + z: -1 + } + } } } +} -}*/