diff --git a/retroshare-qml-app/src/AddTrustedNode.qml b/retroshare-qml-app/src/AddTrustedNode.qml index f444fa957..f2757aa58 100644 --- a/retroshare-qml-app/src/AddTrustedNode.qml +++ b/retroshare-qml-app/src/AddTrustedNode.qml @@ -21,6 +21,7 @@ import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for ClipboardWrapper singleton import "URI.js" as UriJs +import "components/." Item { @@ -29,43 +30,46 @@ Item Column { anchors.fill: parent + spacing: 7 Text { - text: qsTr("Import/export node from/to clipboard") + text: qsTr("Import node from clipboard") font.bold: true wrapMode: Text.Wrap - } + anchors.horizontalCenter: parent.horizontalCenter - Button - { - text: qsTr("Export own certificate link") - onClicked: + font.pixelSize: 13 + + Rectangle { - console.log("onClicked", text) - rsApi.request( - "/peers/self/certificate/", "", - function(par) - { - var radix = JSON.parse(par.response).data.cert_string - var name = mainWindow.user_name - var encodedName = UriJs.URI.encode(name) - var nodeUrl = ( - "retroshare://certificate?" + - "name=" + encodedName + - "&radix=" + UriJs.URI.encode(radix) + - "&location=" + encodedName ) - ClipboardWrapper.postToClipBoard(nodeUrl) - linkCopiedPopup.itemName = name - linkCopiedPopup.open() - platformGW.shareUrl(nodeUrl); - }) + id: backgroundRectangle + anchors.fill: parent.fill + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + 20 + height: parent.height + 5 + + color:"transparent" + + Rectangle + { + id: borderBottom + width: parent.width + height: 1 + anchors.bottom: parent.bottom + anchors.right: parent.right + color: "lightgrey" + } } } - Button + ButtonText { + id: importButton text: qsTr("Import trusted node") + anchors.horizontalCenter: parent.horizontalCenter + iconUrl: "/icons/paste.svg" + fontSize: 14 onClicked: { @@ -106,9 +110,70 @@ Item } } - Button + Text { + text: qsTr("Export node") + font.bold: true + wrapMode: Text.Wrap + anchors.horizontalCenter: parent.horizontalCenter + + font.pixelSize: 13 + + Rectangle + { + anchors.fill: parent.fill + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + 20 + height: parent.height + 5 + + color:"transparent" + + Rectangle + { + width: parent.width + height: 1 + anchors.bottom: parent.bottom + anchors.right: parent.right + color: "lightgrey" + } + } + } + + ButtonText + { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Export own certificate link") + iconUrl: "/icons/share.svg" + fontSize: 14 + onClicked: + { + console.log("onClicked", text) + rsApi.request( + "/peers/self/certificate/", "", + function(par) + { + var radix = JSON.parse(par.response).data.cert_string + var name = mainWindow.user_name + var encodedName = UriJs.URI.encode(name) + var nodeUrl = ( + "retroshare://certificate?" + + "name=" + encodedName + + "&radix=" + UriJs.URI.encode(radix) + + "&location=" + encodedName ) + ClipboardWrapper.postToClipBoard(nodeUrl) + linkCopiedPopup.itemName = name + linkCopiedPopup.open() + platformGW.shareUrl(nodeUrl); + }) + } + } + + ButtonText + { + anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Export own plain certificate") + fontSize: 14 + iconUrl: "/icons/share.svg" onClicked: { rsApi.request( diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 3cbc41b72..144d77e29 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -144,7 +144,7 @@ Item border.color: inferiorPanel.styles.borderColor } - BtnIcon + ButtonIcon { id: attachButton @@ -263,7 +263,7 @@ Item } } - BtnIcon + ButtonIcon { id: emojiButton @@ -290,7 +290,7 @@ Item } - BtnIcon + ButtonIcon { id: sendButton diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index e7eea713b..8a401cfc1 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -28,8 +28,9 @@ Item property var md property bool is_contact: cntDt.md.is_contact property bool isOwn: cntDt.md.own + property string objectName: "contactDetails" - Button + ButtonText { id: avatarPicker @@ -38,6 +39,11 @@ Item anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter + buttonTextPixelSize: 14 + iconUrl: "/icons/attach-image.svg" + borderRadius: 0 + + onClicked: { if (isOwn) fileChooser.open() @@ -163,9 +169,11 @@ Item spacing: 6 - Button + ButtonText { text: qsTr("Contact full link") + borderRadius: 0 + buttonTextPixelSize: 14 onClicked: { rsApi.request( @@ -191,10 +199,12 @@ Item } } - Button + ButtonText { text: qsTr("Contact short link") enabled: false + borderRadius: 0 + buttonTextPixelSize: 14 } } } diff --git a/retroshare-qml-app/src/Locations.qml b/retroshare-qml-app/src/Locations.qml index 1742ac26a..ed24de4fe 100644 --- a/retroshare-qml-app/src/Locations.qml +++ b/retroshare-qml-app/src/Locations.qml @@ -20,6 +20,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 +import "components/." + Item { id: locationView @@ -62,6 +64,11 @@ Item bottomButton.enabled = false bottomButton.text = "Creating profile..." } + onCancel: + { + locationView.state = "selectLocation" + } + } }, State @@ -83,6 +90,10 @@ Item locationView.attemptLogin = true attemptTimer.start() } + onCancel: + { + locationView.state = "selectLocation" + } } } ] @@ -127,28 +138,68 @@ Item width: parent.width anchors.top: parent.top anchors.bottom: bottomButton.top + anchors.horizontalCenter: parent.horizontalCenter model: locationsModel.model - delegate: Button + spacing: 3 + delegate: Item { - text: model.name - onClicked: + id: delegate + width: parent.width + height: locationButton.height + 5 + Rectangle { - loginView.login = text - locationView.sslid = model.id - locationView.state = "login" - mainWindow.user_name = model.name + id: backgroundRectangle + anchors.fill: parent.fill + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width /2 + height: parent.height + + color:"transparent" + + Rectangle + { + id: borderBottom + width: parent.width + height: 1 + anchors.bottom: parent.bottom + anchors.right: parent.right + color: "lightgrey" + } + } + + ButtonText + { + id: locationButton + anchors.horizontalCenter: parent.horizontalCenter + text: model.name + borderRadius:0 + iconUrl: "/icons/edit-image-face-detect.svg" + color: "white" + pressColor: "lightsteelblue" + buttonTextPixelSize: 20 + + onClicked: + { + loginView.login = text + locationView.sslid = model.id + locationView.state = "login" + mainWindow.user_name = model.name + } } } visible: false } - Button + ButtonText { id: bottomButton text: "Create new location" anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter onClicked: locationView.state = "createLocation" + buttonTextPixelSize: 15 + iconUrl: "/icons/add.svg" + borderRadius: 0 } RsLoginPassView diff --git a/retroshare-qml-app/src/RsLoginPassView.qml b/retroshare-qml-app/src/RsLoginPassView.qml index 7ea4a800d..2ea083ac2 100644 --- a/retroshare-qml-app/src/RsLoginPassView.qml +++ b/retroshare-qml-app/src/RsLoginPassView.qml @@ -19,11 +19,13 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.0 +import "components/." Item { id: loginView property string buttonText: qsTr("Unlock") + property string cancelText: qsTr("Cancel") property string iconUrl: "qrc:/icons/emblem-locked.svg" property string login property bool loginPreset: false @@ -32,6 +34,7 @@ Item property string password: advancedMode ? "" : hardcodedPassword property string suggestionText signal submit(string login, string password) + signal cancel() Component.onCompleted: loginPreset = login.length > 0 @@ -118,18 +121,32 @@ Item Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom spacing: 3 - Button + ButtonIcon { - text: qsTr("Advanced...") visible: !loginView.loginPreset onClicked: loginView.advancedMode = !loginView.advancedMode + imgUrl: "/icons/options.svg" + height: bottomButton.height - 5 + width: height + anchors.verticalCenter: bottomButton.verticalCenter } - Button + ButtonText { id: bottomButton text: loginView.buttonText onClicked: loginView.submit(nameField.text, passwordField.text) + iconUrl: "/icons/network.svg" + buttonTextPixelSize: 15 + } + ButtonIcon + { + id: cancelButton + onClicked: loginView.cancel() + height: bottomButton.height - 5 + width: height + imgUrl: "/icons/back.png" + anchors.verticalCenter: bottomButton.verticalCenter } } } diff --git a/retroshare-qml-app/src/TrustedNodeDetails.qml b/retroshare-qml-app/src/TrustedNodeDetails.qml index 5aac8315e..8155e8503 100644 --- a/retroshare-qml-app/src/TrustedNodeDetails.qml +++ b/retroshare-qml-app/src/TrustedNodeDetails.qml @@ -162,9 +162,14 @@ Item anchors.horizontalCenter: parent.horizontalCenter spacing: 6 - Button + ButtonText { text: qsTr("Revoke") + + borderRadius: 0 + buttonTextPixelSize: 14 + iconUrl: "/icons/leave.svg" + onClicked: rsApi.request( "/peers/"+nodeDetailsRoot.pgpId+"/delete", "", @@ -172,11 +177,16 @@ Item { stackView.push("qrc:/TrustedNodesView.qml") }) } - Button + ButtonText { text: qsTr("Entrust") visible: nodeDetailsRoot.nodeCert.length > 0 + + borderRadius: 0 + buttonTextPixelSize: 14 + iconUrl: "/icons/invite.svg" + onClicked: { var jsonData = diff --git a/retroshare-qml-app/src/TrustedNodesView.qml b/retroshare-qml-app/src/TrustedNodesView.qml index 4cc7a3401..c53cb3bed 100644 --- a/retroshare-qml-app/src/TrustedNodesView.qml +++ b/retroshare-qml-app/src/TrustedNodesView.qml @@ -20,6 +20,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import "jsonpath.js" as JSONPath import "." //Needed for TokensManager singleton +import "components/." Item { @@ -65,37 +66,29 @@ Item anchors.top: parent.top anchors.bottom: bottomButton.top model: jsonModel.model + anchors.horizontalCenter: parent.horizontalCenter + spacing: 3 delegate: Item { property bool isOnline: jsonModel.isOnline(model.pgp_id) height: 54 width: parent.width + anchors.horizontalCenter: parent.horizontalCenter - Image - { - id: statusImage - source: isOnline? - "icons/state-ok.svg" : - "icons/state-offline.svg" - - height: parent.height - 4 - sourceSize.height: height - fillMode: Image.PreserveAspectFit - anchors.left: parent.left - anchors.leftMargin: 3 - anchors.verticalCenter: parent.verticalCenter - } - Text + ButtonText { + id: locationButton +// anchors.horizontalCenter: parent.horizontalCenter text: model.name - anchors.verticalCenter: parent.verticalCenter - anchors.left: statusImage.right - anchors.leftMargin: 10 - font.pixelSize: 15 - } - MouseArea - { - anchors.fill: parent + borderRadius:0 + iconUrl: isOnline? + "/icons/state-ok.svg" : + "/icons/state-offline.svg" + color: "white" + pressColor: "lightsteelblue" + buttonTextPixelSize: 18 + iconHeight:parent.height - 4 + onClicked: { stackView.push( @@ -113,12 +106,17 @@ Item } } - Button + ButtonText { id: bottomButton text: qsTr("Add Trusted Node") anchors.bottom: parent.bottom onClicked: stackView.push("qrc:/AddTrustedNode.qml") - width: parent.width + anchors.horizontalCenter: parent.horizontalCenter +// width: parent.width + + borderRadius: 0 + buttonTextPixelSize: 14 + iconUrl: "/icons/add.svg" } } diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 35eb30efd..77c7e90ef 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -97,9 +97,13 @@ Item { console.log("showDetails() ", gxs_id) - stackView.push( - "qrc:/ContactDetails.qml", - {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) + if (stackView.currentItem.objectName != "contactDetails") + { + stackView.push( + "qrc:/ContactDetails.qml", + {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) + + } } Component.onCompleted: startComponent () diff --git a/retroshare-qml-app/src/components/BtnIcon.qml b/retroshare-qml-app/src/components/ButtonIcon.qml similarity index 100% rename from retroshare-qml-app/src/components/BtnIcon.qml rename to retroshare-qml-app/src/components/ButtonIcon.qml diff --git a/retroshare-qml-app/src/components/Btn.qml b/retroshare-qml-app/src/components/ButtonText.qml similarity index 82% rename from retroshare-qml-app/src/components/Btn.qml rename to retroshare-qml-app/src/components/ButtonText.qml index 1adb4033e..708f6c546 100644 --- a/retroshare-qml-app/src/components/Btn.qml +++ b/retroshare-qml-app/src/components/ButtonText.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.0 Item { id: button - property alias buttonText: innerText.text; + property alias text: innerText.text; property alias buttonTextPixelSize: innerText.font.pixelSize property alias innerAnchors: innerElements.anchors; property alias rectangleButton: rectangleButton; @@ -12,14 +12,17 @@ Item property var iconUrl property int iconHeight: 20 - property color color - property color hoverColor - property color pressColor + property color color: "lightsteelblue" + property color hoverColor: color + property color pressColor: color property int fontSize property int borderWidth - property int borderRadius + property int borderRadius: 3 property int innerMargin: 10 + height: innerText.height + innerMargin + innerMargin + width: innerText.width + innerMargin + innerMargin + icon.width + icon.width + scale: state === "Pressed" ? 0.96 : 1.0 onEnabledChanged: state = "" signal clicked @@ -29,7 +32,7 @@ Item id: rectangleButton anchors.fill: parent radius: borderRadius - color: button.enabled ? button.color : "grey" + color: button.enabled ? button.color : "lavender" border.width: borderWidth border.color: "black" @@ -50,6 +53,7 @@ Item anchors.margins:(iconUrl)? innerMargin : 0 anchors.verticalCenter: parent.verticalCenter + sourceSize.height: height } Text @@ -59,6 +63,7 @@ Item font.pointSize: fontSize anchors.left: icon.right anchors.verticalCenter: parent.verticalCenter + color: button.enabled ? "black" : "grey" } } } diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 0361c23eb..ac901b423 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -111,9 +111,9 @@ Drawer } } - Btn + ButtonText { - buttonText: model.title + text: model.title width: parent.width height: parent.height color: menuItem.styles.defaultColor @@ -123,6 +123,7 @@ Drawer iconUrl: (model.icon)? model.icon : undefined innerMargin: 20 buttonTextPixelSize: menuItem.styles.pixelSize + borderRadius: 0 } diff --git a/retroshare-qml-app/src/icons/attach-image.svg b/retroshare-qml-app/src/icons/attach-image.svg new file mode 100644 index 000000000..ab2e0e388 --- /dev/null +++ b/retroshare-qml-app/src/icons/attach-image.svg @@ -0,0 +1,78 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/back.png b/retroshare-qml-app/src/icons/back.png new file mode 100644 index 000000000..78dcc7011 Binary files /dev/null and b/retroshare-qml-app/src/icons/back.png differ diff --git a/retroshare-qml-app/src/icons/invite.svg b/retroshare-qml-app/src/icons/invite.svg new file mode 100644 index 000000000..afcefbd72 --- /dev/null +++ b/retroshare-qml-app/src/icons/invite.svg @@ -0,0 +1,74 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/leave.svg b/retroshare-qml-app/src/icons/leave.svg new file mode 100644 index 000000000..9904394ef --- /dev/null +++ b/retroshare-qml-app/src/icons/leave.svg @@ -0,0 +1,59 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/network.svg b/retroshare-qml-app/src/icons/network.svg new file mode 100644 index 000000000..861b298bd --- /dev/null +++ b/retroshare-qml-app/src/icons/network.svg @@ -0,0 +1,68 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/options.svg b/retroshare-qml-app/src/icons/options.svg new file mode 100644 index 000000000..6a1ae55d1 --- /dev/null +++ b/retroshare-qml-app/src/icons/options.svg @@ -0,0 +1,62 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/paste.svg b/retroshare-qml-app/src/icons/paste.svg new file mode 100644 index 000000000..667618fd2 --- /dev/null +++ b/retroshare-qml-app/src/icons/paste.svg @@ -0,0 +1,90 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/share.svg b/retroshare-qml-app/src/icons/share.svg new file mode 100644 index 000000000..94966e6ce --- /dev/null +++ b/retroshare-qml-app/src/icons/share.svg @@ -0,0 +1,81 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 17634d741..f98f66fa7 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -153,7 +153,7 @@ ApplicationWindow } - BtnIcon + ButtonIcon { property bool searchIconVisibility: false property var onClickCB: function (){} @@ -190,7 +190,7 @@ ApplicationWindow Component { id: rsIcon - BtnIcon + ButtonIcon { height: imageLoader.height width: imageLoader.height diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index fb2a636f0..bb8c5d51e 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -31,7 +31,7 @@ ChatBubbleDelegate.qml icons/send-message.svg icons/attach.svg - components/BtnIcon.qml + components/ButtonIcon.qml icons/smiley.svg icons/microphone_mute.svg icons/microphone.svg @@ -40,7 +40,7 @@ components/AvatarOrColorHash.qml components/SideBar.qml styles/SideBarStyle.qml - components/Btn.qml + components/ButtonText.qml icons/netgraph.svg icons/search.svg icons/exit.svg @@ -54,5 +54,13 @@ icons/network-connect.svg icons/network-disconnect.svg components/CustomFileChooser.qml + icons/options.svg + icons/network.svg + icons/back.png + icons/attach-image.svg + icons/invite.svg + icons/leave.svg + icons/paste.svg + icons/share.svg