From ca7472c79af2fe27cafceeb866cc729a171a78fc Mon Sep 17 00:00:00 2001 From: marcin Date: Wed, 16 Jul 2014 10:24:59 +0200 Subject: [PATCH] hide/show right panel https://trello.com/c/BjPPAZfw/35-ability-to-hide-right-sidebar-as-discussed --- LeftPanel.qml | 31 +++- images/collapseRightPanel.png | Bin 0 -> 255 bytes images/expandRightPanel.png | Bin 0 -> 260 bytes main.qml | 6 +- pages/AddressBook.qml | 298 +++++++++++++++++----------------- qml.qrc | 2 + 6 files changed, 182 insertions(+), 155 deletions(-) create mode 100644 images/collapseRightPanel.png create mode 100644 images/expandRightPanel.png diff --git a/LeftPanel.qml b/LeftPanel.qml index 74e2cadb..09438de1 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -24,19 +24,40 @@ Rectangle { width: 260 color: "#FFFFFF" - Image { - id: logo - anchors.horizontalCenter: parent.horizontalCenter + Item { + id: logoItem + anchors.left: parent.left + anchors.right: parent.right anchors.top: parent.top anchors.topMargin: 31 - source: "images/moneroLogo.png" + height: logo.implicitHeight + + Image { + id: logo + anchors.horizontalCenter: parent.horizontalCenter + source: "images/moneroLogo.png" + } + + Image { + anchors.right: logo.left + anchors.verticalCenter: logo.verticalCenter + anchors.verticalCenterOffset: 5 + anchors.rightMargin: 10 + source: appWindow.rightPanelExpanded ? "images/expandRightPanel.png" : + "images/collapseRightPanel.png" + } + + MouseArea { + anchors.fill: parent + onClicked: appWindow.rightPanelExpanded = !appWindow.rightPanelExpanded + } } Column { id: column1 anchors.left: parent.left anchors.right: parent.right - anchors.top: logo.bottom + anchors.top: logoItem.bottom anchors.topMargin: 40 spacing: 6 diff --git a/images/collapseRightPanel.png b/images/collapseRightPanel.png new file mode 100644 index 0000000000000000000000000000000000000000..00bae997343a4a1f80140756b2713e0345b8cca1 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CH!3HFy_x^nYq*#ibJVQ8upoSx*1IXtr@Q5sC zVBi)4Va7{$>;3=*#Y$WwN}P*Q6H7Al^Atidb5j`%%=Hb;^bJk!vPazls*nMx2+mI{ zDNig)WpGT%PfAsA%PdMQ&o9a@R&WkBd$DIz4^UmWr;B5V#>C_=pT6WIBqXdzSKu=- zs;aE|rygX;3`}LXDr7(^g7ec# z$`gxH85~pclTsDjGK*5n^NX^J6`X_3UhLV_15_8|>EaloG4buBjl2y8JS_Tx-4k+i z!cOu{Sa`zXoW{cL1q%wbRQ6Tf{`LEqqbpy+@#R7xORNtw=;XI=zIJ@i%D!4-<>x#O wU$(5%Tip tekst test") -// } + Label { + id: addressLabel + anchors.left: parent.left + anchors.top: newEntryText.bottom + anchors.leftMargin: 17 + anchors.topMargin: 17 + text: qsTr("Address") + fontSize: 14 + tipText: qsTr("Tip 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 -// } + 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: 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 -// } + 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: 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 -// } + 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 + StandardButton { + id: addButton + anchors.right: parent.right + anchors.top: paymentIdLabel.bottom + anchors.rightMargin: 17 + anchors.topMargin: 5 + width: 60 -// shadowReleasedColor: "#FF4304" -// shadowPressedColor: "#B32D00" -// releasedColor: "#FF6C3C" -// pressedColor: "#FF4304" -// text: qsTr("ADD") -// } + shadowReleasedColor: "#FF4304" + shadowPressedColor: "#B32D00" + releasedColor: "#FF6C3C" + pressedColor: "#FF4304" + 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.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" -// } + 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 } -// } + 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) -// } + 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: "" } -// } + 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 -// } + 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 -// } -// } + 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/qml.qrc b/qml.qrc index 21a79120..a0a5e571 100644 --- a/qml.qrc +++ b/qml.qrc @@ -67,5 +67,7 @@ images/prevMonth.png components/TickDelegate.qml components/TitleBar.qml + images/collapseRightPanel.png + images/expandRightPanel.png