From 92c594ca8cefa8ba59dcad1e3f5df170d1880ba0 Mon Sep 17 00:00:00 2001 From: marcin Date: Wed, 9 Jul 2014 16:18:48 +0200 Subject: [PATCH] dashboard + few tipitem fix + shortcuts --- LeftPanel.qml | 2 + MiddlePanel.qml | 2 +- RightPanel.qml | 8 +- bitmonero.pro.user | 2 +- components/AddressBookTable.qml | 98 +++++++++++++++++++ components/DashboardTable.qml | 2 +- components/Label.qml | 22 +++++ components/LineEdit.qml | 4 +- components/Scroll.qml | 29 ++++++ components/SearchInput.qml | 22 ++++- components/StandardButton.qml | 8 ++ components/TableDropdown.qml | 37 +++++-- components/TableHeader.qml | 9 +- components/TipItem.qml | 3 +- filter.cpp | 15 +++ filter.h | 4 + images/deleteIcon.png | Bin 0 -> 334 bytes images/goToTransferIcon.png | Bin 0 -> 401 bytes main.cpp | 3 + main.qml | 38 +++++++- pages/AddressBook.qml | 168 +++++++++++++++++++++++++++++++- pages/Dashboard.qml | 43 +++++--- qml.qrc | 4 + tabs/Twitter.qml | 10 ++ 24 files changed, 494 insertions(+), 39 deletions(-) create mode 100644 components/AddressBookTable.qml create mode 100644 components/Scroll.qml create mode 100644 images/deleteIcon.png create mode 100644 images/goToTransferIcon.png diff --git a/LeftPanel.qml b/LeftPanel.qml index a33b0dda..67d9e3a3 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -33,6 +33,7 @@ Rectangle { text: qsTr("Locked balance") anchors.left: parent.left anchors.leftMargin: 50 + tipText: qsTr("Test tip 1

line 2") } Row { @@ -66,6 +67,7 @@ Rectangle { text: qsTr("Unlocked") anchors.left: parent.left anchors.leftMargin: 50 + tipText: qsTr("Test tip 2

line 2") } Text { diff --git a/MiddlePanel.qml b/MiddlePanel.qml index 98c47092..e3043a46 100644 --- a/MiddlePanel.qml +++ b/MiddlePanel.qml @@ -6,7 +6,7 @@ Rectangle { states: [ State { name: "Dashboard" -// PropertyChanges { target: loader; source: "pages/Dashboard.qml" } + PropertyChanges { target: loader; source: "pages/Dashboard.qml" } }, State { name: "History" PropertyChanges { target: loader; source: "pages/History.qml" } diff --git a/RightPanel.qml b/RightPanel.qml index f59ac3bc..d07e94cb 100644 --- a/RightPanel.qml +++ b/RightPanel.qml @@ -165,11 +165,12 @@ Rectangle { Tab { title: "About" } style: TabViewStyle { - frameOverlap: 2 + frameOverlap: 0 tabOverlap: 0 + tab: Rectangle { implicitHeight: 31 - implicitWidth: 68 + implicitWidth: styleData.index === tabView.count - 1 ? tabView.width - (tabView.count - 1) * 68 : 68 Text { anchors.verticalCenter: parent.verticalCenter @@ -197,6 +198,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom + anchors.bottomMargin: -1 height: 1 color: styleData.selected ? "#FFFFFF" : "#DBDBDB" } @@ -209,7 +211,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: 1 + //anchors.topMargin: 1 height: 1 color: "#DBDBDB" } diff --git a/bitmonero.pro.user b/bitmonero.pro.user index d1aa9be3..014561a5 100644 --- a/bitmonero.pro.user +++ b/bitmonero.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/components/AddressBookTable.qml b/components/AddressBookTable.qml new file mode 100644 index 00000000..43f277c3 --- /dev/null +++ b/components/AddressBookTable.qml @@ -0,0 +1,98 @@ +import QtQuick 2.0 + +ListView { + id: listView + clip: true + boundsBehavior: ListView.StopAtBounds + + delegate: Rectangle { + id: delegate + height: 64 + width: listView.width + color: index % 2 ? "#F8F8F8" : "#FFFFFF" + + StandardButton { + id: goToTransferButton + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + width: 37 + anchors.leftMargin: 3 + shadowColor: "#FF4304" + releasedColor: "#FF6C3C" + pressedColor: "#FF4304" + icon: "../images/goToTransferIcon.png" + } + + StandardButton { + id: removeButton + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + width: 37 + anchors.rightMargin: 3 + shadowColor: "#DBDBDB" + releasedColor: "#F0EEEE" + pressedColor: "#DBDBDB" + icon: "../images/deleteIcon.png" + } + + Row { + anchors.left: goToTransferButton.right + anchors.right: removeButton.left + anchors.leftMargin: 12 + anchors.top: goToTransferButton.top + anchors.topMargin: -2 + + Text { + id: paymentIdText + anchors.top: parent.top + width: text.length ? 122 : 0 + font.family: "Arial" + font.bold: true + font.pixelSize: 19 + color: "#444444" + elide: Text.ElideRight + text: paymentId + } + + Item { //separator + width: paymentIdText.width ? 12 : 0 + height: 14 + } + + Text { + anchors.bottom: paymentIdText.bottom + width: parent.width - x - 12 + elide: Text.ElideRight + font.family: "Arial" + font.pixelSize: 14 + color: "#545454" + text: description + } + } + + Text { + anchors.top: description.length === 0 && paymentId.length === 0 ? goToTransferButton.top : undefined + anchors.bottom: description.length === 0 && paymentId.length === 0 ? undefined : goToTransferButton.bottom + anchors.topMargin: -2 + anchors.bottomMargin: -2 + + anchors.left: goToTransferButton.right + anchors.right: removeButton.left + anchors.rightMargin: 12 + anchors.leftMargin: 12 + elide: Text.ElideRight + font.family: "Arial" + font.pixelSize: 14 + color: "#545454" + text: address + } + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: "#DBDBDB" + } + } +} diff --git a/components/DashboardTable.qml b/components/DashboardTable.qml index dda95cd5..12c699a1 100644 --- a/components/DashboardTable.qml +++ b/components/DashboardTable.qml @@ -59,7 +59,7 @@ ListView { font.family: "Arial" font.pixelSize: 14 color: "#545454" - text: address + text: description.length > 0 ? description : address } } diff --git a/components/Label.qml b/components/Label.qml index 35101ff1..eee9c211 100644 --- a/components/Label.qml +++ b/components/Label.qml @@ -1,8 +1,10 @@ import QtQuick 2.0 Item { + id: item property alias text: label.text property alias color: label.color + property string tipText: "" property int fontSize: 12 width: icon.x + icon.width height: icon.height @@ -25,4 +27,24 @@ Item { source: "../images/whatIsIcon.png" visible: appWindow.whatIsEnable } + + MouseArea { + anchors.fill: icon + enabled: appWindow.whatIsEnable + hoverEnabled: true + onEntered: { + icon.visible = false + var pos = rootItem.mapFromItem(icon, 0, -15) + tipItem.text = item.tipText + tipItem.x = pos.x + if(tipItem.height > 30) + pos.y -= tipItem.height - 28 + tipItem.y = pos.y + tipItem.visible = true + } + onExited: { + icon.visible = true + tipItem.visible = false + } + } } diff --git a/components/LineEdit.qml b/components/LineEdit.qml index aad227ae..0e5c7dc5 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -22,7 +22,7 @@ Item { Input { id: input anchors.fill: parent - anchors.leftMargin: 11 - anchors.rightMargin: 11 + anchors.leftMargin: 4 + anchors.rightMargin: 4 } } diff --git a/components/Scroll.qml b/components/Scroll.qml new file mode 100644 index 00000000..4ab037ad --- /dev/null +++ b/components/Scroll.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Rectangle { + property var flickable + property int yPos: 0 + + function flickableContentYChanged() { + if(flickable === undefined) + return + + var t = flickable.height - height + y = (flickable.contentY / (flickable.contentHeight - flickable.height)) * t + yPos + } + + width: 12 + height: { + var t = (flickable.height * flickable.height) / flickable.contentHeight + return t < 20 ? 20 : t + } + z: 1; y: yPos + color: "#DBDBDB" + anchors.right: flickable.right + opacity: flickable.moving ? 0.5 : 0 + visible: flickable.contentHeight > flickable.height + + Behavior on opacity { + NumberAnimation { duration: 100; easing.type: Easing.InQuad } + } +} diff --git a/components/SearchInput.qml b/components/SearchInput.qml index 7505c5cd..d1fb57f5 100644 --- a/components/SearchInput.qml +++ b/components/SearchInput.qml @@ -47,6 +47,19 @@ Item { anchors.right: button.left width: 154 + function hide() { droplist.height = 0 } + function containsPoint(px, py) { + if(px < 0) + return false + if(px > width) + return false + if(py < 0) + return false + if(py > height + droplist.height) + return false + return true + } + Row { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter @@ -81,7 +94,14 @@ Item { MouseArea { anchors.fill: parent - onClicked: droplist.height = droplist.height === 0 ? dropcolumn.height : 0 + onClicked: { + if(droplist.height === 0) { + appWindow.currentItem = dropdown + droplist.height = dropcolumn.height + } else { + droplist.height = 0 + } + } } } diff --git a/components/StandardButton.qml b/components/StandardButton.qml index 027356e8..0eeb5c2b 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -5,6 +5,7 @@ Item { property string shadowColor property string pressedColor property string releasedColor + property string icon: "" property string textColor: "#FFFFFF" property alias text: label.text signal clicked() @@ -36,6 +37,13 @@ Item { elide: Text.ElideRight font.pixelSize: 12 color: parent.textColor + visible: parent.icon === "" + } + + Image { + anchors.centerIn: parent + visible: parent.icon !== "" + source: parent.icon } MouseArea { diff --git a/components/TableDropdown.qml b/components/TableDropdown.qml index 19186253..6386fe90 100644 --- a/components/TableDropdown.qml +++ b/components/TableDropdown.qml @@ -4,25 +4,40 @@ Item { id: dropdown property bool expanded: false signal collapsed() + signal optionClicked(int index) width: 72 height: 37 + onExpandedChanged: if(expanded) appWindow.currentItem = dropdown + function hide() { dropdown.expanded = false } + function containsPoint(px, py) { + if(px < 0) + return false + if(px > width) + return false + if(py < 0) + return false + if(py > height + dropArea.height) + return false + return true + } + Item { id: head anchors.fill: parent Rectangle { anchors.fill: parent - anchors.topMargin: dropdown.expanded ? 0 : 1 + anchors.topMargin: dropdown.expanded || dropArea.height > 0 ? 0 : 1 radius: 3 - color: dropdown.expanded ? "#888888" : "#DBDBDB" + color: dropdown.expanded || dropArea.height > 0 ? "#888888" : "#DBDBDB" } Rectangle { anchors.fill: parent - anchors.bottomMargin: dropdown.expanded ? 0 : 1 + anchors.bottomMargin: dropdown.expanded || dropArea.height > 0 ? 0 : 1 radius: 3 - color: dropdown.expanded ? "#DBDBDB" : "#F0EEEE" + color: dropdown.expanded || dropArea.height > 0 ? "#DBDBDB" : "#F0EEEE" } Image { @@ -37,7 +52,7 @@ Item { anchors.horizontalCenterOffset: 1 height: 23 width: 1 - color: dropdown.expanded ? "#FFFFFF" : "#DBDBDB" + color: dropdown.expanded || dropArea.height > 0 ? "#FFFFFF" : "#DBDBDB" } Image { @@ -54,6 +69,7 @@ Item { } Item { + id: dropArea anchors.left: parent.left anchors.right: parent.right anchors.top: head.bottom @@ -73,9 +89,9 @@ Item { ListModel { id: dataModel - ListElement { name: "text 1"; icon: "../images/dropdownOption1.png" } - ListElement { name: "longer text 2"; icon: "../images/dropdownSend.png" } - ListElement { name: "text3

lorem ipsum asdasd asdasd"; icon: "../images/dropdownSearch.png" } + ListElement { name: "Add to adress book"; icon: "../images/dropdownOption1.png" } + ListElement { name: "Send to same destination"; icon: "../images/dropdownSend.png" } + ListElement { name: "Find similar transactions"; icon: "../images/dropdownSearch.png" } } Repeater { @@ -127,6 +143,11 @@ Item { tipItem.visible = true } onExited: tipItem.visible = false + onClicked: { + dropdown.optionClicked(index) + tipItem.visible = false + dropdown.expanded = false + } } } } diff --git a/components/TableHeader.qml b/components/TableHeader.qml index a2b3e544..93c5c96a 100644 --- a/components/TableHeader.qml +++ b/components/TableHeader.qml @@ -3,6 +3,7 @@ import QtQuick 2.0 Rectangle { id: header signal sortRequest(bool desc, int column) + property alias dataModel: columnsRepeater.model property int activeSortColumn: -1 height: 31 @@ -16,13 +17,6 @@ Rectangle { color: "#DBDBDB" } - ListModel { - id: columnsModel - ListElement { columnName: "Date"; columnWidth: 92 } - ListElement { columnName: "Amount"; columnWidth: 158 } - ListElement { columnName: "Balance"; columnWidth: 168 } - } - Row { anchors.horizontalCenter: parent.horizontalCenter @@ -34,7 +28,6 @@ Rectangle { Repeater { id: columnsRepeater - model: columnsModel delegate: Rectangle { id: delegate property bool desc: false diff --git a/components/TipItem.qml b/components/TipItem.qml index 1b2c0a38..c8298d1a 100644 --- a/components/TipItem.qml +++ b/components/TipItem.qml @@ -10,7 +10,7 @@ Rectangle { Image { anchors.top: parent.bottom anchors.left: parent.left - anchors.leftMargin: 8 + anchors.leftMargin: 5 source: "../images/tip.png" } @@ -21,6 +21,7 @@ Rectangle { lineHeight: 0.7 font.family: "Arial" font.pixelSize: 12 + font.letterSpacing: -1 color: "#FFFFFF" } } diff --git a/filter.cpp b/filter.cpp index cf41f648..814afb13 100644 --- a/filter.cpp +++ b/filter.cpp @@ -1,5 +1,6 @@ #include "filter.h" #include +#include filter::filter(QObject *parent) : QObject(parent) @@ -14,6 +15,10 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) { if(ke->key() == Qt::Key_Control) { emit ctrlPressed(); m_ctrlPressed = true; + } else { + QKeySequence ks(ke->modifiers() + ke->key()); + QString sks = ks.toString(); + emit sequencePressed(sks); } } break; case QEvent::KeyRelease: { @@ -23,6 +28,16 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) { m_ctrlPressed = false; } } break; + case QEvent::MouseButtonPress: { + QMouseEvent *me = static_cast(ev); + emit mousePressed(QVariant::fromValue(obj), me->x(), me->y()); + m_mousePressed = true; + } break; + case QEvent::MouseButtonRelease: { + QMouseEvent *me = static_cast(ev); + emit mouseReleased(QVariant::fromValue(obj), me->x(), me->y()); + m_mousePressed = false; + } break; default: break; } diff --git a/filter.h b/filter.h index e9bea569..c57ad0e4 100644 --- a/filter.h +++ b/filter.h @@ -9,6 +9,7 @@ class filter : public QObject private: bool m_ctrlPressed; + bool m_mousePressed; public: explicit filter(QObject *parent = 0); @@ -19,6 +20,9 @@ protected: signals: void ctrlPressed(); void ctrlReleased(); + void sequencePressed(const QVariant &seq); + void mousePressed(const QVariant &o, const QVariant &x, const QVariant &y); + void mouseReleased(const QVariant &o, const QVariant &x, const QVariant &y); }; #endif // FILTER_H diff --git a/images/deleteIcon.png b/images/deleteIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..6593db9e797483fadd7c30c1b02c99235d84092f GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kmSQK*5Dp-y;YjHK@;M7UB8wRq zxP?HN@zUM8KR`j564!{5;QX|b^2DN42FH~Aq*MjB%%art{G#k)1?OP17kf7K0M&_s z)HxTWCYEI8=P86_=B6?jnClx@>KmHuU`e(Cs#xaf;uxYav3KG@!4?G`SNV_)bJwU= zuy!+e-{`uc^dyHf$Mwy@9d0Eu#i#!4nctGIr&vFM@zb23CrVcD-4`%MX@8LBnEPG5 zIm20*WY2H4ufa~uyhs?`!f=rf*>|Jgac$lFq*k#7M2h9&N|L~e? zv#xyG#{J{)zYonPE1qZVm>(>)G;qnTDXD)C3iBxJoOdN+0qeds*CkduZSkD(jomWZ VgVjvsZX(dd44$rjF6*2UngF|BdcObw literal 0 HcmV?d00001 diff --git a/images/goToTransferIcon.png b/images/goToTransferIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..b2e4d9888050a2a55c233d12edda8a78cd0bd0c5 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mSQK*5Dp-y;YjHK@;M7UB8wRq zxPc0}g%~g0t@{HMlqqqIC<)F_D=AMbN@Z|N$xljEaLX)8Ezd8?E>>_3HhZyWQx8y` z7)YISQEFmIW`3SRNM>#-gMqoefu+8o$qtre8=#7po-U3d7QJhyY~(#;AmA!5#w+XN z(0HR^l5IrOAye-SA|*KvD>R+m86O2FbWbi86FfCt$MyOD_>#gJk3*4xLCP-|u9sUW zw$~@}hDX-d=-f}c7W6I&=l8gF`q01Dk_2T>23-TzcL!SPPTi9>;CAp4Xpp_|rNQK+ z_o-tHIoy{&v9IxzTb;}BtZygVX9b4O3_aTUdWohS2P{I&k{CA&Y=6sOGxyg$mT9ah z4}Z*OwD@FsNV>puHutWzkteP`>HBG~mD(-Nd`@a=I*lTip tekst test") +// } + +// LineEdit { +// id: addressLine +// anchors.left: parent.left +// anchors.right: parent.right +// anchors.top: addressLabel.bottom +// anchors.leftMargin: 17 +// anchors.rightMargin: 17 +// anchors.topMargin: 5 +// } + +// Label { +// id: paymentIdLabel +// anchors.left: parent.left +// anchors.top: addressLine.bottom +// anchors.leftMargin: 17 +// anchors.topMargin: 17 +// text: qsTr("Payment ID (Optional)") +// fontSize: 14 +// tipText: qsTr("Payment ID

A unique user name used in
the address book. It is not a
transfer of information sent
during thevtransfer") +// width: 156 +// } + +// Label { +// id: descriptionLabel +// anchors.left: paymentIdLabel.right +// anchors.top: addressLine.bottom +// anchors.leftMargin: 17 +// anchors.topMargin: 17 +// text: qsTr("Description (Local database)") +// fontSize: 14 +// tipText: qsTr("Tip tekst test

test line 2") +// width: 156 +// } + +// LineEdit { +// id: paymentIdLine +// anchors.left: parent.left +// anchors.top: paymentIdLabel.bottom +// anchors.leftMargin: 17 +// anchors.topMargin: 5 +// width: 156 +// } + +// LineEdit { +// id: descriptionLine +// anchors.left: paymentIdLine.right +// anchors.right: addButton.left +// anchors.top: paymentIdLabel.bottom +// anchors.leftMargin: 17 +// anchors.rightMargin: 17 +// anchors.topMargin: 5 +// } + +// StandardButton { +// id: addButton +// anchors.right: parent.right +// anchors.top: paymentIdLabel.bottom +// anchors.rightMargin: 17 +// anchors.topMargin: 5 +// width: 60 + +// shadowColor: "#8C0B00" +// pressedColor: "#C60F00" +// releasedColor: "#FF4F41" +// text: qsTr("ADD") +// } + +// Rectangle { +// anchors.left: parent.left +// anchors.right: parent.right +// anchors.bottom: parent.bottom +// anchors.top: paymentIdLine.bottom +// anchors.topMargin: 17 +// color: "#FFFFFF" + +// Rectangle { +// anchors.left: parent.left +// anchors.right: parent.right +// anchors.top: parent.top +// height: 1 +// color: "#DBDBDB" +// } + +// ListModel { +// id: columnsModel +// ListElement { columnName: "Payment ID"; columnWidth: 148 } +// ListElement { columnName: "Description"; columnWidth: 420 } +// } + +// TableHeader { +// id: header +// anchors.left: parent.left +// anchors.right: parent.right +// anchors.top: parent.top +// anchors.topMargin: 17 +// anchors.leftMargin: 14 +// anchors.rightMargin: 14 +// dataModel: columnsModel +// onSortRequest: console.log("column: " + column + " desc: " + desc) +// } + +// ListModel { +// id: testModel +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" } +// ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "" } +// } + +// Scroll { +// id: flickableScroll +// anchors.rightMargin: -14 +// flickable: table +// yPos: table.y +// } + +// AddressBookTable { +// id: table +// anchors.left: parent.left +// anchors.right: parent.right +// anchors.top: header.bottom +// anchors.bottom: parent.bottom +// anchors.leftMargin: 14 +// anchors.rightMargin: 14 +// onContentYChanged: flickableScroll.flickableContentYChanged() +// model: testModel +// } +// } } diff --git a/pages/Dashboard.qml b/pages/Dashboard.qml index f8df1b18..da5f3f11 100644 --- a/pages/Dashboard.qml +++ b/pages/Dashboard.qml @@ -67,7 +67,11 @@ Rectangle { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("lookng for security level and address book? go to Transfer tab") + textFormat: Text.RichText + text: qsTr("\ + lookng for security level and address book? go to Transfer tab") + font.underline: false + onLinkActivated: console.log("link activated") } } @@ -87,6 +91,13 @@ Rectangle { color: "#DBDBDB" } + ListModel { + id: columnsModel + ListElement { columnName: "Date"; columnWidth: 92 } + ListElement { columnName: "Amount"; columnWidth: 158 } + ListElement { columnName: "Balance"; columnWidth: 168 } + } + TableHeader { id: header anchors.left: parent.left @@ -95,30 +106,40 @@ Rectangle { anchors.topMargin: 17 anchors.leftMargin: 14 anchors.rightMargin: 14 + dataModel: columnsModel onSortRequest: console.log("column: " + column + " desc: " + desc) } ListModel { id: testModel - ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: true } - ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: true } - ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } - ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; out: false } + ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: "Client from Australia"; out: false } + ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: true } + ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: true } + ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: false } + ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: "Client from Australia"; out: false } + ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: false } + ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: false } + ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: false } + ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: "Client from Australia"; out: false } + ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014 12:23 AM"; amount: "19301.870709159241"; balance: "0.000709159241"; description: ""; out: false } + } + + Scroll { + id: flickableScroll + anchors.rightMargin: -14 + flickable: table + yPos: table.y } DashboardTable { + id: table anchors.left: parent.left anchors.right: parent.right anchors.top: header.bottom anchors.bottom: parent.bottom anchors.leftMargin: 14 anchors.rightMargin: 14 + onContentYChanged: flickableScroll.flickableContentYChanged() model: testModel } } diff --git a/qml.qrc b/qml.qrc index 69d2c9f6..6060274a 100644 --- a/qml.qrc +++ b/qml.qrc @@ -53,5 +53,9 @@ tabs/Twitter.qml tabs/tweetSearch.js tabs/TweetsModel.qml + components/Scroll.qml + components/AddressBookTable.qml + images/goToTransferIcon.png + images/deleteIcon.png diff --git a/tabs/Twitter.qml b/tabs/Twitter.qml index 91ec2652..0e814dfa 100644 --- a/tabs/Twitter.qml +++ b/tabs/Twitter.qml @@ -1,9 +1,11 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import "tweetSearch.js" as Helper +import "../components" Item { id: tab + ListModel { id: testModel ListElement { head: "Monero || #xmr"; foot: "@btcplanet Duis turpis arcu, varius nec rutrum in, adipiscing at enim. Donec quis consequat ipsum," } @@ -72,12 +74,20 @@ Item { } } + Scroll { + id: flickableScroll + anchors.rightMargin: -14 + flickable: listView + yPos: listView.y + } + ListView { id: listView model: ListModel { id: finalModel } anchors.fill: parent clip: true boundsBehavior: ListView.StopAtBounds + onContentYChanged: flickableScroll.flickableContentYChanged() function add(obj) { model.insert(0, obj) } delegate: Rectangle {