diff options
| author | marcin <z.krzysztoff7@gmail.com> | 2014-07-16 14:40:09 +0200 |
|---|---|---|
| committer | marcin <z.krzysztoff7@gmail.com> | 2014-07-16 14:40:09 +0200 |
| commit | 2eddebe1c2c41f8a9be56862f355251d5d34f18f (patch) | |
| tree | 4a34053a6d1db2718596b18c262a2b0ab4bf30e1 | |
| parent | 855d5736c509363dd47e091210f2f3fe64ad9117 (diff) | |
| download | monzero-gui-2eddebe1c2c41f8a9be56862f355251d5d34f18f.tar.gz monzero-gui-2eddebe1c2c41f8a9be56862f355251d5d34f18f.tar.xz monzero-gui-2eddebe1c2c41f8a9be56862f355251d5d34f18f.zip | |
https://trello.com/c/LXEnXYLF/42-fix-monero-logo
https://trello.com/c/VpuuPT5L/27-per-transaction-descriptions-should-be-removed-from-dashboard-history-as-discussed
https://trello.com/c/wy3nFH3g/30-please-add-ctrl-tab-ctrl-shift-tab-shortcut-keys-to-rotate-between-tabs
https://trello.com/c/6Y6kOXsU/44-add-monero-title-to-the-main-window
| -rw-r--r-- | LeftPanel.qml | 8 | ||||
| -rw-r--r-- | bitmonero.pro | 6 | ||||
| -rw-r--r-- | bitmonero.pro.user | 2 | ||||
| -rw-r--r-- | clipboardAdapter.cpp | 12 | ||||
| -rw-r--r-- | clipboardAdapter.h | 19 | ||||
| -rw-r--r-- | components/DashboardTable.qml | 34 | ||||
| -rw-r--r-- | components/TableDropdown.qml | 14 | ||||
| -rw-r--r-- | components/TitleBar.qml | 9 | ||||
| -rw-r--r-- | filter.cpp | 8 | ||||
| -rw-r--r-- | images/dropdownAdd.png (renamed from images/dropdownOption1.png) | bin | 384 -> 384 bytes | |||
| -rw-r--r-- | images/dropdownCopy.png | bin | 0 -> 306 bytes | |||
| -rw-r--r-- | images/moneroLogo.png | bin | 2576 -> 2237 bytes | |||
| -rw-r--r-- | main.cpp | 5 | ||||
| -rw-r--r-- | main.qml | 5 | ||||
| -rw-r--r-- | qml.qrc | 3 |
15 files changed, 98 insertions, 27 deletions
diff --git a/LeftPanel.qml b/LeftPanel.qml index 10037ffc..d97d9bfc 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -34,15 +34,15 @@ Rectangle { Image { id: logo - anchors.horizontalCenter: parent.horizontalCenter + anchors.left: parent.left + anchors.leftMargin: 50 source: "images/moneroLogo.png" } Image { - anchors.right: logo.left + anchors.left: parent.left anchors.verticalCenter: logo.verticalCenter - anchors.verticalCenterOffset: 5 - anchors.rightMargin: 20 + anchors.leftMargin: 19 source: appWindow.rightPanelExpanded ? "images/expandRightPanel.png" : "images/collapseRightPanel.png" } diff --git a/bitmonero.pro b/bitmonero.pro index 3904b44c..5cfbbf37 100644 --- a/bitmonero.pro +++ b/bitmonero.pro @@ -3,7 +3,8 @@ TEMPLATE = app QT += qml quick widgets SOURCES += main.cpp \ - filter.cpp + filter.cpp \ + clipboardAdapter.cpp RESOURCES += qml.qrc @@ -14,4 +15,5 @@ QML_IMPORT_PATH = include(deployment.pri) HEADERS += \ - filter.h + filter.h \ + clipboardAdapter.h diff --git a/bitmonero.pro.user b/bitmonero.pro.user index 6b4a1b04..82647009 100644 --- a/bitmonero.pro.user +++ b/bitmonero.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 3.1.2, 2014-07-16T10:51:34. --> +<!-- Written by QtCreator 3.1.2, 2014-07-16T14:38:55. --> <qtcreator> <data> <variable>ProjectExplorer.Project.ActiveTarget</variable> diff --git a/clipboardAdapter.cpp b/clipboardAdapter.cpp new file mode 100644 index 00000000..1d5d2d71 --- /dev/null +++ b/clipboardAdapter.cpp @@ -0,0 +1,12 @@ +#include "clipboardAdapter.h" + +clipboardAdapter::clipboardAdapter(QObject *parent) : + QObject(parent) +{ + m_pClipboard = QGuiApplication::clipboard(); +} + +void clipboardAdapter::setText(const QString &text) { + m_pClipboard->setText(text, QClipboard::Clipboard); + m_pClipboard->setText(text, QClipboard::Selection); +} diff --git a/clipboardAdapter.h b/clipboardAdapter.h new file mode 100644 index 00000000..239b699a --- /dev/null +++ b/clipboardAdapter.h @@ -0,0 +1,19 @@ +#ifndef CLIPBOARDADAPTER_H +#define CLIPBOARDADAPTER_H + +#include <QGuiApplication> +#include <QClipboard> +#include <QObject> + +class clipboardAdapter : public QObject +{ + Q_OBJECT +public: + explicit clipboardAdapter(QObject *parent = 0); + Q_INVOKABLE void setText(const QString &text); + +private: + QClipboard *m_pClipboard; +}; + +#endif // CLIPBOARDADAPTER_H diff --git a/components/DashboardTable.qml b/components/DashboardTable.qml index cbd1c8d0..1b0d0f69 100644 --- a/components/DashboardTable.qml +++ b/components/DashboardTable.qml @@ -1,5 +1,6 @@ import QtQuick 2.0 import "../components" +import moneroComponents 1.0 ListView { id: listView @@ -36,30 +37,39 @@ ListView { } Text { - id: paymentIdText - width: text.length ? 120 : 0 + id: descriptionText + width: text.length ? (descriptionArea.containsMouse ? parent.width - x - 12 : 120) : 0 anchors.verticalCenter: dot.verticalCenter font.family: "Arial" font.bold: true font.pixelSize: 19 color: "#444444" elide: Text.ElideRight - text: paymentId + text: description + + MouseArea { + id: descriptionArea + anchors.fill: parent + hoverEnabled: true + } } Item { //separator - width: paymentIdText.width ? 12 : 0 + width: descriptionText.width ? 12 : 0 height: 14 + visible: !descriptionArea.containsMouse } Text { + id: addressText anchors.verticalCenter: dot.verticalCenter width: parent.width - x - 12 elide: Text.ElideRight font.family: "Arial" font.pixelSize: 14 color: "#545454" - text: description.length > 0 ? description : address + text: address + visible: !descriptionArea.containsMouse } } @@ -173,12 +183,22 @@ ListView { color: "#DBDBDB" } + ListModel { + id: dropModel + ListElement { name: "<b>Copy address to clipboard</b>"; icon: "../images/dropdownCopy.png" } + ListElement { name: "<b>Add to address book</b>"; icon: "../images/dropdownAdd.png" } + ListElement { name: "<b>Send to same destination</b>"; icon: "../images/dropdownSend.png" } + ListElement { name: "<b>Find similar transactions</b>"; icon: "../images/dropdownSearch.png" } + } + + Clipboard { id: clipboard } TableDropdown { id: dropdown anchors.right: parent.right anchors.bottom: parent.bottom anchors.bottomMargin: 11 anchors.rightMargin: 5 + dataModel: dropModel onExpandedChanged: { if(listView.previousItem !== undefined && listView.previousItem !== delegate) listView.previousItem.collapseDropdown() @@ -189,6 +209,10 @@ ListView { } } onCollapsed: delegate.z = 0 + onOptionClicked: { + if(option === 0) + clipboard.setText(address) + } } } } diff --git a/components/TableDropdown.qml b/components/TableDropdown.qml index 17b4bc93..69728a73 100644 --- a/components/TableDropdown.qml +++ b/components/TableDropdown.qml @@ -3,8 +3,9 @@ import QtQuick 2.0 Item { id: dropdown property bool expanded: false + property alias dataModel: repeater.model signal collapsed() - signal optionClicked(int index) + signal optionClicked(int option) width: 72 height: 37 @@ -115,17 +116,8 @@ Item { anchors.right: parent.right anchors.top: parent.top - ListModel { - id: dataModel - ListElement { name: "<b>Add to adress book</b>"; icon: "../images/dropdownOption1.png" } - ListElement { name: "<b>Send to same destination</b>"; icon: "../images/dropdownSend.png" } - ListElement { name: "<b>Find similar transactions</b>"; icon: "../images/dropdownSearch.png" } - } - Repeater { id: repeater - model: dataModel - delegate: Rectangle { id: delegate anchors.left: parent.left @@ -163,7 +155,7 @@ Item { anchors.fill: parent propagateComposedEvents: true onEntered: { - var pos = appWindow.mapFromItem(delegate, 30, -20) + var pos = rootItem.mapFromItem(delegate, 30, -20) tipItem.text = name tipItem.x = pos.x if(tipItem.height > 30) diff --git a/components/TitleBar.qml b/components/TitleBar.qml index 5db8b7e1..c4f2dab5 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -8,6 +8,15 @@ Rectangle { y: -height property int mouseX: 0 property int mouseY: 0 + + Text { + anchors.centerIn: parent + font.family: "Arial" + font.pixelSize: 15 + font.letterSpacing: -1 + color: "#FFFFFF" + text: qsTr("Monero") + } Behavior on y { NumberAnimation { duration: 100; easing.type: Easing.InQuad } @@ -25,6 +25,10 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) { QKeySequence ks(ke->modifiers() + ke->key()); sks = ks.toString(); } +#ifndef Q_OS_MAC + if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab")) + break; +#endif emit sequencePressed(QVariant::fromValue<QObject*>(obj), sks); } break; case QEvent::KeyRelease: { @@ -39,6 +43,10 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) { QKeySequence ks(ke->modifiers() + ke->key()); sks = ks.toString(); } +#ifndef Q_OS_MAC + if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab")) + break; +#endif emit sequenceReleased(QVariant::fromValue<QObject*>(obj), sks); } break; case QEvent::MouseButtonPress: { diff --git a/images/dropdownOption1.png b/images/dropdownAdd.png Binary files differindex b4f9c637..b4f9c637 100644 --- a/images/dropdownOption1.png +++ b/images/dropdownAdd.png diff --git a/images/dropdownCopy.png b/images/dropdownCopy.png Binary files differnew file mode 100644 index 00000000..24d0d590 --- /dev/null +++ b/images/dropdownCopy.png diff --git a/images/moneroLogo.png b/images/moneroLogo.png Binary files differindex 8155c5fa..8cbb60c2 100644 --- a/images/moneroLogo.png +++ b/images/moneroLogo.png @@ -1,6 +1,7 @@ #include <QApplication> #include <QQmlApplicationEngine> - +#include <QtQml> +#include "clipboardAdapter.h" #include "filter.h" int main(int argc, char *argv[]) @@ -9,6 +10,8 @@ int main(int argc, char *argv[]) filter *eventFilter = new filter; app.installEventFilter(eventFilter); + qmlRegisterType<clipboardAdapter>("moneroComponents", 1, 0, "Clipboard"); + QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); QObject *rootObject = engine.rootObjects().first(); @@ -11,6 +11,7 @@ ApplicationWindow { property bool whatIsEnable: false property bool ctrlPressed: false property bool rightPanelExpanded: true + property bool osx: false function altKeyReleased() { ctrlPressed = false; } function showPageRequest(page) { @@ -31,14 +32,14 @@ ApplicationWindow { else if(seq === "Ctrl+B") middlePanel.state = "AddressBook" else if(seq === "Ctrl+M") middlePanel.state = "Mining" else if(seq === "Ctrl+S") middlePanel.state = "Settings" - else if(seq === "Ctrl+Tab") { + else if(seq === "Ctrl+Tab" || seq === "Alt+Tab") { if(middlePanel.state === "Dashboard") middlePanel.state = "Transfer" else if(middlePanel.state === "Transfer") middlePanel.state = "History" else if(middlePanel.state === "History") middlePanel.state = "AddressBook" else if(middlePanel.state === "AddressBook") middlePanel.state = "Mining" else if(middlePanel.state === "Mining") middlePanel.state = "Settings" else if(middlePanel.state === "Settings") middlePanel.state = "Dashboard" - } else if(seq === "Ctrl+Shift+Backtab") { + } else if(seq === "Ctrl+Shift+Backtab" || seq === "Alt+Shift+Backtab") { if(middlePanel.state === "Dashboard") middlePanel.state = "Settings" else if(middlePanel.state === "Settings") middlePanel.state = "Mining" else if(middlePanel.state === "Mining") middlePanel.state = "AddressBook" @@ -41,7 +41,7 @@ <file>components/DashboardTable.qml</file> <file>components/TableDropdown.qml</file> <file>images/tableOptions.png</file> - <file>images/dropdownOption1.png</file> + <file>images/dropdownAdd.png</file> <file>images/dropdownSearch.png</file> <file>images/dropdownSend.png</file> <file>components/TipItem.qml</file> @@ -69,5 +69,6 @@ <file>components/TitleBar.qml</file> <file>images/collapseRightPanel.png</file> <file>images/expandRightPanel.png</file> + <file>images/dropdownCopy.png</file> </qresource> </RCC> |
