From fa9578fca6a87de2742f048ad8ef05f1e0556fdd Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 3 Jun 2017 15:13:40 +0200 Subject: [PATCH 001/107] Refactor qml structure for aesthetic contacts --- .../src/GxsIdentityDelegate.qml | 174 ++++++++++-------- 1 file changed, 97 insertions(+), 77 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 9f74b802e..9b9a12316 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -22,95 +22,114 @@ import QtQuick.Controls 2.0 Item { id: delegateRoot - height: 40 + height: 50 width: parent.width - MouseArea - { + Rectangle { + anchors.fill: parent - onClicked: + color: contactItem.containsMouse ? "lightgrey" : "transparent" + width: parent.width + height: parent.height + + + MouseArea { - console.log("GxsIntentityDelegate onclicked:", model.name, - model.gxs_id) - contactsView.searching = false - if(model.own) contactsView.own_gxs_id = model.gxs_id - else + id: contactItem + anchors.fill: parent + onClicked: { - var jsonData = { "own_gxs_hex": contactsView.own_gxs_id, - "remote_gxs_hex": model.gxs_id } - rsApi.request("/chat/initiate_distant_chat", - JSON.stringify(jsonData), - contactsView.startChatCallback) - } - } - - onPressAndHold: showDetails() - - ColorHash - { - id: colorHash - - hash: model.gxs_id - height: parent.height - 4 - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 2 - - MouseArea - { - anchors.fill: parent - onClicked: delegateRoot.showDetails() - } - } - - Text - { - id: nickText - color: model.own ? "blue" : "black" - text: model.name - anchors.left: colorHash.right - anchors.leftMargin: 5 - anchors.verticalCenter: parent.verticalCenter - } - - Row - { - anchors.right: parent.right - anchors.rightMargin: 10 - anchors.verticalCenter: parent.verticalCenter - height: parent.height - 10 - spacing: 4 - - Rectangle - { - visible: model.unread_count > 0 - - color: "cornflowerblue" - antialiasing: true - border.color: "blue" - border.width: 1 - height: parent.height - 4 - radius: height/2 - width: height - anchors.verticalCenter: parent.verticalCenter - - Text + console.log("GxsIntentityDelegate onclicked:", model.name, + model.gxs_id) + contactsView.searching = false + if(model.own) contactsView.own_gxs_id = model.gxs_id + else { - color: "white" - font.bold: true - text: model.unread_count - anchors.centerIn: parent + var jsonData = { "own_gxs_hex": contactsView.own_gxs_id, + "remote_gxs_hex": model.gxs_id } + rsApi.request("/chat/initiate_distant_chat", + JSON.stringify(jsonData), + contactsView.startChatCallback) } } - Image + onPressAndHold: showDetails() + hoverEnabled: true + } + + Rectangle { + anchors.fill: parent + color: "transparent" + anchors.margins: 5 +// anchors.leftMargin: 5 + + + ColorHash { - source: model.is_contact ? - "qrc:/icons/rating.png" : - "qrc:/icons/rating-unrated.png" + id: colorHash + + hash: model.gxs_id height: parent.height - 4 - fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 2 + + MouseArea + { + anchors.fill: parent + onClicked: delegateRoot.showDetails() + } + } + + Text + { + id: nickText + color: model.own ? "blue" : "black" + text: model.name + anchors.left: colorHash.right + anchors.leftMargin: 5 + anchors.verticalCenter: parent.verticalCenter + } + + Row + { + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.verticalCenter: parent.verticalCenter + height: parent.height - 10 + spacing: 4 + + Rectangle + { + visible: model.unread_count > 0 + + color: "cornflowerblue" + antialiasing: true + border.color: "blue" + border.width: 1 + height: parent.height - 4 + radius: height/2 + width: height + anchors.verticalCenter: parent.verticalCenter + + Text + { + color: "white" + font.bold: true + text: model.unread_count + anchors.centerIn: parent + } + } + + Image + { + source: model.is_contact ? + "qrc:/icons/rating.png" : + "qrc:/icons/rating-unrated.png" + height: parent.height - 4 + fillMode: Image.PreserveAspectFit + anchors.verticalCenter: parent.verticalCenter + } } } } @@ -124,3 +143,4 @@ Item {md: contactsListView.model.get(index)}) } } + From 36a0e1fbb84fd242f7f3b3cdb8a02f85f48403e3 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 3 Jun 2017 17:41:09 +0200 Subject: [PATCH 002/107] Implement last message cache from chats --- retroshare-qml-app/src/ChatCache.qml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 retroshare-qml-app/src/ChatCache.qml diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml new file mode 100644 index 000000000..d808d59b8 --- /dev/null +++ b/retroshare-qml-app/src/ChatCache.qml @@ -0,0 +1,40 @@ +pragma Singleton + +import QtQml 2.7 +import QtQuick.Controls 2.0 +import org.retroshare.qml_components.LibresapiLocalClient 1.0 +import Qt.labs.settings 1.0 + +QtObject { + + id: chatCache + + property QtObject lastMessageCache: QtObject + { + property var lastMessageList: ({}) + + function updateLastMessageCache (chatId, chatModel){ + console.log("updateLastMessageCache (chatId, chatModel)", chatId) + + if (!chatModel) { + rsApi.request( "/chat/messages/"+chatId, "", function (par){ + updateLastMessage(chatId, par.response) + }) + } else { + updateLastMessage (chatId, chatModel) + } + } + + function updateLastMessage (chatId, chatModel){ + var lastMessage = getLastMessage (chatModel) + lastMessageList[chatId] = lastMessage + } + + function getLastMessageFromChat (chatModel){ + console.log("getLastMessage (chatMessages)") + var messagesData = JSON.parse(chatMessages).data + return messagesData.slice(-1)[0] + } + } + +} From 93c6a1a7e8e2616c2ebfb4f7d5aa2583ddb3bd80 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 3 Jun 2017 17:58:03 +0200 Subject: [PATCH 003/107] Add ChatCache.qml as singleton on qmldir --- retroshare-qml-app/src/qmldir | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/qmldir b/retroshare-qml-app/src/qmldir index 8b0c5806f..c0f3d057d 100644 --- a/retroshare-qml-app/src/qmldir +++ b/retroshare-qml-app/src/qmldir @@ -1,2 +1,3 @@ singleton TokensManager 1.0 TokensManager.qml singleton ClipboardWrapper 1.0 ClipboardWrapper.qml +singleton ChatCache ChatCache.qml From 464c16b825f4d02f02d7458aaafbe724f4943416 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 3 Jun 2017 17:58:53 +0200 Subject: [PATCH 004/107] Implement last message cache when a message is received --- retroshare-qml-app/src/ChatView.qml | 3 +++ retroshare-qml-app/src/Contacts.qml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index cbb5b86f6..3990069fd 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -27,6 +27,7 @@ Item property string chatId property int token: 0 + function refreshData() { console.log("chatView.refreshData()", visible) @@ -38,6 +39,8 @@ Item token = JSON.parse(par.response).statetoken TokensManager.registerToken(token, refreshData) + ChatCache.lastMessageCache.updateLastMessageCache(chatId, chatModel.json) + if(chatListView.visible) { chatListView.positionViewAtEnd() diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index e1e312319..f16196c8d 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -101,6 +101,10 @@ Item TokensManager.registerToken(json.statetoken, refreshUnread) contactsSortWorker.sendMessage( {'action': 'refreshUnread', 'response': par.response}) + json.data.forEach (function (chat){ + console.log("@@@@@@@@@@@@ ",chat.chat_id) + ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) + }) } function refreshUnread() { @@ -187,4 +191,5 @@ Item property bool defaultIdentityCreated: false } + } From 549b76141af8e7a0cfdb9a3c1dfbf6ed07226bc2 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 3 Jun 2017 18:09:52 +0200 Subject: [PATCH 005/107] Solve variable names incoherences --- retroshare-qml-app/src/ChatCache.qml | 6 +++--- retroshare-qml-app/src/Contacts.qml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index d808d59b8..5abb0c26c 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -26,13 +26,13 @@ QtObject { } function updateLastMessage (chatId, chatModel){ - var lastMessage = getLastMessage (chatModel) + console.log("updateLastMessage (chatId, chatModel)") + var lastMessage = getLastMessageFromChat (chatModel) lastMessageList[chatId] = lastMessage } function getLastMessageFromChat (chatModel){ - console.log("getLastMessage (chatMessages)") - var messagesData = JSON.parse(chatMessages).data + var messagesData = JSON.parse(chatModel).data return messagesData.slice(-1)[0] } } diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index f16196c8d..995d2d5d9 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -102,7 +102,6 @@ Item contactsSortWorker.sendMessage( {'action': 'refreshUnread', 'response': par.response}) json.data.forEach (function (chat){ - console.log("@@@@@@@@@@@@ ",chat.chat_id) ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) }) } From d3e3f14afd8f551691f4158d66425216c315b11a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 5 Jun 2017 16:06:59 +0200 Subject: [PATCH 006/107] Implement chat cache on GXS delegate view --- retroshare-qml-app/src/ChatCache.qml | 28 ++++++- .../src/GxsIdentityDelegate.qml | 75 +++++++++++++++++-- 2 files changed, 94 insertions(+), 9 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 5abb0c26c..9ee673c11 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -11,8 +11,12 @@ QtObject { property QtObject lastMessageCache: QtObject { + id: lastMessageCache property var lastMessageList: ({}) + signal lastMessageChanged() + + function updateLastMessageCache (chatId, chatModel){ console.log("updateLastMessageCache (chatId, chatModel)", chatId) @@ -27,14 +31,34 @@ QtObject { function updateLastMessage (chatId, chatModel){ console.log("updateLastMessage (chatId, chatModel)") - var lastMessage = getLastMessageFromChat (chatModel) + var lastMessage = findChatLastMessage (chatModel) lastMessageList[chatId] = lastMessage + } - function getLastMessageFromChat (chatModel){ + function findChatLastMessage (chatModel){ var messagesData = JSON.parse(chatModel).data return messagesData.slice(-1)[0] } + + + function getChatIdFromGxs (gxs){ + for (var key in lastMessageList) { + if ( lastMessageList[key].author_id === gxs ) { + return key + } + } + return undefined + } + + function getChatLastMessage (chatId){ + if (lastMessageList[chatId]) { + return lastMessageList[chatId] + } + + return undefined + + } } } diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 9b9a12316..d47b69cbe 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -18,6 +18,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import "." //Needed for ChatCache singleton Item { @@ -25,6 +26,18 @@ Item height: 50 width: parent.width + // property var lastMessageData: getLastMessage() + + property var chatId: undefined + property var lastMessageData: "" + property var authorName: lastMessageData.author_name + +// JSONListModel +// { +// id: lastMessageData +// query: "$.*" +// } + Rectangle { anchors.fill: parent @@ -61,7 +74,6 @@ Item anchors.fill: parent color: "transparent" anchors.margins: 5 -// anchors.leftMargin: 5 ColorHash @@ -81,16 +93,32 @@ Item } } - Text - { - id: nickText - color: model.own ? "blue" : "black" - text: model.name + Column { + + height: parent.height anchors.left: colorHash.right anchors.leftMargin: 5 - anchors.verticalCenter: parent.verticalCenter + + Text + { + id: nickText + color: model.own ? "blue" : "black" + text: model.name + font.bold: true + } + + Text + { + id: lastMessage + color: model.own ? "blue" : "black" + text: (lastMessageData.msg) ? lastMessageData.msg : "" + font.italic: true + } + } + + Row { anchors.right: parent.right @@ -133,6 +161,39 @@ Item } } } +// signal lastMessageChanged(var chatI, var newLastMessage) +// lastMessageChanged(chatId, lastMessage) +// Connections { +// target: ChatCache.lastMessageCache +// onLastMessageChanged: { +// if (!chatId) { +// getChatIdFromGXS() +// } + +// if (chatId && chatId === chatI){ +// delegateRoot.lastMessageData = newLastMessage +// console.log("@@@@@@@@@@@2 Last message changed ",chatI ,newLastMessage.msg, chatId ) +// } +// } + +// } + + Component.onCompleted: { + if (!chatId){ + chatId = getChatIdFromGXS() + } + if (chatId) { + lastMessageData = getChatLastMessage(chatId) + } + } + + function getChatLastMessage (chatId){ + return ChatCache.lastMessageCache.getChatLastMessage(chatId) + } + + function getChatIdFromGXS (){ + return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) + } function showDetails() { From 78fc0bc99571459f6775cb80d0a7382ef5dc6172 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 5 Jun 2017 20:17:19 +0200 Subject: [PATCH 007/107] Refactor chat cache to add remoteGXS property to make chat last message more identificable --- retroshare-qml-app/src/ChatCache.qml | 39 ++++++++--- retroshare-qml-app/src/Contacts.qml | 1 + .../src/GxsIdentityDelegate.qml | 66 +++++++++++-------- 3 files changed, 68 insertions(+), 38 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 9ee673c11..cebdccbfe 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -14,12 +14,16 @@ QtObject { id: lastMessageCache property var lastMessageList: ({}) - signal lastMessageChanged() + signal lastMessageChanged(var chatI, var newLastMessage) function updateLastMessageCache (chatId, chatModel){ console.log("updateLastMessageCache (chatId, chatModel)", chatId) - + // First creates the chat id object for don't wait to work with the object if is needed to call RS api + if (!lastMessageList[chatId]) { + lastMessageList[chatId] = {} + console.log("Last message cache created!") + } if (!chatModel) { rsApi.request( "/chat/messages/"+chatId, "", function (par){ updateLastMessage(chatId, par.response) @@ -32,8 +36,12 @@ QtObject { function updateLastMessage (chatId, chatModel){ console.log("updateLastMessage (chatId, chatModel)") var lastMessage = findChatLastMessage (chatModel) - lastMessageList[chatId] = lastMessage - + lastMessageList[chatId].lastMessage = lastMessage + if (!lastMessageList[chatId].remoteGXS) { + var firstMessage = findChatFirstMessage (chatModel) + setRemoteGXS(chatId, firstMessage.author_id) + } + lastMessageChanged(chatId, lastMessage) } function findChatLastMessage (chatModel){ @@ -41,22 +49,35 @@ QtObject { return messagesData.slice(-1)[0] } + function findChatFirstMessage (chatModel){ + var messagesData = JSON.parse(chatModel).data + return messagesData.slice[0] + } + + function setRemoteGXS (chatId, remoteGXS){ + if (lastMessageList[chatId] && !lastMessageList[chatId].remoteGXS){ + lastMessageList[chatId].remoteGXS = remoteGXS + return true + } + else { + return false + } + } function getChatIdFromGxs (gxs){ for (var key in lastMessageList) { - if ( lastMessageList[key].author_id === gxs ) { + if ( lastMessageList[key].remoteGXS === gxs ) { return key } } - return undefined + return "" } function getChatLastMessage (chatId){ if (lastMessageList[chatId]) { - return lastMessageList[chatId] + return lastMessageList[chatId].lastMessage } - - return undefined + return "" } } diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 995d2d5d9..4e1d72607 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -103,6 +103,7 @@ Item {'action': 'refreshUnread', 'response': par.response}) json.data.forEach (function (chat){ ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) + ChatCache.lastMessageCache.setRemoteGXS (chat.chat_id, chat.remote_author_id) }) } function refreshUnread() diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index d47b69cbe..e80577af7 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -26,17 +26,10 @@ Item height: 50 width: parent.width - // property var lastMessageData: getLastMessage() property var chatId: undefined property var lastMessageData: "" - property var authorName: lastMessageData.author_name -// JSONListModel -// { -// id: lastMessageData -// query: "$.*" -// } Rectangle { @@ -70,7 +63,8 @@ Item hoverEnabled: true } - Rectangle { + Rectangle + { anchors.fill: parent color: "transparent" anchors.margins: 5 @@ -93,9 +87,11 @@ Item } } - Column { + Column + { height: parent.height + width: parent.width anchors.left: colorHash.right anchors.leftMargin: 5 @@ -107,12 +103,24 @@ Item font.bold: true } - Text + Row { - id: lastMessage - color: model.own ? "blue" : "black" - text: (lastMessageData.msg) ? lastMessageData.msg : "" - font.italic: true + id: lastMessageText + width: parent.width + Text + { + id: lastMessageSender + font.italic: true + color: "dodgerblue" + text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" + } + Text + { + id: lastMessageMsg + text: (lastMessageData.msg) ? lastMessageData.msg : "" + font.italic: true + } + } } @@ -161,22 +169,7 @@ Item } } } -// signal lastMessageChanged(var chatI, var newLastMessage) -// lastMessageChanged(chatId, lastMessage) -// Connections { -// target: ChatCache.lastMessageCache -// onLastMessageChanged: { -// if (!chatId) { -// getChatIdFromGXS() -// } -// if (chatId && chatId === chatI){ -// delegateRoot.lastMessageData = newLastMessage -// console.log("@@@@@@@@@@@2 Last message changed ",chatI ,newLastMessage.msg, chatId ) -// } -// } - -// } Component.onCompleted: { if (!chatId){ @@ -187,11 +180,26 @@ Item } } + Connections { + target: ChatCache.lastMessageCache + onLastMessageChanged: { + if (!chatId) { + chatId = getChatIdFromGXS() + } + if (chatId && chatId === chatI){ + console.log("New last message received!") + lastMessageData = newLastMessage + } + } + } + + function getChatLastMessage (chatId){ return ChatCache.lastMessageCache.getChatLastMessage(chatId) } function getChatIdFromGXS (){ + var id= ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } From 6d162708767af3163cdb4ab6e169d6f126f15d03 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 15:55:52 +0200 Subject: [PATCH 008/107] Create function to set date format from recv_time --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index e80577af7..c7d6c4116 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -202,6 +202,20 @@ Item var id= ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } + function setTime(){ + if (!lastMessageData.recv_time){ + return "" + } + var timeFormat = "dd.MM.yyyy"; + var recvDate = new Date(lastMessageData.recv_time*1000) + + // Check if is today + if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) { + timeFormat = "hh:mm" + } + var timeString = Qt.formatDateTime(recvDate, timeFormat) + return timeString + } function showDetails() { From 287e34c65ffeb29ed0b6ff987234c61d4fb78a25 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 16:06:41 +0200 Subject: [PATCH 009/107] Add Qt Locale for date format --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index c7d6c4116..50b94e20f 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -29,6 +29,7 @@ Item property var chatId: undefined property var lastMessageData: "" + property var locale: Qt.locale() Rectangle { From 85724a39eb3f1d94fc429dbfc21f1789dc9da95d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 16:07:55 +0200 Subject: [PATCH 010/107] Refactor to show recv time and last messages bit little --- .../src/GxsIdentityDelegate.qml | 92 +++++++++++++------ 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 50b94e20f..b16e7f36b 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -92,34 +92,86 @@ Item { height: parent.height - width: parent.width + width: parent.width - (isContactIcon.width *3.5) anchors.left: colorHash.right anchors.leftMargin: 5 - Text + Item { - id: nickText - color: model.own ? "blue" : "black" - text: model.name - font.bold: true + width: parent.width + height: parent.height /2 + + + Text + { + id: nickText + color: model.own ? "blue" : "black" + text: model.name + font.bold: true + } + + Text + { +// text: (lastMessageData.recv_time)? Date.fromLocaleDateString(locale, lastMessageData.recv_time, "ddd yyyy-MM-dd hh:mm:ss"): "sad" + text: setTime() + font.italic: true + anchors.right: parent.right + + } + + + } - Row + Item { id: lastMessageText width: parent.width + height: parent.height /2 + Text { id: lastMessageSender font.italic: true color: "dodgerblue" text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" + maximumLineCount: 1 + elide:Text.ElideRight + wrapMode: Text.WordWrap } Text { id: lastMessageMsg text: (lastMessageData.msg) ? lastMessageData.msg : "" font.italic: true + rightPadding: 5 +// maximumLineCount: 1 +// elide:Text.ElideRight +// wrapMode: Text.WordWrap + + } + + Rectangle + { + visible: model.unread_count > 0 + + color: "cornflowerblue" + antialiasing: true +// border.color: "blue" +// border.width: 1 + height: parent.height - 2 + radius: height/2 + width: height + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + + Text + { + color: "white" + font.bold: true + text: model.unread_count + anchors.centerIn: parent + } } } @@ -128,6 +180,7 @@ Item + Row { anchors.right: parent.right @@ -136,27 +189,7 @@ Item height: parent.height - 10 spacing: 4 - Rectangle - { - visible: model.unread_count > 0 - color: "cornflowerblue" - antialiasing: true - border.color: "blue" - border.width: 1 - height: parent.height - 4 - radius: height/2 - width: height - anchors.verticalCenter: parent.verticalCenter - - Text - { - color: "white" - font.bold: true - text: model.unread_count - anchors.centerIn: parent - } - } Image { @@ -166,6 +199,8 @@ Item height: parent.height - 4 fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter + + id: isContactIcon } } } @@ -177,7 +212,8 @@ Item chatId = getChatIdFromGXS() } if (chatId) { - lastMessageData = getChatLastMessage(chatId) + var last = getChatLastMessage(chatId) + if (last) lastMessageData = getChatLastMessage(chatId) } } From f3c37886b4e9d7c1d8f826d87f2de97c6ba13107 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 16:26:57 +0200 Subject: [PATCH 011/107] Set msg preview text maximum length --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index b16e7f36b..d24b4868c 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -91,6 +91,7 @@ Item Column { + id: chatInfoRow height: parent.height width: parent.width - (isContactIcon.width *3.5) anchors.left: colorHash.right @@ -129,26 +130,29 @@ Item width: parent.width height: parent.height /2 + Text { id: lastMessageSender font.italic: true color: "dodgerblue" text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" - maximumLineCount: 1 - elide:Text.ElideRight - wrapMode: Text.WordWrap +// width: 50 + +// maximumLineCount: 1 +// elide:Text.ElideRight +// wrapMode: Text.WordWrap } Text { id: lastMessageMsg + anchors.left: lastMessageSender.right text: (lastMessageData.msg) ? lastMessageData.msg : "" font.italic: true rightPadding: 5 -// maximumLineCount: 1 -// elide:Text.ElideRight -// wrapMode: Text.WordWrap + elide: Text.ElideRight + width: chatInfoRow.width - 30 } Rectangle @@ -157,8 +161,6 @@ Item color: "cornflowerblue" antialiasing: true -// border.color: "blue" -// border.width: 1 height: parent.height - 2 radius: height/2 width: height From aaeb29a1462a4c0389370f9039cf2ad34cc1c7a0 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 16:37:10 +0200 Subject: [PATCH 012/107] Change text aesthetic --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index d24b4868c..4d7c64918 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -115,8 +115,8 @@ Item { // text: (lastMessageData.recv_time)? Date.fromLocaleDateString(locale, lastMessageData.recv_time, "ddd yyyy-MM-dd hh:mm:ss"): "sad" text: setTime() - font.italic: true anchors.right: parent.right + color: "darkslategrey" } @@ -135,23 +135,18 @@ Item { id: lastMessageSender font.italic: true - color: "dodgerblue" + color: "royalblue" text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" -// width: 50 - -// maximumLineCount: 1 -// elide:Text.ElideRight -// wrapMode: Text.WordWrap } + Text { id: lastMessageMsg anchors.left: lastMessageSender.right text: (lastMessageData.msg) ? lastMessageData.msg : "" - font.italic: true rightPadding: 5 elide: Text.ElideRight - + color: "darkslategrey" width: chatInfoRow.width - 30 } From 0742a44f73594d80551ce47ed267d64dc0c9bf5b Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 6 Jun 2017 17:37:33 +0200 Subject: [PATCH 013/107] Style search box --- retroshare-qml-app/src/Contacts.qml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 4e1d72607..93b43556b 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -149,16 +149,20 @@ Item id: searchBox visible: contactsView.searching - height: searchText.height - width: searchText.width + height: searchText.height + 10 + width: parent.width * 0.9 anchors.right: parent.right anchors.top: parent.top + anchors.leftMargin: 5 + anchors.rightMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + color: "white" Image { id: searchIcon - height: searchText.height - 4 - width: searchText.height - 4 + height: searchText.height / 2 + width: searchText.height / 2 anchors.verticalCenter: parent.verticalCenter source: "qrc:/icons/edit-find.png" } @@ -168,6 +172,15 @@ Item id: searchText anchors.left: searchIcon.right anchors.verticalCenter: parent.verticalCenter + placeholderText : "Search contacts..." + width: parent.width - searchIcon.width - 5 + anchors.leftMargin: 5 + + background: Rectangle { + border.width: 2 + radius: 5 + border.color: searchText.focus ? "cornflowerblue" : "lightgrey" + } onTextChanged: contactsSortWorker.sendMessage( {'action': 'searchContact', 'sexp': text}) From ed52bbe76c6d2507cf1f3dc1f380ccfd8b7d7776 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 7 Jun 2017 12:29:14 +0200 Subject: [PATCH 014/107] qml app: add missing ChatCache.qml file in qrc --- retroshare-qml-app/src/qml.qrc | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 3859fde54..1b47f3808 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -29,5 +29,6 @@ icons/rating-unrated.png icons/rating.png TimedPopup.qml + ChatCache.qml From a0f59959a1c2e3603287d1974c33aedb878ba848 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 7 Jun 2017 12:30:34 +0200 Subject: [PATCH 015/107] qml app: properly initialize object property --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 4d7c64918..634bab277 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -28,7 +28,7 @@ Item property var chatId: undefined - property var lastMessageData: "" + property var lastMessageData: ({}) property var locale: Qt.locale() From 7c4ee55fcf4ae8b9ebdcd47d0b3a36eef092aa3c Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 7 Jun 2017 15:00:37 +0200 Subject: [PATCH 016/107] Refactor chat cache to get remote GXS from GxsIdentityDelegate.qml instead from ChatView --- retroshare-qml-app/src/ChatCache.qml | 8 ++++---- retroshare-qml-app/src/GxsIdentityDelegate.qml | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index cebdccbfe..8da30c2b1 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -37,10 +37,6 @@ QtObject { console.log("updateLastMessage (chatId, chatModel)") var lastMessage = findChatLastMessage (chatModel) lastMessageList[chatId].lastMessage = lastMessage - if (!lastMessageList[chatId].remoteGXS) { - var firstMessage = findChatFirstMessage (chatModel) - setRemoteGXS(chatId, firstMessage.author_id) - } lastMessageChanged(chatId, lastMessage) } @@ -55,6 +51,10 @@ QtObject { } function setRemoteGXS (chatId, remoteGXS){ + if (!lastMessageList[chatId]) { + lastMessageList[chatId] = {} + console.log("Last message cache created!") + } if (lastMessageList[chatId] && !lastMessageList[chatId].remoteGXS){ lastMessageList[chatId].remoteGXS = remoteGXS return true diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 634bab277..85c1f137d 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -56,7 +56,7 @@ Item "remote_gxs_hex": model.gxs_id } rsApi.request("/chat/initiate_distant_chat", JSON.stringify(jsonData), - contactsView.startChatCallback) + startDistantChatCB) } } @@ -113,7 +113,6 @@ Item Text { -// text: (lastMessageData.recv_time)? Date.fromLocaleDateString(locale, lastMessageData.recv_time, "ddd yyyy-MM-dd hh:mm:ss"): "sad" text: setTime() anchors.right: parent.right color: "darkslategrey" @@ -259,5 +258,10 @@ Item "qrc:/ContactDetails.qml", {md: contactsListView.model.get(index)}) } + function startDistantChatCB (par){ + var chId = JSON.parse(par.response).data.chat_id + ChatCache.lastMessageCache.setRemoteGXS(chId, model.gxs_id) + contactsView.startChatCallback (par) + } } From 3793a2196a98dd5ee5403e0395cfe78ab9b03914 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 7 Jun 2017 18:58:11 +0200 Subject: [PATCH 017/107] Add chat buble delegate --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 107 ++++++++++++++++++ retroshare-qml-app/src/ChatView.qml | 22 +--- 2 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 retroshare-qml-app/src/ChatBubbleDelegate.qml diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml new file mode 100644 index 000000000..8a6bb3641 --- /dev/null +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -0,0 +1,107 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.2 +import QtQuick.Controls 2.0 + + +Item { + + id: chatBubbleDelegate + height: bubble.height + width: parent.width + + property int lMarginBubble: 10 + property int rMarginBubble: 10 + property int tMarginBubble: 5 + property int bMarginBubble: 10 + property int aditionalBubbleHeight: tMarginBubble * 2 + property int aditionalBubbleWidth: 30 + + + Rectangle { + anchors.fill: parent + width: parent.width + height: parent.height + + Rectangle + { + id: bubble + width: Math.max(mesageText.implicitWidth, sendersName.implicitWidth ) + timeText.implicitWidth + aditionalBubbleWidth +// height: mesageText.height + mesageText.anchors.margins + 10 + height: mesageText.height + sendersName.height + aditionalBubbleHeight + + + anchors.left: (model.incoming)? parent.left : undefined + anchors.right: (!model.incoming)? parent.right : undefined + + + color: (!model.incoming)? "aliceblue" : "lightGreen" + radius: 5 + + + Text { + id: sendersName + visible: model.incoming + text: (model.incoming)? model.author_name + ":" : "" + color: "cornflowerblue" + font.bold: true + + anchors.leftMargin:lMarginBubble/2 + anchors.rightMargin: rMarginBubble + anchors.topMargin: tMarginBubble + anchors.top: bubble.top + + anchors.left: (model.incoming)? parent.left : undefined + anchors.right:(!model.incoming)? parent.right : undefined + + height: (model.incoming)? implicitHeight : 0 + } + + Text { + id: timeText + text: getMessageTime() + color: "grey" + + anchors.left: (!model.incoming)? parent.left : undefined + anchors.right:(model.incoming)? parent.right : undefined + + anchors.bottom: bubble.bottom + anchors.leftMargin:lMarginBubble + anchors.rightMargin: rMarginBubble + anchors.topMargin: tMarginBubble + } + + + Text { + id: mesageText + text: model.msg + + anchors.left: (model.incoming)? parent.left : undefined + anchors.right:(!model.incoming)? parent.right : undefined + + anchors.top: sendersName.bottom +// anchors.bottomMargin: bMarginBubble + anchors.leftMargin:lMarginBubble + anchors.rightMargin: rMarginBubble + +// wrapMode: Text.Wrap + } + + + + } + + } + + function getMessageTime(){ + + var timeFormat = "hh:mm"; + var recvDate = new Date(model.recv_time*1000) + + var timeString = Qt.formatDateTime(recvDate, timeFormat) + return timeString + } + + } + + + diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 3990069fd..0794959ab 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -58,27 +58,17 @@ Item query: "$.data[*]" } - Component - { - id: chatMessageDelegate - Item - { - height: 20 - Row - { - Text { text: author_name } - Text { text: ": " + msg } - } - } - } - ListView { id: chatListView - width: parent.width + width: parent.width - 7 + anchors.horizontalCenter: parent.horizontalCenter height: 300 model: chatModel.model - delegate: chatMessageDelegate + delegate: ChatBubbleDelegate {} + spacing: 3 + preferredHighlightBegin: 1 + } TextField From 69ed5185558364824cf2bef66a8c4c52f73b18cf Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 15:16:50 +0200 Subject: [PATCH 018/107] Use style singleton on chat bubbles --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 48 ++++++++++--------- retroshare-qml-app/src/qml.qrc | 2 + retroshare-qml-app/src/qmldir | 2 + .../src/styles/ChatBubblesStyle.qml | 25 ++++++++++ 4 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 retroshare-qml-app/src/styles/ChatBubblesStyle.qml diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 8a6bb3641..80650e07d 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -1,7 +1,9 @@ import QtQuick 2.7 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 - +import "." // To load styles +//import './styles' +//import "styles/ChatBubblesStyle.qml" as Style Item { @@ -9,12 +11,14 @@ Item { height: bubble.height width: parent.width - property int lMarginBubble: 10 - property int rMarginBubble: 10 - property int tMarginBubble: 5 - property int bMarginBubble: 10 - property int aditionalBubbleHeight: tMarginBubble * 2 - property int aditionalBubbleWidth: 30 +// property int lMarginBubble: 10 +// property int rMarginBubble: 10 +// property int tMarginBubble: 5 +// property int bMarginBubble: 10 +// property int aditionalBubbleHeight: tMarginBubble * 2 +// property int aditionalBubbleWidth: 30 + + property var styles: StyleChatBubble Rectangle { @@ -25,29 +29,28 @@ Item { Rectangle { id: bubble - width: Math.max(mesageText.implicitWidth, sendersName.implicitWidth ) + timeText.implicitWidth + aditionalBubbleWidth -// height: mesageText.height + mesageText.anchors.margins + 10 - height: mesageText.height + sendersName.height + aditionalBubbleHeight + width: Math.max(mesageText.implicitWidth, sendersName.implicitWidth ) + timeText.implicitWidth + styles.aditionalBubbleWidth + height: mesageText.height + sendersName.height + styles.aditionalBubbleHeight anchors.left: (model.incoming)? parent.left : undefined anchors.right: (!model.incoming)? parent.right : undefined - color: (!model.incoming)? "aliceblue" : "lightGreen" - radius: 5 + color: (!model.incoming)? styles.colorOutgoing : styles.colorIncoming + radius: styles.radius Text { id: sendersName visible: model.incoming text: (model.incoming)? model.author_name + ":" : "" - color: "cornflowerblue" + color: styles.colorSenderName font.bold: true - anchors.leftMargin:lMarginBubble/2 - anchors.rightMargin: rMarginBubble - anchors.topMargin: tMarginBubble + anchors.leftMargin: styles.lMarginBubble + anchors.rightMargin: styles.rMarginBubble + anchors.topMargin: styles.tMarginBubble anchors.top: bubble.top anchors.left: (model.incoming)? parent.left : undefined @@ -59,15 +62,15 @@ Item { Text { id: timeText text: getMessageTime() - color: "grey" + color: styles.colorMessageTime anchors.left: (!model.incoming)? parent.left : undefined anchors.right:(model.incoming)? parent.right : undefined anchors.bottom: bubble.bottom - anchors.leftMargin:lMarginBubble - anchors.rightMargin: rMarginBubble - anchors.topMargin: tMarginBubble + anchors.leftMargin: styles.lMarginBubble + anchors.rightMargin: styles.rMarginBubble + anchors.topMargin: styles.tMarginBubble } @@ -79,9 +82,8 @@ Item { anchors.right:(!model.incoming)? parent.right : undefined anchors.top: sendersName.bottom -// anchors.bottomMargin: bMarginBubble - anchors.leftMargin:lMarginBubble - anchors.rightMargin: rMarginBubble + anchors.leftMargin: styles.lMarginBubble + anchors.rightMargin: styles.rMarginBubble // wrapMode: Text.Wrap } diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 1b47f3808..cb360b546 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -30,5 +30,7 @@ icons/rating.png TimedPopup.qml ChatCache.qml + ChatBubbleDelegate.qml + styles/ChatBubblesStyle.qml diff --git a/retroshare-qml-app/src/qmldir b/retroshare-qml-app/src/qmldir index c0f3d057d..0b33cab43 100644 --- a/retroshare-qml-app/src/qmldir +++ b/retroshare-qml-app/src/qmldir @@ -1,3 +1,5 @@ singleton TokensManager 1.0 TokensManager.qml singleton ClipboardWrapper 1.0 ClipboardWrapper.qml singleton ChatCache ChatCache.qml +singleton StyleChatBubble styles/ChatBubblesStyle.qml + diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml new file mode 100644 index 000000000..7b5054a86 --- /dev/null +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -0,0 +1,25 @@ +import QtQuick 2.0 +pragma Singleton + +QtObject { + +// Margins + readonly property int lMarginBubble: 10 + readonly property int rMarginBubble: 10 + readonly property int tMarginBubble: 5 + readonly property int bMarginBubble: 10 + readonly property int aditionalBubbleHeight: tMarginBubble * 2 + readonly property int aditionalBubbleWidth: 30 + +// BubbleProps + readonly property int radius: 5 + + +// Colors + readonly property string colorIncoming: "lightGreen" + readonly property string colorOutgoing: "aliceblue" + readonly property string colorSenderName: "cornflowerblue" + readonly property string colorMessageTime: "grey" + + +} From 4a90436e8ec0dc45a081765eb16510310e641972 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 16:21:33 +0200 Subject: [PATCH 019/107] Change toolbar label on chat view opened with the name of remote --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 5 ++++ retroshare-qml-app/src/ChatView.qml | 2 ++ retroshare-qml-app/src/main-app.qml | 25 +++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 80650e07d..6b458ede6 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -94,6 +94,11 @@ Item { } + Component.onCompleted: { + toolBar.state = "CHATVIEW" + toolBar.titleText = model.author_name + } + function getMessageTime(){ var timeFormat = "hh:mm"; diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 0794959ab..625ceb1c4 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -27,6 +27,8 @@ Item property string chatId property int token: 0 + property string objectName:"chatView" + function refreshData() { diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 497119d69..033bf2088 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -57,6 +57,18 @@ ApplicationWindow header: ToolBar { id: toolBar + property alias titleText: toolBarText.text + property string defaultLabel: "RetroShare" + + states: [ + State { + name: "DEFAULT" + PropertyChanges { target: toolBar; titleText: defaultLabel} + }, + State { + name: "CHATVIEW" + } + ] Image { @@ -68,7 +80,8 @@ ApplicationWindow } Label { - text: "RetroShare" + id: toolBarText + text: defaultLabel anchors.verticalCenter: parent.verticalCenter anchors.left: rsIcon.right anchors.leftMargin: 20 @@ -135,7 +148,15 @@ ApplicationWindow id: stackView anchors.fill: parent focus: true - onCurrentItemChanged: if (currentItem) currentItem.focus = true + onCurrentItemChanged: { + if (currentItem) { + if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT"){ + toolBar.state = "DEFAULT" + } + currentItem.focus = true + } + } + Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) { From 92bcd4cbfd93067dba383da652b65097b5d8793d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 17:10:37 +0200 Subject: [PATCH 020/107] Add text wrap behaivour on bubbles --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 16 +++++++++++----- .../src/styles/ChatBubblesStyle.qml | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 6b458ede6..6af114c88 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -22,6 +22,7 @@ Item { Rectangle { + id: rootBubble anchors.fill: parent width: parent.width height: parent.height @@ -29,7 +30,10 @@ Item { Rectangle { id: bubble - width: Math.max(mesageText.implicitWidth, sendersName.implicitWidth ) + timeText.implicitWidth + styles.aditionalBubbleWidth + width: Math.min ( + rootBubble.width * styles.bubbleMaxWidth, + Math.max(mesageText.implicitWidth, sendersName.implicitWidth ) + ) + timeText.implicitWidth + styles.aditionalBubbleWidth height: mesageText.height + sendersName.height + styles.aditionalBubbleHeight @@ -77,7 +81,7 @@ Item { Text { id: mesageText text: model.msg - + width: rootBubble.width * styles.bubbleMaxWidth anchors.left: (model.incoming)? parent.left : undefined anchors.right:(!model.incoming)? parent.right : undefined @@ -85,11 +89,13 @@ Item { anchors.leftMargin: styles.lMarginBubble anchors.rightMargin: styles.rMarginBubble -// wrapMode: Text.Wrap + horizontalAlignment: (!model.incoming && + mesageText.implicitWidth <= (rootBubble.width * styles.bubbleMaxWidth) + )? Text.AlignRight : Text.AlignLeft + + wrapMode: Text.Wrap } - - } } diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 7b5054a86..8540bd2a9 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -3,13 +3,14 @@ pragma Singleton QtObject { -// Margins +// Bubble measures readonly property int lMarginBubble: 10 readonly property int rMarginBubble: 10 readonly property int tMarginBubble: 5 readonly property int bMarginBubble: 10 readonly property int aditionalBubbleHeight: tMarginBubble * 2 readonly property int aditionalBubbleWidth: 30 + readonly property real bubbleMaxWidth: 0.5 // % from parent // BubbleProps readonly property int radius: 5 From 81a8677226e629fa126602a7e6d7a0fcba32c942 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 17:12:23 +0200 Subject: [PATCH 021/107] Change recv time position to the top of the bubble --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 6af114c88..c189242a5 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -71,7 +71,7 @@ Item { anchors.left: (!model.incoming)? parent.left : undefined anchors.right:(model.incoming)? parent.right : undefined - anchors.bottom: bubble.bottom + anchors.top: bubble.top anchors.leftMargin: styles.lMarginBubble anchors.rightMargin: styles.rMarginBubble anchors.topMargin: styles.tMarginBubble From 78206c5a00cc0d422e4a06bc1bc01ad60120edd9 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 17:40:40 +0200 Subject: [PATCH 022/107] Refactor style sheet to be more structurated --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 9 +-- retroshare-qml-app/src/icons/send-message.svg | 67 +++++++++++++++++++ retroshare-qml-app/src/qmldir | 2 +- .../src/styles/ChatBubblesStyle.qml | 33 ++++----- 4 files changed, 87 insertions(+), 24 deletions(-) create mode 100644 retroshare-qml-app/src/icons/send-message.svg diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index c189242a5..49e2cf8b2 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -11,14 +11,7 @@ Item { height: bubble.height width: parent.width -// property int lMarginBubble: 10 -// property int rMarginBubble: 10 -// property int tMarginBubble: 5 -// property int bMarginBubble: 10 -// property int aditionalBubbleHeight: tMarginBubble * 2 -// property int aditionalBubbleWidth: 30 - - property var styles: StyleChatBubble + property var styles: StyleChat.bubble Rectangle { diff --git a/retroshare-qml-app/src/icons/send-message.svg b/retroshare-qml-app/src/icons/send-message.svg new file mode 100644 index 000000000..ebf98d78d --- /dev/null +++ b/retroshare-qml-app/src/icons/send-message.svg @@ -0,0 +1,67 @@ + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/qmldir b/retroshare-qml-app/src/qmldir index 0b33cab43..7a42d0162 100644 --- a/retroshare-qml-app/src/qmldir +++ b/retroshare-qml-app/src/qmldir @@ -1,5 +1,5 @@ singleton TokensManager 1.0 TokensManager.qml singleton ClipboardWrapper 1.0 ClipboardWrapper.qml singleton ChatCache ChatCache.qml -singleton StyleChatBubble styles/ChatBubblesStyle.qml +singleton StyleChat styles/ChatBubblesStyle.qml diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 8540bd2a9..1c07bfcf0 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -3,24 +3,27 @@ pragma Singleton QtObject { -// Bubble measures - readonly property int lMarginBubble: 10 - readonly property int rMarginBubble: 10 - readonly property int tMarginBubble: 5 - readonly property int bMarginBubble: 10 - readonly property int aditionalBubbleHeight: tMarginBubble * 2 - readonly property int aditionalBubbleWidth: 30 - readonly property real bubbleMaxWidth: 0.5 // % from parent + property QtObject bubble: QtObject{ + // Bubble measures + readonly property int lMarginBubble: 10 + readonly property int rMarginBubble: 10 + readonly property int tMarginBubble: 5 + readonly property int bMarginBubble: 10 + readonly property int aditionalBubbleHeight: tMarginBubble * 2 + readonly property int aditionalBubbleWidth: 30 + readonly property real bubbleMaxWidth: 0.5 // % from parent -// BubbleProps - readonly property int radius: 5 + // BubbleProps + readonly property int radius: 5 -// Colors - readonly property string colorIncoming: "lightGreen" - readonly property string colorOutgoing: "aliceblue" - readonly property string colorSenderName: "cornflowerblue" - readonly property string colorMessageTime: "grey" + // Colors + readonly property string colorIncoming: "lightGreen" + readonly property string colorOutgoing: "aliceblue" + readonly property string colorSenderName: "cornflowerblue" + readonly property string colorMessageTime: "grey" + + } } From cb96b9fac6b7e894f57582825e6574ef54656125 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 17:48:50 +0200 Subject: [PATCH 023/107] Solve bug with defaultLabel undefined --- retroshare-qml-app/src/main-app.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 033bf2088..f38bfc447 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -81,7 +81,6 @@ ApplicationWindow Label { id: toolBarText - text: defaultLabel anchors.verticalCenter: parent.verticalCenter anchors.left: rsIcon.right anchors.leftMargin: 20 From 66d63c29b353c576479c55641c5255913d761602 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 19:08:41 +0200 Subject: [PATCH 024/107] Create custom button icon component --- retroshare-qml-app/src/components/BtnIcon.qml | 27 ++++++++ retroshare-qml-app/src/icons/attach.svg | 61 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 retroshare-qml-app/src/components/BtnIcon.qml create mode 100644 retroshare-qml-app/src/icons/attach.svg diff --git a/retroshare-qml-app/src/components/BtnIcon.qml b/retroshare-qml-app/src/components/BtnIcon.qml new file mode 100644 index 000000000..0f707f0cf --- /dev/null +++ b/retroshare-qml-app/src/components/BtnIcon.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Item { + + id: root + signal clicked +// signal pressed +// signal released + + property var imgUrl: "" + + Image { + + anchors.fill: parent + source: imgUrl + + height: parent.height + width: parent.width + } + + MouseArea { + anchors.fill: root + onClicked: { root.clicked() } +// onPressed: { root.pressed() } +// onReleased: { root.released() } + } +} diff --git a/retroshare-qml-app/src/icons/attach.svg b/retroshare-qml-app/src/icons/attach.svg new file mode 100644 index 000000000..3725cf017 --- /dev/null +++ b/retroshare-qml-app/src/icons/attach.svg @@ -0,0 +1,61 @@ + +image/svg+xml \ No newline at end of file From 1df60e85cb52e87d95b169cea014903e5c833033 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 19:11:37 +0200 Subject: [PATCH 025/107] Style inferior panel and add icon buttons --- retroshare-qml-app/src/ChatView.qml | 88 +++++++++++++++---- .../src/styles/ChatBubblesStyle.qml | 55 +++++++++--- 2 files changed, 112 insertions(+), 31 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 625ceb1c4..efbe38d81 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -20,7 +20,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton - +import "./components" Item { id: chatView @@ -73,26 +73,76 @@ Item } - TextField - { - id: msgComposer - anchors.bottom: parent.bottom - anchors.left: parent.left - width: chatView.width - sendButton.width - } + Item { - Button - { - id: sendButton - text: "Send" - anchors.bottom: parent.bottom - anchors.right: parent.right + property var styles: StyleChat.inferiorPanel - onClicked: - { - var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text} - rsApi.request( "/chat/send_message", JSON.stringify(jsonData), - function(par) { msgComposer.text = ""; } ) + id: inferiorPanel + height: styles.height + width: parent.width + anchors.bottom: parent.bottom + + Rectangle { + anchors.fill: parent.fill + width: parent.width + height: parent.height + color:inferiorPanel.styles.backgroundColor + border.color: inferiorPanel.styles.borderColor } + + BtnIcon { + + id: attachButton + + property var styles: StyleChat.inferiorPanel.btnIcon + + height: styles.height + width: styles.width + + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + + imgUrl: styles.attachIconUrl + } + + + TextField + { + property var styles: StyleChat.inferiorPanel.msgComposer + + id: msgComposer + anchors.bottom: parent.bottom + anchors.left: attachButton.right + + width: chatView.width - sendButton.width - attachButton.width + height: parent.height -5 + + placeholderText: styles.placeHolder + background: styles.background + + } + + BtnIcon { + + id: sendButton + + property var styles: StyleChat.inferiorPanel.btnIcon + + height: styles.height + width: styles.width + + anchors.verticalCenter: parent.verticalCenter + anchors.left: msgComposer.right + + imgUrl: styles.sendIconUrl + + onClicked: + { + var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text} + rsApi.request( "/chat/send_message", JSON.stringify(jsonData), + function(par) { msgComposer.text = ""; } ) + } + } + } } diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 1c07bfcf0..ba3c879d1 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -5,23 +5,54 @@ QtObject { property QtObject bubble: QtObject{ // Bubble measures - readonly property int lMarginBubble: 10 - readonly property int rMarginBubble: 10 - readonly property int tMarginBubble: 5 - readonly property int bMarginBubble: 10 - readonly property int aditionalBubbleHeight: tMarginBubble * 2 - readonly property int aditionalBubbleWidth: 30 - readonly property real bubbleMaxWidth: 0.5 // % from parent + readonly property int lMarginBubble: 10 + readonly property int rMarginBubble: 10 + readonly property int tMarginBubble: 5 + readonly property int bMarginBubble: 10 + readonly property int aditionalBubbleHeight: tMarginBubble * 2 + readonly property int aditionalBubbleWidth: 30 + readonly property real bubbleMaxWidth: 0.5 // % from parent // BubbleProps - readonly property int radius: 5 + readonly property int radius: 5 // Colors - readonly property string colorIncoming: "lightGreen" - readonly property string colorOutgoing: "aliceblue" - readonly property string colorSenderName: "cornflowerblue" - readonly property string colorMessageTime: "grey" + readonly property string colorIncoming: "lightGreen" + readonly property string colorOutgoing: "aliceblue" + readonly property string colorSenderName: "cornflowerblue" + readonly property string colorMessageTime: "grey" + + } + + + property QtObject inferiorPanel: QtObject{ + // Panel globals + readonly property int height: 40 + readonly property string backgroundColor: "transparent" + readonly property string borderColor: "lightGrey" + + property QtObject msgComposer: QtObject{ + readonly property string placeHolder: "Send message..." + + property QtObject background: Rectangle { + color: "transparent" + } + } + + + // Button Icon + property QtObject btnIcon: QtObject{ + readonly property int width: 30 + readonly property int height: 30 + + readonly property string sendIconUrl: "/icons/send-message.svg" + readonly property string attachIconUrl: "/icons/attach.svg" + + } + + + } From f7c52da4bb416313f3950d3c340257d59d4794f1 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 19:12:01 +0200 Subject: [PATCH 026/107] Add new files to qml.qrc --- retroshare-qml-app/src/qml.qrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index cb360b546..5bbdd35c3 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -32,5 +32,8 @@ ChatCache.qml ChatBubbleDelegate.qml styles/ChatBubblesStyle.qml + icons/send-message.svg + icons/attach.svg + components/BtnIcon.qml From 1e234c2015eb3df16f0e04ca75b06ee6287f729f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 8 Jun 2017 19:12:15 +0200 Subject: [PATCH 027/107] Delete junk code --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 49e2cf8b2..87936f574 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -2,8 +2,6 @@ import QtQuick 2.7 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 import "." // To load styles -//import './styles' -//import "styles/ChatBubblesStyle.qml" as Style Item { From c9f39af4c455b6020f44db7707894f8e71603f3e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 15:49:25 +0200 Subject: [PATCH 028/107] Change inferior panel color to white --- retroshare-qml-app/src/styles/ChatBubblesStyle.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index ba3c879d1..9490b33ef 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -29,7 +29,7 @@ QtObject { property QtObject inferiorPanel: QtObject{ // Panel globals readonly property int height: 40 - readonly property string backgroundColor: "transparent" + readonly property string backgroundColor: "white" readonly property string borderColor: "lightGrey" property QtObject msgComposer: QtObject{ From 3746e22b2728db564f5e6d9701fa402b887f447e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 15:58:39 +0200 Subject: [PATCH 029/107] Give more space to time and message in the sended messages bubbles --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 87936f574..a0e27a4b4 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -51,7 +51,9 @@ Item { anchors.left: (model.incoming)? parent.left : undefined anchors.right:(!model.incoming)? parent.right : undefined - height: (model.incoming)? implicitHeight : 0 + // Used for give minimum heigh to time when the message is bigger than the bubble in sended messages + height: (model.incoming || !model.incoming && + mesageText.implicitWidth >= (rootBubble.width * styles.bubbleMaxWidth) )? implicitHeight : 0 } Text { @@ -66,13 +68,14 @@ Item { anchors.leftMargin: styles.lMarginBubble anchors.rightMargin: styles.rMarginBubble anchors.topMargin: styles.tMarginBubble + } Text { id: mesageText text: model.msg - width: rootBubble.width * styles.bubbleMaxWidth + width: rootBubble.width * styles.bubbleMaxWidth + timeText.width anchors.left: (model.incoming)? parent.left : undefined anchors.right:(!model.incoming)? parent.right : undefined @@ -80,9 +83,10 @@ Item { anchors.leftMargin: styles.lMarginBubble anchors.rightMargin: styles.rMarginBubble - horizontalAlignment: (!model.incoming && - mesageText.implicitWidth <= (rootBubble.width * styles.bubbleMaxWidth) - )? Text.AlignRight : Text.AlignLeft + // Used for the correct alineation when the message must be on right + horizontalAlignment:(!model.incoming && + mesageText.implicitWidth <= (rootBubble.width * styles.bubbleMaxWidth) + )? Text.AlignRight : Text.AlignLeft wrapMode: Text.Wrap } From 5acc8f6d8b6b0c7d3de87a4dceaaac1344ca3b3d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 16:17:13 +0200 Subject: [PATCH 030/107] Add new icons for new future features --- retroshare-qml-app/src/icons/microphone.svg | 148 ++++++++++++++++ .../src/icons/microphone_mute.svg | 164 ++++++++++++++++++ retroshare-qml-app/src/icons/smiley.svg | 102 +++++++++++ retroshare-qml-app/src/qml.qrc | 3 + 4 files changed, 417 insertions(+) create mode 100644 retroshare-qml-app/src/icons/microphone.svg create mode 100644 retroshare-qml-app/src/icons/microphone_mute.svg create mode 100644 retroshare-qml-app/src/icons/smiley.svg diff --git a/retroshare-qml-app/src/icons/microphone.svg b/retroshare-qml-app/src/icons/microphone.svg new file mode 100644 index 000000000..b6e01290b --- /dev/null +++ b/retroshare-qml-app/src/icons/microphone.svg @@ -0,0 +1,148 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/microphone_mute.svg b/retroshare-qml-app/src/icons/microphone_mute.svg new file mode 100644 index 000000000..7025ac193 --- /dev/null +++ b/retroshare-qml-app/src/icons/microphone_mute.svg @@ -0,0 +1,164 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/smiley.svg b/retroshare-qml-app/src/icons/smiley.svg new file mode 100644 index 000000000..618367e43 --- /dev/null +++ b/retroshare-qml-app/src/icons/smiley.svg @@ -0,0 +1,102 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 5bbdd35c3..7228adc1a 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -35,5 +35,8 @@ icons/send-message.svg icons/attach.svg components/BtnIcon.qml + icons/smiley.svg + icons/microphone_mute.svg + icons/microphone.svg From 6e3de735016bf804e6742f6565c4aafa452d1975 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 16:36:38 +0200 Subject: [PATCH 031/107] Add new icons and icons features for future implementations --- retroshare-qml-app/src/ChatView.qml | 78 +++++++++++++++++-- retroshare-qml-app/src/components/BtnIcon.qml | 8 +- .../src/styles/ChatBubblesStyle.qml | 6 ++ 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index efbe38d81..46c78125c 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -114,17 +114,28 @@ Item anchors.bottom: parent.bottom anchors.left: attachButton.right - width: chatView.width - sendButton.width - attachButton.width + width: chatView.width - sendButton.width - attachButton.width - emojiButton.width height: parent.height -5 placeholderText: styles.placeHolder background: styles.background + onTextChanged: { + if (msgComposer.length == 0) + { + sendButton.state = "" + } + else if (msgComposer.length > 0) + { + sendButton.state = "SENDBTN" + } + } + } BtnIcon { - id: sendButton + id: emojiButton property var styles: StyleChat.inferiorPanel.btnIcon @@ -134,14 +145,69 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.left: msgComposer.right - imgUrl: styles.sendIconUrl + imgUrl: styles.emojiIconUrl + } + + BtnIcon { + + id: sendButton + + property var styles: StyleChat.inferiorPanel.btnIcon + property alias icon: sendButton.imgUrl + + height: styles.height + width: styles.width + + anchors.verticalCenter: parent.verticalCenter + anchors.left: emojiButton.right + + imgUrl: styles.microIconUrl onClicked: { - var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text} - rsApi.request( "/chat/send_message", JSON.stringify(jsonData), - function(par) { msgComposer.text = ""; } ) + if (sendButton.state == "SENDBTN" ) { + var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text} + rsApi.request( "/chat/send_message", JSON.stringify(jsonData), + function(par) { msgComposer.text = ""; } ) + } } + + onPressed: + { + if (sendButton.state == "RECORDING" ) + { + sendButton.state = "" + } + else if (sendButton.state == "" ) + { + sendButton.state = "RECORDING" + } + } + + onReleased: + { + if (sendButton.state == "RECORDING" ) + { + sendButton.state = "" + } + + } + + + states: [ + State { + name: "" + PropertyChanges { target: sendButton; icon: styles.microIconUrl} + }, + State { + name: "RECORDING" + PropertyChanges { target: sendButton; icon: styles.microMuteIconUrl} + }, + State { + name: "SENDBTN" + PropertyChanges { target: sendButton; icon: styles.sendIconUrl} + } + ] } } diff --git a/retroshare-qml-app/src/components/BtnIcon.qml b/retroshare-qml-app/src/components/BtnIcon.qml index 0f707f0cf..6ce4f9e99 100644 --- a/retroshare-qml-app/src/components/BtnIcon.qml +++ b/retroshare-qml-app/src/components/BtnIcon.qml @@ -4,8 +4,8 @@ Item { id: root signal clicked -// signal pressed -// signal released + signal pressed + signal released property var imgUrl: "" @@ -21,7 +21,7 @@ Item { MouseArea { anchors.fill: root onClicked: { root.clicked() } -// onPressed: { root.pressed() } -// onReleased: { root.released() } + onPressed: { root.pressed() } + onReleased: { root.released() } } } diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 9490b33ef..63a836c58 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -46,8 +46,14 @@ QtObject { readonly property int width: 30 readonly property int height: 30 + readonly property int margin: 10 + readonly property string sendIconUrl: "/icons/send-message.svg" readonly property string attachIconUrl: "/icons/attach.svg" + readonly property string microIconUrl: "/icons/microphone.svg" + readonly property string microMuteIconUrl: "/icons/microphone_mute.svg" + readonly property string emojiIconUrl: "/icons/smiley.svg" + } From 80b4c839bb8910aba937f28b7392e4631c3ea298 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 17:58:52 +0200 Subject: [PATCH 032/107] Refactor message composer to fit text size and wrap it --- retroshare-qml-app/src/ChatView.qml | 37 +++++++++++++------ .../src/styles/ChatBubblesStyle.qml | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 46c78125c..2bdbfc31c 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -18,6 +18,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.2 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton import "./components" @@ -78,11 +79,12 @@ Item property var styles: StyleChat.inferiorPanel id: inferiorPanel - height: styles.height + height: (msgComposer.height > styles.height)? msgComposer.height: styles.height width: parent.width anchors.bottom: parent.bottom Rectangle { + id: backgroundRectangle anchors.fill: parent.fill width: parent.width height: parent.height @@ -99,27 +101,36 @@ Item height: styles.height width: styles.width - anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left + anchors.bottom: parent.bottom + + anchors.margins: styles.margin imgUrl: styles.attachIconUrl } - TextField + TextArea { property var styles: StyleChat.inferiorPanel.msgComposer - id: msgComposer - anchors.bottom: parent.bottom + + anchors.verticalCenter: parent.verticalCenter anchors.left: attachButton.right - width: chatView.width - sendButton.width - attachButton.width - emojiButton.width - height: parent.height -5 + height: (contentHeight > font.pixelSize)? contentHeight +font.pixelSize : parent.styles.height + width: chatView.width - + (sendButton.width + sendButton.anchors.margins) - + (attachButton.width + attachButton.anchors.margins) - + (emojiButton.width + emojiButton.anchors.margins) + + placeholderText: styles.placeHolder background: styles.background + wrapMode: TextEdit.Wrap + onTextChanged: { if (msgComposer.length == 0) { @@ -142,8 +153,10 @@ Item height: styles.height width: styles.width - anchors.verticalCenter: parent.verticalCenter - anchors.left: msgComposer.right + anchors.right: sendButton.left + anchors.bottom: parent.bottom + + anchors.margins: styles.margin imgUrl: styles.emojiIconUrl } @@ -158,8 +171,10 @@ Item height: styles.height width: styles.width - anchors.verticalCenter: parent.verticalCenter - anchors.left: emojiButton.right + anchors.right: parent.right + anchors.bottom: parent.bottom + + anchors.margins: styles.margin imgUrl: styles.microIconUrl diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 63a836c58..6e1c8c67d 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -46,7 +46,7 @@ QtObject { readonly property int width: 30 readonly property int height: 30 - readonly property int margin: 10 + readonly property int margin: 5 readonly property string sendIconUrl: "/icons/send-message.svg" readonly property string attachIconUrl: "/icons/attach.svg" From 2809a9638a6953f8c7e7b54868751274d9f01231 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 18:01:31 +0200 Subject: [PATCH 033/107] Change bubbles spacing from parent --- retroshare-qml-app/src/ChatView.qml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 2bdbfc31c..acc336d34 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -64,12 +64,12 @@ Item ListView { id: chatListView - width: parent.width - 7 + width: parent.width - 20 anchors.horizontalCenter: parent.horizontalCenter height: 300 model: chatModel.model delegate: ChatBubbleDelegate {} - spacing: 3 + spacing: 10 preferredHighlightBegin: 1 } @@ -124,8 +124,6 @@ Item (attachButton.width + attachButton.anchors.margins) - (emojiButton.width + emojiButton.anchors.margins) - - placeholderText: styles.placeHolder background: styles.background From ee0b3472000db769a41e798693f76ee6028111ce Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 19:00:15 +0200 Subject: [PATCH 034/107] Set max width for text area --- retroshare-qml-app/src/ChatView.qml | 36 ++++++++++++++++--- .../src/styles/ChatBubblesStyle.qml | 8 +++-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index acc336d34..cb2e6203e 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -63,15 +63,20 @@ Item ListView { + property var styles: StyleChat.chat id: chatListView - width: parent.width - 20 + width: parent.width - styles.bubbleMargin + height: parent.height - inferiorPanel.height anchors.horizontalCenter: parent.horizontalCenter - height: 300 model: chatModel.model delegate: ChatBubbleDelegate {} - spacing: 10 + spacing: styles.bubbleSpacing preferredHighlightBegin: 1 + onHeightChanged: { + chatListView.currentIndex = count - 1 + } + } Item { @@ -79,7 +84,7 @@ Item property var styles: StyleChat.inferiorPanel id: inferiorPanel - height: (msgComposer.height > styles.height)? msgComposer.height: styles.height + height: ( msgComposer.height > styles.height)? msgComposer.height: styles.height width: parent.width anchors.bottom: parent.bottom @@ -118,12 +123,18 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.left: attachButton.right - height: (contentHeight > font.pixelSize)? contentHeight +font.pixelSize : parent.styles.height + height: setTextAreaHeight() + +//// +//// (contentHeight > font.pixelSize)? contentHeight +font.pixelSize : parent.styles.height + + width: chatView.width - (sendButton.width + sendButton.anchors.margins) - (attachButton.width + attachButton.anchors.margins) - (emojiButton.width + emojiButton.anchors.margins) + placeholderText: styles.placeHolder background: styles.background @@ -140,6 +151,21 @@ Item } } + function setTextAreaHeight (){ + if (msgComposer.height >= chatView.height / msgComposer.styles.maxHeight) + { + return msgComposer.height + } + else if (contentHeight > font.pixelSize) + { + return msgComposer.contentHeight + msgComposer.font.pixelSize + } + else + { + return parent.styles.height + } + } + } BtnIcon { diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index 6e1c8c67d..dd5246bf7 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -34,6 +34,7 @@ QtObject { property QtObject msgComposer: QtObject{ readonly property string placeHolder: "Send message..." + readonly property int maxHeight: 2 // chatListView/maxHeight property QtObject background: Rectangle { color: "transparent" @@ -56,9 +57,12 @@ QtObject { } + } - - + property QtObject chat: QtObject { + // Measures + readonly property int bubbleMargin: 20 + readonly property int bubbleSpacing: 10 } From e2d430a82a7b1902b0d60ce06708fac6957fe967 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 9 Jun 2017 19:08:52 +0200 Subject: [PATCH 035/107] Set msg field max width using row layout --- retroshare-qml-app/src/ChatView.qml | 62 +++++++++++++---------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index cb2e6203e..e921d0f79 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -115,59 +115,53 @@ Item } - TextArea - { - property var styles: StyleChat.inferiorPanel.msgComposer + RowLayout { id: msgComposer anchors.verticalCenter: parent.verticalCenter anchors.left: attachButton.right - height: setTextAreaHeight() - -//// -//// (contentHeight > font.pixelSize)? contentHeight +font.pixelSize : parent.styles.height - - width: chatView.width - (sendButton.width + sendButton.anchors.margins) - (attachButton.width + attachButton.anchors.margins) - (emojiButton.width + emojiButton.anchors.margins) - placeholderText: styles.placeHolder - background: styles.background + TextArea + { + property var styles: StyleChat.inferiorPanel.msgComposer + id: msgField - wrapMode: TextEdit.Wrap + height: + (contentHeight > font.pixelSize)? + contentHeight +font.pixelSize : parent.styles.height - onTextChanged: { - if (msgComposer.length == 0) - { - sendButton.state = "" - } - else if (msgComposer.length > 0) - { - sendButton.state = "SENDBTN" - } - } + width: parent.width - function setTextAreaHeight (){ - if (msgComposer.height >= chatView.height / msgComposer.styles.maxHeight) - { - return msgComposer.height - } - else if (contentHeight > font.pixelSize) - { - return msgComposer.contentHeight + msgComposer.font.pixelSize - } - else - { - return parent.styles.height + Layout.maximumHeight: chatView.height / styles.maxHeight + + placeholderText: styles.placeHolder + background: styles.background + + wrapMode: TextEdit.Wrap + + onTextChanged: { + if (msgComposer.length == 0) + { + sendButton.state = "" + } + else if (msgComposer.length > 0) + { + sendButton.state = "SENDBTN" + } } + } } + + BtnIcon { id: emojiButton From 12fef4bf8b3ad91de47afc5ce21a0023aae7cd81 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 10 Jun 2017 16:02:09 +0200 Subject: [PATCH 036/107] Refactor to add message text area into a flickable --- retroshare-qml-app/src/ChatView.qml | 60 ++++++++++++------- .../src/styles/ChatBubblesStyle.qml | 2 +- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index e921d0f79..c91b13c14 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -117,6 +117,7 @@ Item RowLayout { id: msgComposer + property var styles: StyleChat.inferiorPanel.msgComposer anchors.verticalCenter: parent.verticalCenter anchors.left: attachButton.right @@ -126,36 +127,49 @@ Item (attachButton.width + attachButton.anchors.margins) - (emojiButton.width + emojiButton.anchors.margins) + height: (flickable.contentHeight < styles.maxHeight)? flickable.contentHeight : styles.maxHeight - TextArea - { - property var styles: StyleChat.inferiorPanel.msgComposer - id: msgField - - height: - (contentHeight > font.pixelSize)? - contentHeight +font.pixelSize : parent.styles.height + Flickable { + id: flickable + anchors.fill: parent + flickableDirection: Flickable.VerticalFlick width: parent.width - Layout.maximumHeight: chatView.height / styles.maxHeight + contentWidth: msgField.width + contentHeight: msgField.height + contentY: contentHeight - height - placeholderText: styles.placeHolder - background: styles.background + ScrollBar.vertical: ScrollBar {} - wrapMode: TextEdit.Wrap + clip: true - onTextChanged: { - if (msgComposer.length == 0) - { - sendButton.state = "" - } - else if (msgComposer.length > 0) - { - sendButton.state = "SENDBTN" + TextArea + { + property var styles: StyleChat.inferiorPanel.msgComposer + id: msgField + + height: contentHeight + font.pixelSize + + width: parent.width + + placeholderText: styles.placeHolder + background: styles.background + + wrapMode: TextEdit.Wrap + + onTextChanged: { + if (msgField.length == 0) + { + sendButton.state = "" + } + else if (msgField.length > 0) + { + sendButton.state = "SENDBTN" + } } + } - } } @@ -199,9 +213,9 @@ Item onClicked: { if (sendButton.state == "SENDBTN" ) { - var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text} + var jsonData = {"chat_id":chatView.chatId, "msg":msgField.text} rsApi.request( "/chat/send_message", JSON.stringify(jsonData), - function(par) { msgComposer.text = ""; } ) + function(par) { msgField.text = ""; } ) } } diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml index dd5246bf7..84216a487 100644 --- a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml +++ b/retroshare-qml-app/src/styles/ChatBubblesStyle.qml @@ -34,7 +34,7 @@ QtObject { property QtObject msgComposer: QtObject{ readonly property string placeHolder: "Send message..." - readonly property int maxHeight: 2 // chatListView/maxHeight + readonly property int maxHeight: 180 property QtObject background: Rectangle { color: "transparent" From ba72332ed8ea0a3d7a070718e968f8a6d75c220a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 14:26:55 +0200 Subject: [PATCH 037/107] Move ColorHash to components directory --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 1 + retroshare-qml-app/src/{ => components}/ColorHash.qml | 0 retroshare-qml-app/src/qml.qrc | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename retroshare-qml-app/src/{ => components}/ColorHash.qml (100%) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 3d12c58d3..675d4f01b 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -19,6 +19,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import "." //Needed for ChatCache singleton +import "./components" Item { diff --git a/retroshare-qml-app/src/ColorHash.qml b/retroshare-qml-app/src/components/ColorHash.qml similarity index 100% rename from retroshare-qml-app/src/ColorHash.qml rename to retroshare-qml-app/src/components/ColorHash.qml diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 7228adc1a..46f04b9c3 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -25,7 +25,6 @@ TrustedNodeDetails.qml ClipboardWrapper.qml ContactDetails.qml - ColorHash.qml icons/rating-unrated.png icons/rating.png TimedPopup.qml @@ -38,5 +37,6 @@ icons/smiley.svg icons/microphone_mute.svg icons/microphone.svg + components/ColorHash.qml From ea8d03bc10d7f1cf203e49c52841e1408398b7e5 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 15:44:07 +0200 Subject: [PATCH 038/107] Change how do you put chat tittle saving chat name into variable on cache GXS info --- retroshare-qml-app/src/ChatCache.qml | 10 ++++++++-- retroshare-qml-app/src/ChatView.qml | 10 ++++++++-- retroshare-qml-app/src/Contacts.qml | 2 +- retroshare-qml-app/src/GxsIdentityDelegate.qml | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 478472516..fb2518cd5 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -51,7 +51,7 @@ QtObject { } function setRemoteGXS (chatId, remoteGXS){ - if (!lastMessageList[chatId]) { + if (!lastMessageList[chatId]) { lastMessageList[chatId] = {} console.log("Last message cache created!") } @@ -66,13 +66,19 @@ QtObject { function getChatIdFromGxs (gxs){ for (var key in lastMessageList) { - if ( lastMessageList[key].remoteGXS === gxs ) { + if ( lastMessageList[key].remoteGXS && + lastMessageList[key].remoteGXS.gxs === gxs ) { return key } } return "" } + function getGxsFromChatId (chatId){ + if (lastMessageList[chatId]) return lastMessageList[chatId].remoteGXS + return undefined + } + function getChatLastMessage (chatId){ if (lastMessageList[chatId]) { return lastMessageList[chatId].lastMessage diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index c91b13c14..4f0ea0fde 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -52,7 +52,12 @@ Item } ) } - Component.onCompleted: refreshData() + Component.onCompleted: { + refreshData() + toolBar.state = "CHATVIEW" + var gxs = ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) + toolBar.titleText = gxs.name + } onFocusChanged: focus && refreshData() JSONListModel @@ -256,6 +261,7 @@ Item } ] } - } + + } diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 93b43556b..a445ebe72 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -103,7 +103,7 @@ Item {'action': 'refreshUnread', 'response': par.response}) json.data.forEach (function (chat){ ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) - ChatCache.lastMessageCache.setRemoteGXS (chat.chat_id, chat.remote_author_id) + ChatCache.lastMessageCache.setRemoteGXS (chat.chat_id, { gxs: chat.remote_author_id, name: chat.remote_author_name}) }) } function refreshUnread() diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 675d4f01b..bff13f858 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -258,7 +258,7 @@ Item } function startDistantChatCB (par){ var chId = JSON.parse(par.response).data.chat_id - ChatCache.lastMessageCache.setRemoteGXS(chId, model.gxs_id) + ChatCache.lastMessageCache.setRemoteGXS(chId, { gxs: model.gxs_id, name: model.name}) contactsView.startChatCallback (par) } } From cc9415034553ecf97111bf01aa69b58b328a0988 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 15:44:50 +0200 Subject: [PATCH 039/107] Import ColorHash component on to ContactDetails view --- retroshare-qml-app/src/ContactDetails.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index 7b7cfedf8..639f00928 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -19,6 +19,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import "." //Needed for ClipboardWrapper singleton +import "./components" import "URI.js" as UriJs Item From fbb458f4c374373552052344115728b82c71cab8 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 15:48:23 +0200 Subject: [PATCH 040/107] Delete lines to change toolbar text --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index a0e27a4b4..fc4f03f4a 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 import "." // To load styles +import "./components" Item { @@ -95,11 +96,6 @@ Item { } - Component.onCompleted: { - toolBar.state = "CHATVIEW" - toolBar.titleText = model.author_name - } - function getMessageTime(){ var timeFormat = "hh:mm"; From 8b0b366f69479f3bf8fd9bcd7cc6f1c041c462b7 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 16:14:47 +0200 Subject: [PATCH 041/107] Show user hash in chat view --- retroshare-qml-app/src/ChatView.qml | 27 +++++++++++++++++++++++++-- retroshare-qml-app/src/main-app.qml | 23 ++++++++++++++++------- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 4f0ea0fde..4df845024 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -22,10 +22,12 @@ import QtQuick.Layouts 1.2 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton import "./components" + Item { id: chatView property string chatId + property var gxsInfo: "" property int token: 0 property string objectName:"chatView" @@ -55,11 +57,32 @@ Item Component.onCompleted: { refreshData() toolBar.state = "CHATVIEW" - var gxs = ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) - toolBar.titleText = gxs.name + gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) + toolBar.titleText = gxsInfo.name + toolBar.loaderSource = userHash } onFocusChanged: focus && refreshData() + Component { + id: userHash + + ColorHash + { + id: colorHash + + hash: gxsInfo.gxs + height: toolBar.height - 4 + anchors.leftMargin: 2 + + MouseArea + { + anchors.fill: parent + onClicked: delegateRoot.showDetails() + } + } + } + + JSONListModel { id: chatModel diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index f38bfc447..468da0ecd 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -58,31 +58,40 @@ ApplicationWindow { id: toolBar property alias titleText: toolBarText.text + property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" states: [ State { name: "DEFAULT" PropertyChanges { target: toolBar; titleText: defaultLabel} + PropertyChanges { target: toolBar; loaderSource: rsIcon} }, State { name: "CHATVIEW" } ] - Image - { - id: rsIcon - fillMode: Image.PreserveAspectFit - height: Math.max(30, parent.height - 4) + Loader { + id: imageLoader anchors.verticalCenter: parent.verticalCenter - source: "icons/retroshare06.png" + height: Math.max(30, toolBar.height - 4) } + + Component { + id: rsIcon + Image + { + fillMode: Image.PreserveAspectFit + source: "icons/retroshare06.png" + } + } + Label { id: toolBarText anchors.verticalCenter: parent.verticalCenter - anchors.left: rsIcon.right + anchors.left: imageLoader.right anchors.leftMargin: 20 } MouseArea From 912d26c47cfa0257a00e1630af86407b9ccbf015 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 16:23:41 +0200 Subject: [PATCH 042/107] Change unread text max width --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index bff13f858..42bb656f6 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -131,12 +131,14 @@ Item height: parent.height /2 + Text { id: lastMessageSender font.italic: true color: "royalblue" text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" + height: parent.height } Text @@ -148,6 +150,7 @@ Item elide: Text.ElideRight color: "darkslategrey" width: chatInfoRow.width - 30 + height: parent.height } Rectangle From f8669b86e69a118897b17c2b34d0c4f8535e4974 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 16:39:33 +0200 Subject: [PATCH 043/107] Delete mouse area action on user hash icon --- retroshare-qml-app/src/ChatView.qml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 4df845024..24af408fa 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -73,12 +73,6 @@ Item hash: gxsInfo.gxs height: toolBar.height - 4 anchors.leftMargin: 2 - - MouseArea - { - anchors.fill: parent - onClicked: delegateRoot.showDetails() - } } } @@ -285,6 +279,4 @@ Item ] } } - - } From fbd4d3a913fdc4293b7b6d280768127523ad98dc Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 17:54:53 +0200 Subject: [PATCH 044/107] Handle properly intro key to send message and shif+intro to new line on message composer --- retroshare-qml-app/src/ChatView.qml | 40 +++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 24af408fa..1a14a378b 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -180,6 +180,8 @@ Item wrapMode: TextEdit.Wrap + focus: true + onTextChanged: { if (msgField.length == 0) { @@ -191,9 +193,32 @@ Item } } + property bool shiftPressed: false + Keys.onPressed: + { + if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) + && !shiftPressed) + { + if (sendButton.state == "SENDBTN" ) { + chatView.sendMessage () + } + } + else if (event.key === Qt.Key_Shift) + { + shiftPressed = true + } + } + + Keys.onReleased: + { + if (event.key === Qt.Key_Shift) + { + shiftPressed = false + } + } + } } - } @@ -235,9 +260,7 @@ Item onClicked: { if (sendButton.state == "SENDBTN" ) { - var jsonData = {"chat_id":chatView.chatId, "msg":msgField.text} - rsApi.request( "/chat/send_message", JSON.stringify(jsonData), - function(par) { msgField.text = ""; } ) + chatView.sendMessage () } } @@ -262,7 +285,6 @@ Item } - states: [ State { name: "" @@ -279,4 +301,12 @@ Item ] } } + + function sendMessage () + { + var jsonData = {"chat_id":chatView.chatId, "msg":msgField.text} + rsApi.request( "/chat/send_message", JSON.stringify(jsonData), + function(par) { msgField.text = ""; } ) + } + } From ccc4afff4e53a8862398db4de1d928c3ce3d2e9c Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 12 Jun 2017 18:18:17 +0200 Subject: [PATCH 045/107] Update search box background color --- retroshare-qml-app/src/Contacts.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index a445ebe72..7c68bbe7f 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -180,6 +180,8 @@ Item border.width: 2 radius: 5 border.color: searchText.focus ? "cornflowerblue" : "lightgrey" + color: searchText.focus ? "white" : "ghostwhite" + } onTextChanged: contactsSortWorker.sendMessage( From dc02fe034e13ab2543ba97d13cfc2450488a5250 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:24:07 +0200 Subject: [PATCH 046/107] Add left margin to toolbar --- retroshare-qml-app/src/main-app.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 468da0ecd..2b40b54ef 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import QtQuick 2.7 +import QtQuick 2.1 import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "URI.js" as UriJs @@ -61,7 +61,8 @@ ApplicationWindow property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" - states: [ + states: + [ State { name: "DEFAULT" PropertyChanges { target: toolBar; titleText: defaultLabel} @@ -72,13 +73,22 @@ ApplicationWindow } ] - Loader { + Item + { + id: tolbarLeftPadding + width: 4 + } + + Loader + { id: imageLoader anchors.verticalCenter: parent.verticalCenter height: Math.max(30, toolBar.height - 4) + anchors.left: tolbarLeftPadding.right } - Component { + Component + { id: rsIcon Image { From 0a9c29f0b9c266d08ae218318194cedc53815f42 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:40:05 +0200 Subject: [PATCH 047/107] Solve bug with undefined props in lastMessage object --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 42bb656f6..bd53a029e 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -137,7 +137,7 @@ Item id: lastMessageSender font.italic: true color: "royalblue" - text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" + text: ((lastMessageData && lastMessageData.incoming !== undefined) && !lastMessageData.incoming)? "You: " : "" height: parent.height } @@ -145,7 +145,7 @@ Item { id: lastMessageMsg anchors.left: lastMessageSender.right - text: (lastMessageData.msg) ? lastMessageData.msg : "" + text: (lastMessageData && lastMessageData.msg !== undefined)? lastMessageData.msg : "" rightPadding: 5 elide: Text.ElideRight color: "darkslategrey" @@ -210,7 +210,7 @@ Item } if (chatId) { var last = getChatLastMessage(chatId) - if (last) lastMessageData = getChatLastMessage(chatId) + if (last) lastMessageData = last } } @@ -237,7 +237,7 @@ Item return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } function setTime(){ - if (!lastMessageData.recv_time){ + if (!lastMessageData || lastMessageData.recv_time === undefined){ return "" } var timeFormat = "dd.MM.yyyy"; From 4b05555a5c4b8eaa22a6455d51597be4aecba632 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:43:25 +0200 Subject: [PATCH 048/107] Change version of QtQml to 2.3 --- retroshare-qml-app/src/ChatCache.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index fb2518cd5..92b1b277a 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -1,6 +1,6 @@ pragma Singleton -import QtQml 2.7 +import QtQml 2.3 import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import Qt.labs.settings 1.0 From 7c6638f4e9446017b17f4b48371049584623a524 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:51:53 +0200 Subject: [PATCH 049/107] Change to Almman indent style --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 19 ++++++---- retroshare-qml-app/src/ChatCache.qml | 27 +++++++++----- retroshare-qml-app/src/Contacts.qml | 8 +++-- .../src/GxsIdentityDelegate.qml | 36 +++++++++---------- retroshare-qml-app/src/main-app.qml | 15 +++++--- 5 files changed, 63 insertions(+), 42 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index fc4f03f4a..3b620a5fd 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -4,7 +4,8 @@ import QtQuick.Controls 2.0 import "." // To load styles import "./components" -Item { +Item +{ id: chatBubbleDelegate height: bubble.height @@ -13,7 +14,8 @@ Item { property var styles: StyleChat.bubble - Rectangle { + Rectangle + { id: rootBubble anchors.fill: parent width: parent.width @@ -37,7 +39,8 @@ Item { radius: styles.radius - Text { + Text + { id: sendersName visible: model.incoming text: (model.incoming)? model.author_name + ":" : "" @@ -57,7 +60,8 @@ Item { mesageText.implicitWidth >= (rootBubble.width * styles.bubbleMaxWidth) )? implicitHeight : 0 } - Text { + Text + { id: timeText text: getMessageTime() color: styles.colorMessageTime @@ -73,7 +77,8 @@ Item { } - Text { + Text + { id: mesageText text: model.msg width: rootBubble.width * styles.bubbleMaxWidth + timeText.width @@ -96,8 +101,8 @@ Item { } - function getMessageTime(){ - + function getMessageTime() + { var timeFormat = "hh:mm"; var recvDate = new Date(model.recv_time*1000) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 92b1b277a..76902d027 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -5,7 +5,8 @@ import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import Qt.labs.settings 1.0 -QtObject { +QtObject +{ id: chatCache @@ -17,7 +18,8 @@ QtObject { signal lastMessageChanged(var chatI, var newLastMessage) - function updateLastMessageCache (chatId, chatModel){ + function updateLastMessageCache (chatId, chatModel) + { console.log("updateLastMessageCache (chatId, chatModel)", chatId) // First creates the chat id object for don't wait to work with the object if is needed to call RS api if (!lastMessageList[chatId]) { @@ -33,24 +35,28 @@ QtObject { } } - function updateLastMessage (chatId, chatModel){ + function updateLastMessage (chatId, chatModel) + { console.log("updateLastMessage (chatId, chatModel)") var lastMessage = findChatLastMessage (chatModel) lastMessageList[chatId].lastMessage = lastMessage lastMessageChanged(chatId, lastMessage) } - function findChatLastMessage (chatModel){ + function findChatLastMessage (chatModel) + { var messagesData = JSON.parse(chatModel).data return messagesData.slice(-1)[0] } - function findChatFirstMessage (chatModel){ + function findChatFirstMessage (chatModel) + { var messagesData = JSON.parse(chatModel).data return messagesData.slice[0] } - function setRemoteGXS (chatId, remoteGXS){ + function setRemoteGXS (chatId, remoteGXS) + { if (!lastMessageList[chatId]) { lastMessageList[chatId] = {} console.log("Last message cache created!") @@ -64,7 +70,8 @@ QtObject { } } - function getChatIdFromGxs (gxs){ + function getChatIdFromGxs (gxs) + { for (var key in lastMessageList) { if ( lastMessageList[key].remoteGXS && lastMessageList[key].remoteGXS.gxs === gxs ) { @@ -74,12 +81,14 @@ QtObject { return "" } - function getGxsFromChatId (chatId){ + function getGxsFromChatId (chatId) + { if (lastMessageList[chatId]) return lastMessageList[chatId].remoteGXS return undefined } - function getChatLastMessage (chatId){ + function getChatLastMessage (chatId) + { if (lastMessageList[chatId]) { return lastMessageList[chatId].lastMessage } diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 7c68bbe7f..8b3a8f754 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -101,7 +101,8 @@ Item TokensManager.registerToken(json.statetoken, refreshUnread) contactsSortWorker.sendMessage( {'action': 'refreshUnread', 'response': par.response}) - json.data.forEach (function (chat){ + json.data.forEach (function (chat) + { ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) ChatCache.lastMessageCache.setRemoteGXS (chat.chat_id, { gxs: chat.remote_author_id, name: chat.remote_author_name}) }) @@ -176,13 +177,14 @@ Item width: parent.width - searchIcon.width - 5 anchors.leftMargin: 5 - background: Rectangle { + background: Rectangle + { border.width: 2 radius: 5 border.color: searchText.focus ? "cornflowerblue" : "lightgrey" color: searchText.focus ? "white" : "ghostwhite" - } + onTextChanged: contactsSortWorker.sendMessage( {'action': 'searchContact', 'sexp': text}) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index bd53a029e..21ed893c0 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -33,14 +33,14 @@ Item property var locale: Qt.locale() - Rectangle { + Rectangle + { anchors.fill: parent color: contactItem.containsMouse ? "lightgrey" : "transparent" width: parent.width height: parent.height - MouseArea { id: contactItem @@ -117,11 +117,7 @@ Item text: setTime() anchors.right: parent.right color: "darkslategrey" - } - - - } Item @@ -130,8 +126,6 @@ Item width: parent.width height: parent.height /2 - - Text { id: lastMessageSender @@ -204,7 +198,8 @@ Item } - Component.onCompleted: { + Component.onCompleted: + { if (!chatId){ chatId = getChatIdFromGXS() } @@ -214,7 +209,8 @@ Item } } - Connections { + Connections + { target: ChatCache.lastMessageCache onLastMessageChanged: { if (!chatId) { @@ -228,23 +224,26 @@ Item } - function getChatLastMessage (chatId){ + function getChatLastMessage (chatId) + { return ChatCache.lastMessageCache.getChatLastMessage(chatId) } - function getChatIdFromGXS (){ + function getChatIdFromGXS () + { var id= ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } - function setTime(){ - if (!lastMessageData || lastMessageData.recv_time === undefined){ - return "" - } + function setTime() + { + if (!lastMessageData || lastMessageData.recv_time === undefined) return "" + var timeFormat = "dd.MM.yyyy"; var recvDate = new Date(lastMessageData.recv_time*1000) // Check if is today - if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) { + if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) + { timeFormat = "hh:mm" } var timeString = Qt.formatDateTime(recvDate, timeFormat) @@ -259,7 +258,8 @@ Item "qrc:/ContactDetails.qml", {md: contactsListView.model.get(index)}) } - function startDistantChatCB (par){ + function startDistantChatCB (par) + { var chId = JSON.parse(par.response).data.chat_id ChatCache.lastMessageCache.setRemoteGXS(chId, { gxs: model.gxs_id, name: model.name}) contactsView.startChatCallback (par) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 2b40b54ef..4c0fe38de 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -63,12 +63,14 @@ ApplicationWindow states: [ - State { + State + { name: "DEFAULT" PropertyChanges { target: toolBar; titleText: defaultLabel} PropertyChanges { target: toolBar; loaderSource: rsIcon} }, - State { + State + { name: "CHATVIEW" } ] @@ -166,9 +168,12 @@ ApplicationWindow id: stackView anchors.fill: parent focus: true - onCurrentItemChanged: { - if (currentItem) { - if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT"){ + onCurrentItemChanged: + { + if (currentItem) + { + if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT") + { toolBar.state = "DEFAULT" } currentItem.focus = true From 9f26a0aec56d0ac06ee26ef1d582f5a417963a51 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:51:53 +0200 Subject: [PATCH 050/107] Change to Almman indent style --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 19 ++++--- retroshare-qml-app/src/ChatCache.qml | 27 ++++++---- retroshare-qml-app/src/ChatView.qml | 54 ++++++++++++------- retroshare-qml-app/src/Contacts.qml | 8 +-- .../src/GxsIdentityDelegate.qml | 36 ++++++------- retroshare-qml-app/src/main-app.qml | 15 ++++-- 6 files changed, 98 insertions(+), 61 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index fc4f03f4a..3b620a5fd 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -4,7 +4,8 @@ import QtQuick.Controls 2.0 import "." // To load styles import "./components" -Item { +Item +{ id: chatBubbleDelegate height: bubble.height @@ -13,7 +14,8 @@ Item { property var styles: StyleChat.bubble - Rectangle { + Rectangle + { id: rootBubble anchors.fill: parent width: parent.width @@ -37,7 +39,8 @@ Item { radius: styles.radius - Text { + Text + { id: sendersName visible: model.incoming text: (model.incoming)? model.author_name + ":" : "" @@ -57,7 +60,8 @@ Item { mesageText.implicitWidth >= (rootBubble.width * styles.bubbleMaxWidth) )? implicitHeight : 0 } - Text { + Text + { id: timeText text: getMessageTime() color: styles.colorMessageTime @@ -73,7 +77,8 @@ Item { } - Text { + Text + { id: mesageText text: model.msg width: rootBubble.width * styles.bubbleMaxWidth + timeText.width @@ -96,8 +101,8 @@ Item { } - function getMessageTime(){ - + function getMessageTime() + { var timeFormat = "hh:mm"; var recvDate = new Date(model.recv_time*1000) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 92b1b277a..76902d027 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -5,7 +5,8 @@ import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import Qt.labs.settings 1.0 -QtObject { +QtObject +{ id: chatCache @@ -17,7 +18,8 @@ QtObject { signal lastMessageChanged(var chatI, var newLastMessage) - function updateLastMessageCache (chatId, chatModel){ + function updateLastMessageCache (chatId, chatModel) + { console.log("updateLastMessageCache (chatId, chatModel)", chatId) // First creates the chat id object for don't wait to work with the object if is needed to call RS api if (!lastMessageList[chatId]) { @@ -33,24 +35,28 @@ QtObject { } } - function updateLastMessage (chatId, chatModel){ + function updateLastMessage (chatId, chatModel) + { console.log("updateLastMessage (chatId, chatModel)") var lastMessage = findChatLastMessage (chatModel) lastMessageList[chatId].lastMessage = lastMessage lastMessageChanged(chatId, lastMessage) } - function findChatLastMessage (chatModel){ + function findChatLastMessage (chatModel) + { var messagesData = JSON.parse(chatModel).data return messagesData.slice(-1)[0] } - function findChatFirstMessage (chatModel){ + function findChatFirstMessage (chatModel) + { var messagesData = JSON.parse(chatModel).data return messagesData.slice[0] } - function setRemoteGXS (chatId, remoteGXS){ + function setRemoteGXS (chatId, remoteGXS) + { if (!lastMessageList[chatId]) { lastMessageList[chatId] = {} console.log("Last message cache created!") @@ -64,7 +70,8 @@ QtObject { } } - function getChatIdFromGxs (gxs){ + function getChatIdFromGxs (gxs) + { for (var key in lastMessageList) { if ( lastMessageList[key].remoteGXS && lastMessageList[key].remoteGXS.gxs === gxs ) { @@ -74,12 +81,14 @@ QtObject { return "" } - function getGxsFromChatId (chatId){ + function getGxsFromChatId (chatId) + { if (lastMessageList[chatId]) return lastMessageList[chatId].remoteGXS return undefined } - function getChatLastMessage (chatId){ + function getChatLastMessage (chatId) + { if (lastMessageList[chatId]) { return lastMessageList[chatId].lastMessage } diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 1a14a378b..2c171bc54 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -51,10 +51,11 @@ Item chatListView.positionViewAtEnd() rsApi.request("/chat/mark_chat_as_read/"+chatId) } - } ) + }) } - Component.onCompleted: { + Component.onCompleted: + { refreshData() toolBar.state = "CHATVIEW" gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) @@ -63,7 +64,8 @@ Item } onFocusChanged: focus && refreshData() - Component { + Component + { id: userHash ColorHash @@ -95,13 +97,15 @@ Item spacing: styles.bubbleSpacing preferredHighlightBegin: 1 - onHeightChanged: { + onHeightChanged: + { chatListView.currentIndex = count - 1 } } - Item { + Item + { property var styles: StyleChat.inferiorPanel @@ -110,7 +114,8 @@ Item width: parent.width anchors.bottom: parent.bottom - Rectangle { + Rectangle + { id: backgroundRectangle anchors.fill: parent.fill width: parent.width @@ -119,7 +124,8 @@ Item border.color: inferiorPanel.styles.borderColor } - BtnIcon { + BtnIcon + { id: attachButton @@ -137,7 +143,8 @@ Item } - RowLayout { + RowLayout + { id: msgComposer property var styles: StyleChat.inferiorPanel.msgComposer @@ -151,7 +158,8 @@ Item height: (flickable.contentHeight < styles.maxHeight)? flickable.contentHeight : styles.maxHeight - Flickable { + Flickable + { id: flickable anchors.fill: parent flickableDirection: Flickable.VerticalFlick @@ -182,7 +190,8 @@ Item focus: true - onTextChanged: { + onTextChanged: + { if (msgField.length == 0) { sendButton.state = "" @@ -199,7 +208,8 @@ Item if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && !shiftPressed) { - if (sendButton.state == "SENDBTN" ) { + if (sendButton.state == "SENDBTN" ) + { chatView.sendMessage () } } @@ -216,14 +226,14 @@ Item shiftPressed = false } } - } } } - BtnIcon { + BtnIcon + { id: emojiButton @@ -240,7 +250,8 @@ Item imgUrl: styles.emojiIconUrl } - BtnIcon { + BtnIcon + { id: sendButton @@ -259,7 +270,8 @@ Item onClicked: { - if (sendButton.state == "SENDBTN" ) { + if (sendButton.state == "SENDBTN" ) + { chatView.sendMessage () } } @@ -285,16 +297,20 @@ Item } - states: [ - State { + states: + [ + State + { name: "" PropertyChanges { target: sendButton; icon: styles.microIconUrl} }, - State { + State + { name: "RECORDING" PropertyChanges { target: sendButton; icon: styles.microMuteIconUrl} }, - State { + State + { name: "SENDBTN" PropertyChanges { target: sendButton; icon: styles.sendIconUrl} } diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 7c68bbe7f..8b3a8f754 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -101,7 +101,8 @@ Item TokensManager.registerToken(json.statetoken, refreshUnread) contactsSortWorker.sendMessage( {'action': 'refreshUnread', 'response': par.response}) - json.data.forEach (function (chat){ + json.data.forEach (function (chat) + { ChatCache.lastMessageCache.updateLastMessageCache(chat.chat_id) ChatCache.lastMessageCache.setRemoteGXS (chat.chat_id, { gxs: chat.remote_author_id, name: chat.remote_author_name}) }) @@ -176,13 +177,14 @@ Item width: parent.width - searchIcon.width - 5 anchors.leftMargin: 5 - background: Rectangle { + background: Rectangle + { border.width: 2 radius: 5 border.color: searchText.focus ? "cornflowerblue" : "lightgrey" color: searchText.focus ? "white" : "ghostwhite" - } + onTextChanged: contactsSortWorker.sendMessage( {'action': 'searchContact', 'sexp': text}) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index bd53a029e..21ed893c0 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -33,14 +33,14 @@ Item property var locale: Qt.locale() - Rectangle { + Rectangle + { anchors.fill: parent color: contactItem.containsMouse ? "lightgrey" : "transparent" width: parent.width height: parent.height - MouseArea { id: contactItem @@ -117,11 +117,7 @@ Item text: setTime() anchors.right: parent.right color: "darkslategrey" - } - - - } Item @@ -130,8 +126,6 @@ Item width: parent.width height: parent.height /2 - - Text { id: lastMessageSender @@ -204,7 +198,8 @@ Item } - Component.onCompleted: { + Component.onCompleted: + { if (!chatId){ chatId = getChatIdFromGXS() } @@ -214,7 +209,8 @@ Item } } - Connections { + Connections + { target: ChatCache.lastMessageCache onLastMessageChanged: { if (!chatId) { @@ -228,23 +224,26 @@ Item } - function getChatLastMessage (chatId){ + function getChatLastMessage (chatId) + { return ChatCache.lastMessageCache.getChatLastMessage(chatId) } - function getChatIdFromGXS (){ + function getChatIdFromGXS () + { var id= ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } - function setTime(){ - if (!lastMessageData || lastMessageData.recv_time === undefined){ - return "" - } + function setTime() + { + if (!lastMessageData || lastMessageData.recv_time === undefined) return "" + var timeFormat = "dd.MM.yyyy"; var recvDate = new Date(lastMessageData.recv_time*1000) // Check if is today - if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) { + if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) + { timeFormat = "hh:mm" } var timeString = Qt.formatDateTime(recvDate, timeFormat) @@ -259,7 +258,8 @@ Item "qrc:/ContactDetails.qml", {md: contactsListView.model.get(index)}) } - function startDistantChatCB (par){ + function startDistantChatCB (par) + { var chId = JSON.parse(par.response).data.chat_id ChatCache.lastMessageCache.setRemoteGXS(chId, { gxs: model.gxs_id, name: model.name}) contactsView.startChatCallback (par) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 2b40b54ef..4c0fe38de 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -63,12 +63,14 @@ ApplicationWindow states: [ - State { + State + { name: "DEFAULT" PropertyChanges { target: toolBar; titleText: defaultLabel} PropertyChanges { target: toolBar; loaderSource: rsIcon} }, - State { + State + { name: "CHATVIEW" } ] @@ -166,9 +168,12 @@ ApplicationWindow id: stackView anchors.fill: parent focus: true - onCurrentItemChanged: { - if (currentItem) { - if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT"){ + onCurrentItemChanged: + { + if (currentItem) + { + if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT") + { toolBar.state = "DEFAULT" } currentItem.focus = true From 88d170066c875bf38c387fd2189a9a1c4f4395fe Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 15:25:31 +0200 Subject: [PATCH 051/107] Change chat style sheet to a more apropiate name --- retroshare-qml-app/src/qml.qrc | 2 +- retroshare-qml-app/src/qmldir | 2 +- .../src/styles/{ChatBubblesStyle.qml => ChatStyle.qml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename retroshare-qml-app/src/styles/{ChatBubblesStyle.qml => ChatStyle.qml} (100%) diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 46f04b9c3..55c80b851 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -30,7 +30,6 @@ TimedPopup.qml ChatCache.qml ChatBubbleDelegate.qml - styles/ChatBubblesStyle.qml icons/send-message.svg icons/attach.svg components/BtnIcon.qml @@ -38,5 +37,6 @@ icons/microphone_mute.svg icons/microphone.svg components/ColorHash.qml + styles/ChatStyle.qml diff --git a/retroshare-qml-app/src/qmldir b/retroshare-qml-app/src/qmldir index 7a42d0162..974b69075 100644 --- a/retroshare-qml-app/src/qmldir +++ b/retroshare-qml-app/src/qmldir @@ -1,5 +1,5 @@ singleton TokensManager 1.0 TokensManager.qml singleton ClipboardWrapper 1.0 ClipboardWrapper.qml singleton ChatCache ChatCache.qml -singleton StyleChat styles/ChatBubblesStyle.qml +singleton StyleChat styles/ChatStyle.qml diff --git a/retroshare-qml-app/src/styles/ChatBubblesStyle.qml b/retroshare-qml-app/src/styles/ChatStyle.qml similarity index 100% rename from retroshare-qml-app/src/styles/ChatBubblesStyle.qml rename to retroshare-qml-app/src/styles/ChatStyle.qml From 1f1e830f01a2666b173649cd85e86ca62421e644 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 19 Jun 2017 18:03:07 +0200 Subject: [PATCH 052/107] Added Qt SVG module dependency --- retroshare-qml-app/src/retroshare-qml-app.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/retroshare-qml-app.pro b/retroshare-qml-app/src/retroshare-qml-app.pro index 338935419..558a0fe68 100644 --- a/retroshare-qml-app/src/retroshare-qml-app.pro +++ b/retroshare-qml-app/src/retroshare-qml-app.pro @@ -1,6 +1,6 @@ !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") -QT += core network qml quick +QT += core network qml quick svg CONFIG += c++11 From f56921b0e34ab9e3e1375aedaa96721b2794b1a6 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 15:19:20 +0200 Subject: [PATCH 053/107] Set AvatarOrColorHash in components folder --- retroshare-qml-app/src/{ => components}/AvatarOrColorHash.qml | 0 retroshare-qml-app/src/qml.qrc | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename retroshare-qml-app/src/{ => components}/AvatarOrColorHash.qml (100%) diff --git a/retroshare-qml-app/src/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml similarity index 100% rename from retroshare-qml-app/src/AvatarOrColorHash.qml rename to retroshare-qml-app/src/components/AvatarOrColorHash.qml diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 22a49411b..d6a115c96 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -25,7 +25,6 @@ TrustedNodeDetails.qml ClipboardWrapper.qml ContactDetails.qml - ColorHash.qml icons/rating-unrated.png icons/rating.png TimedPopup.qml @@ -39,5 +38,6 @@ icons/microphone.svg components/ColorHash.qml styles/ChatStyle.qml + components/AvatarOrColorHash.qml From 1b9a1f5087841e5e029514a9060ed238231c6b0a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 15:27:01 +0200 Subject: [PATCH 054/107] Use AvatarOrColorHash --- retroshare-qml-app/src/ChatView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 2c171bc54..eb2b66b3e 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -68,11 +68,11 @@ Item { id: userHash - ColorHash + AvatarOrColorHash { id: colorHash - hash: gxsInfo.gxs + gxs_id: gxsInfo.gxs height: toolBar.height - 4 anchors.leftMargin: 2 } From 923c0c6da37cd1fbcc5a476ee69b809972bce923 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 15:57:27 +0200 Subject: [PATCH 055/107] Open contact details on click the area --- .../src/components/AvatarOrColorHash.qml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 0cf09a9c4..0540b4627 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -25,6 +25,7 @@ Item property string gxs_id + height: 130 width: height @@ -35,6 +36,7 @@ Item property int avatarAttemptCnt: 0 function getDetails() { + console.log("getDetails() ", compRoot.gxs_id ) ++compRoot.avatarAttemptCnt rsApi.request( "/identity/get_identity_details", @@ -57,6 +59,21 @@ Item } } + function showDetails() + { + console.log("showDetails() ", gxs_id) + rsApi.request( + "/identity/get_identity_details", + JSON.stringify({ gxs_id: compRoot.gxs_id }), + function(par) + { + var jData = JSON.parse(par.response).data + stackView.push( + "qrc:/ContactDetails.qml", + {md: jData}) + }) + } + Component.onCompleted: if(visible && !has_avatar) getDetails() onVisibleChanged: if(visible && !has_avatar) getDetails() @@ -73,4 +90,10 @@ Item visible: !compRoot.has_avatar hash: compRoot.gxs_id } + + MouseArea + { + anchors.fill: parent + onClicked: showDetails() + } } From 05ca5b482ceef9641d2bebd6dc25736ac86537d1 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 16:30:48 +0200 Subject: [PATCH 056/107] Create contacts cache --- retroshare-qml-app/src/ChatCache.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 76902d027..1f774cda3 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -96,4 +96,22 @@ QtObject } } + property QtObject contactsCache: QtObject + { + id: contactsCache + property var contactsList + + function getContactFromGxsId (gxsId) + { + console.log("getContactFromGxsId (gxsId)", gxsId) + for(var i in contactsList) + { + if (contactsList[i].gxs_id == gxsId) return contactsList[i] + } + + + + } + } + } From c2b63a23139aad51c6951692b14571d84c4fc19f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 16:31:20 +0200 Subject: [PATCH 057/107] Use contacts cache to show contacts details --- retroshare-qml-app/src/Contacts.qml | 1 + .../src/components/AvatarOrColorHash.qml | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 8b3a8f754..418f62bb5 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -51,6 +51,7 @@ Item { console.log("contactsView.refreshContactsCB()", visible) var token = JSON.parse(par.response).statetoken + ChatCache.contactsCache.contactsList = JSON.parse(par.response).data TokensManager.registerToken(token, refreshContacts) contactsSortWorker.sendMessage( {'action': 'refreshContacts', 'response': par.response}) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 0540b4627..04dbda40f 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -17,6 +17,7 @@ */ import QtQuick 2.7 +import "../" //Needed for Chat Cache Item @@ -62,16 +63,11 @@ Item function showDetails() { console.log("showDetails() ", gxs_id) - rsApi.request( - "/identity/get_identity_details", - JSON.stringify({ gxs_id: compRoot.gxs_id }), - function(par) - { - var jData = JSON.parse(par.response).data - stackView.push( - "qrc:/ContactDetails.qml", - {md: jData}) - }) + + stackView.push( + "qrc:/ContactDetails.qml", + {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) + } Component.onCompleted: if(visible && !has_avatar) getDetails() From 27593633fc387338a7926bc6bf837bc4a5fba666 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 14:46:30 +0200 Subject: [PATCH 058/107] Use Drawer Sidebar instead of menu class to show the menu --- retroshare-qml-app/src/components/SideBar.qml | 139 ++++++++++++++++++ retroshare-qml-app/src/main-app.qml | 41 +----- retroshare-qml-app/src/qml.qrc | 1 + 3 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 retroshare-qml-app/src/components/SideBar.qml diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml new file mode 100644 index 000000000..bd19f5e0f --- /dev/null +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -0,0 +1,139 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import "../URI.js" as UriJs +import "../" //Needed for TokensManager and ClipboardWrapper singleton + +Drawer +{ + id: drawer + height: parent.height + width: Math.min(parent.width, parent.height) / 3 * 2 + dragMargin: 10 + + ListView + { + id: listView + currentIndex: -1 + anchors.fill: parent + height: parent.height + + delegate: Item + { + property var itemHeight: 50 + + id: menuItem + width: parent.width + height: itemHeight + + Connections + { + target: mainWindow + onCoreReadyChanged: + { + if (model.showOnCoreReady) + { + setVisible(mainWindow.coreReady) + } + } + } + + Text + { + text: model.title + } + + MouseArea + { + width: parent.width + height: parent.height + onClicked: + { + if (listView.currentIndex != index) + { + listView.currentIndex = index + menuList.actions[model.title](); + // titleLabel.text = model.title + // stackView.replace(model.source) + } + drawer.close() + } + } + + visible: (model.showOnCoreReady)? setVisible(mainWindow.coreReady) : true + + Component.onCompleted: + { + if (model.showOnOsAndroid && !Q_OS_ANDROID) + { + menuItem.visible = false + menuItem.height = 0 + } + } + + function setVisible(b) + { + menuItem.visible = b + if (!b) + { + menuItem.height = 0 + } + else + { + menuItem.height = itemHeight + } + } + } + + model: ListModel + { + id: menuList + property var actions : + { + "Trusted Nodes": function() + { + stackView.push("qrc:/TrustedNodesView.qml"); + }, + "Search Contacts": function(){ + stackView.push("qrc:/Contacts.qml", + {'searching': true} ) + + }, + "Paste Link": function() + { + UriJs.URI.withinString( + ClipboardWrapper.getFromClipBoard(), + handleIntentUri); + }, + "Terminate Core": function() + { + rsApi.request("/control/shutdown"); + }, + } + + ListElement + { + title: "Trusted Nodes" + showOnCoreReady: true + } + ListElement + { + title: "Search Contacts" + showOnCoreReady: true + } + ListElement + { + title: "Paste Link" + showOnCoreReady: true + } + ListElement + { + title: "Terminate Core" + showOnOsAndroid: false + } + + } + + ScrollIndicator.vertical: ScrollIndicator { } + } +} + diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 4c0fe38de..9c4a7a235 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -21,6 +21,8 @@ import QtQuick.Controls 2.0 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "URI.js" as UriJs import "." //Needed for TokensManager and ClipboardWrapper singleton +import "components/." + ApplicationWindow { @@ -114,7 +116,7 @@ ApplicationWindow anchors.rightMargin: 2 anchors.verticalCenter: parent.verticalCenter - onClicked: menu.open() + onClicked: sideBar.open() Image { @@ -124,41 +126,8 @@ ApplicationWindow anchors.centerIn: parent } - Menu - { - id: menu - y: parent.y + parent.height - - MenuItem - { - text: qsTr("Trusted Nodes") - //iconSource: "qrc:/icons/document-share.png" - onTriggered: stackView.push("qrc:/TrustedNodesView.qml") - enabled: mainWindow.coreReady - } - MenuItem - { - text: qsTr("Search Contacts") - onTriggered: - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) - enabled: mainWindow.coreReady - } - MenuItem - { - text: "Paste Link" - onTriggered: UriJs.URI.withinString( - ClipboardWrapper.getFromClipBoard(), - handleIntentUri) - - enabled: mainWindow.coreReady - } - MenuItem - { - text: "Terminate Core" - onTriggered: rsApi.request("/control/shutdown") - visible: !Q_OS_ANDROID - } + SideBar { + id: sideBar } } } diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index d6a115c96..398056100 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -39,5 +39,6 @@ components/ColorHash.qml styles/ChatStyle.qml components/AvatarOrColorHash.qml + components/SideBar.qml From 356d3ab09f7e395a61e44f58d3ae72e64a716fbc Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 15:21:09 +0200 Subject: [PATCH 059/107] Solve bug to get the same index action when stackview is changed without using sidebar --- retroshare-qml-app/src/components/SideBar.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index bd19f5e0f..43346be69 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -44,14 +44,16 @@ Drawer MouseArea { + property var lastItem width: parent.width height: parent.height onClicked: { - if (listView.currentIndex != index) + if (listView.currentIndex != index || stackView.currentItem != lastItem) { listView.currentIndex = index menuList.actions[model.title](); + lastItem = stackView.currentItem // titleLabel.text = model.title // stackView.replace(model.source) } @@ -87,6 +89,7 @@ Drawer model: ListModel { id: menuList + property var actions : { "Trusted Nodes": function() @@ -95,7 +98,7 @@ Drawer }, "Search Contacts": function(){ stackView.push("qrc:/Contacts.qml", - {'searching': true} ) + {'searching': true} ) }, "Paste Link": function() From 0a087e64ace3e8d634944626ce19e170f6125bb2 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:03:47 +0200 Subject: [PATCH 060/107] Create button component --- retroshare-qml-app/src/components/Btn.qml | 123 ++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 2 + .../src/styles/SideBarStyle.qml | 5 + 3 files changed, 130 insertions(+) create mode 100644 retroshare-qml-app/src/components/Btn.qml create mode 100644 retroshare-qml-app/src/styles/SideBarStyle.qml diff --git a/retroshare-qml-app/src/components/Btn.qml b/retroshare-qml-app/src/components/Btn.qml new file mode 100644 index 000000000..ae0f094a9 --- /dev/null +++ b/retroshare-qml-app/src/components/Btn.qml @@ -0,0 +1,123 @@ +import QtQuick 2.0 +import QtQuick.Controls 1.4 + +Item +{ + + id: button + property alias buttonText: innerText.text; + property alias innerAnchors: innerElements.anchors; + property alias rectangleButton: rectangleButton; + + property var iconUrl + property int iconHeight: 20 + + property color color + property color hoverColor + property color pressColor + property int fontSize + property int borderWidth + property int borderRadius + + scale: state === "Pressed" ? 0.96 : 1.0 + onEnabledChanged: state = "" + signal clicked + + Rectangle + { + id: rectangleButton + anchors.fill: parent + radius: borderRadius + color: button.enabled ? button.color : "grey" + border.width: borderWidth + border.color: "black" + + ToolButton { + id: innerElements + + Image + { + id: icon + source: (iconUrl)? iconUrl: "" + height: (iconUrl)? iconHeight: 0 + width: (iconUrl)? iconHeight: 0 + + visible: (iconUrl)? true: false + anchors.left: innerElements.left + + anchors.margins:(iconUrl)? 10 : 0 + anchors.verticalCenter: parent.verticalCenter + } + + Text + { + anchors.margins: 10 + id: innerText + font.pointSize: fontSize + anchors.left: icon.right + anchors.verticalCenter: parent.verticalCenter + } + } + } + + states: [ + State + { + name: "Hovering" + PropertyChanges + { + target: rectangleButton + color: hoverColor + } + }, + State + { + name: "Pressed" + PropertyChanges + { + target: rectangleButton + color: pressColor + } + } + ] + + transitions: [ + Transition + { + from: ""; to: "Hovering" + ColorAnimation { duration: 200 } + }, + Transition + { + from: "*"; to: "Pressed" + ColorAnimation { duration: 10 } + } + ] + + MouseArea + { + hoverEnabled: true + anchors.fill: button + onEntered: { button.state='Hovering'} + onExited: { button.state=''} + onClicked: { button.clicked();} + onPressed: { button.state="Pressed" } + onReleased: + { + if (containsMouse) + button.state="Hovering"; + else + button.state=""; + } + } + + Behavior on scale + { + NumberAnimation + { + duration: 100 + easing.type: Easing.InOutQuad + } + } + +} diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 398056100..5c597c0c0 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -40,5 +40,7 @@ styles/ChatStyle.qml components/AvatarOrColorHash.qml components/SideBar.qml + styles/SideBarStyle.qml + components/Btn.qml diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml new file mode 100644 index 000000000..9c36e13c5 --- /dev/null +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + +} From 3b05e0a3f1dd32a7983a0afcd70bb7ac4eb419c0 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:04:25 +0200 Subject: [PATCH 061/107] Add stylesheet for sidebar --- retroshare-qml-app/src/qmldir | 1 + retroshare-qml-app/src/styles/SideBarStyle.qml | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/qmldir b/retroshare-qml-app/src/qmldir index 974b69075..5cd29454b 100644 --- a/retroshare-qml-app/src/qmldir +++ b/retroshare-qml-app/src/qmldir @@ -2,4 +2,5 @@ singleton TokensManager 1.0 TokensManager.qml singleton ClipboardWrapper 1.0 ClipboardWrapper.qml singleton ChatCache ChatCache.qml singleton StyleChat styles/ChatStyle.qml +singleton StyleSideBar styles/SideBarStyle.qml diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml index 9c36e13c5..c311fe2f3 100644 --- a/retroshare-qml-app/src/styles/SideBarStyle.qml +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -1,5 +1,18 @@ import QtQuick 2.0 +pragma Singleton -Item { +QtObject { + + property var width: 1.5 + + property QtObject item: QtObject + { + property var height: 50 + + property string hoverColor: "lightgrey" + property string defaultColor: "white" + property string pressColor: "slategrey" + + } } From 653381e9e2ed4b02bcfa27a9dc677040bc67628e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:05:36 +0200 Subject: [PATCH 062/107] Style sidebar partialy --- retroshare-qml-app/src/components/SideBar.qml | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 43346be69..f5ea22ae5 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -1,13 +1,16 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import "../URI.js" as UriJs -import "../" //Needed for TokensManager and ClipboardWrapper singleton +import "../" +import "../components" + Drawer { + property var styles: StyleSideBar id: drawer height: parent.height - width: Math.min(parent.width, parent.height) / 3 * 2 + width: Math.min(parent.width, parent.height) / 3 * styles.width dragMargin: 10 ListView @@ -19,11 +22,12 @@ Drawer delegate: Item { - property var itemHeight: 50 + + property var styles: StyleSideBar.item id: menuItem width: parent.width - height: itemHeight + height: styles.height Connections { @@ -37,14 +41,23 @@ Drawer } } - Text + Btn { - text: model.title + buttonText: model.title + width: parent.width + height: parent.height + color: menuItem.styles.defaultColor + hoverColor: menuItem.styles.hoverColor + innerAnchors.left: rectangleButton.left + innerAnchors.verticalCenter: rectangleButton.verticalCenter + iconUrl: (model.icon)? model.icon : undefined } + MouseArea { property var lastItem + id: itemArea width: parent.width height: parent.height onClicked: @@ -61,6 +74,8 @@ Drawer } } + + visible: (model.showOnCoreReady)? setVisible(mainWindow.coreReady) : true Component.onCompleted: @@ -81,7 +96,7 @@ Drawer } else { - menuItem.height = itemHeight + menuItem.height = styles.height } } } @@ -117,6 +132,7 @@ Drawer { title: "Trusted Nodes" showOnCoreReady: true + icon: "/icons/attach.svg" } ListElement { From e766e7ce0baa7282d5cff23be4e8a15006ac6bf5 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:32:59 +0200 Subject: [PATCH 063/107] Add header to sidebar component --- retroshare-qml-app/src/components/SideBar.qml | 27 +++++++++++++++++-- .../src/styles/SideBarStyle.qml | 6 ++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index f5ea22ae5..904807fd6 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 import "../URI.js" as UriJs import "../" import "../components" @@ -17,8 +18,30 @@ Drawer { id: listView currentIndex: -1 - anchors.fill: parent - height: parent.height + + anchors.fill:parent + + clip: true + + snapMode: ListView.SnapToItem + + headerPositioning: ListView.OverlayHeader + + header:Rectangle + { + id:header + property var styles: StyleSideBar.header + + width: parent.width + height: styles.height + color: styles.color + Label { + text: "Retroshare" + anchors.centerIn: parent + wrapMode: Text.WordWrap + } + + } delegate: Item { diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml index c311fe2f3..3e9a1f214 100644 --- a/retroshare-qml-app/src/styles/SideBarStyle.qml +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -12,7 +12,11 @@ QtObject { property string hoverColor: "lightgrey" property string defaultColor: "white" property string pressColor: "slategrey" - + } + property QtObject header: QtObject + { + property var height: 80 + property var color: "#0398d5" } } From 619874816ea65b34caaafd52a456c0b8ca4924b0 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:41:33 +0200 Subject: [PATCH 064/107] Add network icon --- retroshare-qml-app/src/icons/netgraph.svg | 54 +++++++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 1 + 2 files changed, 55 insertions(+) create mode 100644 retroshare-qml-app/src/icons/netgraph.svg diff --git a/retroshare-qml-app/src/icons/netgraph.svg b/retroshare-qml-app/src/icons/netgraph.svg new file mode 100644 index 000000000..87709e74a --- /dev/null +++ b/retroshare-qml-app/src/icons/netgraph.svg @@ -0,0 +1,54 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 5c597c0c0..317c8929c 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -42,5 +42,6 @@ components/SideBar.qml styles/SideBarStyle.qml components/Btn.qml + icons/netgraph.svg From 2360c3c27a3a47527d140b08fac0ca4144255581 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:43:50 +0200 Subject: [PATCH 065/107] Change search icon --- retroshare-qml-app/src/Contacts.qml | 2 +- retroshare-qml-app/src/icons/edit-find.png | Bin 3900 -> 0 bytes retroshare-qml-app/src/icons/search.svg | 78 +++++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 2 +- 4 files changed, 80 insertions(+), 2 deletions(-) delete mode 100644 retroshare-qml-app/src/icons/edit-find.png create mode 100644 retroshare-qml-app/src/icons/search.svg diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 418f62bb5..4666c928a 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -166,7 +166,7 @@ Item height: searchText.height / 2 width: searchText.height / 2 anchors.verticalCenter: parent.verticalCenter - source: "qrc:/icons/edit-find.png" + source: "qrc:/icons/searvh.svg" } TextField diff --git a/retroshare-qml-app/src/icons/edit-find.png b/retroshare-qml-app/src/icons/edit-find.png deleted file mode 100644 index 261e96c565efc8a70f9c8f25239a7807e932fd63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3900 zcmW+(2UJr{6Wu_NE(svgOANgTgrZWU1dvEodNCj^6h(^CG13f*ROt#5nkb;ss{~LH z4AMW4fS{rv(xgeKfB5&DeS7YGGv}SRJ9lO_(ZbA#orRwT0Kjg134MjO;*TfO3EHz; z+w~J|fd=UrTQSi_B$GRVhM8|&vJV0vqxg72hHBP6&`7>u1H0g>{+_`hu7MsPBqT(^ z`=)P@o9itP1^+;={1r`p08Ta=qjjx9pDaI(x+VBCs;8r4I>TH!U5wdO2;L~}hRooN zN$V*(n~Ji~oNslsFYsfO{Lp4{MwHoGqDUpa;XJ=`m~<%$rm4%!U7n-!cyfJ3h~;b| zLyo$>W@7$?9kQ(R-DeBB2ESsB>FLAWo+>RhwS}| zZlR%}Sj8jbrlMyIf?bM93W(jDALmYU4ZSBvD(sIna*^E7n|94khrQh#7xxoVJdCn* z*cBBO*WO}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MN_4FnO# zLVH2rjm{TU(}DgSIi?<9B?#;=*L}rftC343oWSi3!~vwpcU~s9om10!DC!-Pof8&N zWU=E+tHFAM(EG9?1TTnukBY>(7wh*XfPAk;&TLK}<8}HvIe%1VfUHPr>z;yyUQ$X* qhf>JOR7{z-mr~HtUl|c_D5Cy%51ATt&YX7B1;z$u=xRNenEwGFnkhg4 diff --git a/retroshare-qml-app/src/icons/search.svg b/retroshare-qml-app/src/icons/search.svg new file mode 100644 index 000000000..811707601 --- /dev/null +++ b/retroshare-qml-app/src/icons/search.svg @@ -0,0 +1,78 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 317c8929c..dbd577b53 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -13,7 +13,6 @@ icons/state-offline.png icons/state-ok.png GxsIdentityDelegate.qml - icons/edit-find.png icons/edit-image-face-detect.png icons/application-menu.png ContactSort.js @@ -43,5 +42,6 @@ styles/SideBarStyle.qml components/Btn.qml icons/netgraph.svg + icons/search.svg From b9d21f004c9907c564659f17d530853d3324019f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:50:42 +0200 Subject: [PATCH 066/107] Change search icon on toolbar to invoke search field on contacts --- retroshare-qml-app/src/Contacts.qml | 12 +----------- retroshare-qml-app/src/main-app.qml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 4666c928a..274483a77 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -160,22 +160,12 @@ Item anchors.horizontalCenter: parent.horizontalCenter color: "white" - Image - { - id: searchIcon - height: searchText.height / 2 - width: searchText.height / 2 - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/icons/searvh.svg" - } - TextField { id: searchText - anchors.left: searchIcon.right anchors.verticalCenter: parent.verticalCenter placeholderText : "Search contacts..." - width: parent.width - searchIcon.width - 5 + width: parent.width - 5 anchors.leftMargin: 5 background: Rectangle diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 9c4a7a235..aa86e46f7 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -108,8 +108,25 @@ ApplicationWindow anchors.left: imageLoader.right anchors.leftMargin: 20 } + + + BtnIcon + { + id: searchIcon + height: parent.height - 10 + width: parent.height - 10 + anchors.verticalCenter: parent.verticalCenter + imgUrl: "qrc:/icons/search.svg" + anchors.right: menu.left + onClicked: + { + stackView.push("qrc:/Contacts.qml", + {'searching': true} ) + } + } MouseArea { + id: menu height: parent.height width: parent.height anchors.right: parent.right From e7c3a3739ed1ec4e746f27fc6bcaa3a673eb2759 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:54:46 +0200 Subject: [PATCH 067/107] Set search icon visibility on core ready --- retroshare-qml-app/src/main-app.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index aa86e46f7..c996073dd 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -113,8 +113,8 @@ ApplicationWindow BtnIcon { id: searchIcon - height: parent.height - 10 - width: parent.height - 10 + height: (coreReady)? parent.height - 10 : 0 + width: (coreReady)? parent.height - 10 : 0 anchors.verticalCenter: parent.verticalCenter imgUrl: "qrc:/icons/search.svg" anchors.right: menu.left @@ -123,6 +123,8 @@ ApplicationWindow stackView.push("qrc:/Contacts.qml", {'searching': true} ) } + + visible: setVisible(coreReady) } MouseArea { From 3361c76c307394b2be106907554d03e10c04f103 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 17:56:09 +0200 Subject: [PATCH 068/107] Add icons --- retroshare-qml-app/src/icons/add.svg | 54 ++++++++++++++++++++++ retroshare-qml-app/src/icons/exit.svg | 65 +++++++++++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 2 + 3 files changed, 121 insertions(+) create mode 100644 retroshare-qml-app/src/icons/add.svg create mode 100644 retroshare-qml-app/src/icons/exit.svg diff --git a/retroshare-qml-app/src/icons/add.svg b/retroshare-qml-app/src/icons/add.svg new file mode 100644 index 000000000..846ba6ec5 --- /dev/null +++ b/retroshare-qml-app/src/icons/add.svg @@ -0,0 +1,54 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/icons/exit.svg b/retroshare-qml-app/src/icons/exit.svg new file mode 100644 index 000000000..14bb0952e --- /dev/null +++ b/retroshare-qml-app/src/icons/exit.svg @@ -0,0 +1,65 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index dbd577b53..4685486e5 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -43,5 +43,7 @@ components/Btn.qml icons/netgraph.svg icons/search.svg + icons/exit.svg + icons/add.svg From 69b3f46309abd603ade799f754455a133da98020 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 18:04:41 +0200 Subject: [PATCH 069/107] Solve bug on search icon visibility --- retroshare-qml-app/src/main-app.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index c996073dd..6eb594019 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -124,7 +124,7 @@ ApplicationWindow {'searching': true} ) } - visible: setVisible(coreReady) + visible: coreReady } MouseArea { From ac25a4d23a9d09851a71b029502f232a9afb67f4 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 18:05:04 +0200 Subject: [PATCH 070/107] Style sidebar --- retroshare-qml-app/src/components/Btn.qml | 7 +++++-- retroshare-qml-app/src/components/SideBar.qml | 15 ++++----------- retroshare-qml-app/src/styles/SideBarStyle.qml | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/retroshare-qml-app/src/components/Btn.qml b/retroshare-qml-app/src/components/Btn.qml index ae0f094a9..26626a5aa 100644 --- a/retroshare-qml-app/src/components/Btn.qml +++ b/retroshare-qml-app/src/components/Btn.qml @@ -18,6 +18,7 @@ Item property int fontSize property int borderWidth property int borderRadius + property int innerMargin: 10 scale: state === "Pressed" ? 0.96 : 1.0 onEnabledChanged: state = "" @@ -42,16 +43,18 @@ Item height: (iconUrl)? iconHeight: 0 width: (iconUrl)? iconHeight: 0 + fillMode: Image.PreserveAspectFit + visible: (iconUrl)? true: false anchors.left: innerElements.left - anchors.margins:(iconUrl)? 10 : 0 + anchors.margins:(iconUrl)? innerMargin : 0 anchors.verticalCenter: parent.verticalCenter } Text { - anchors.margins: 10 + anchors.margins: innerMargin id: innerText font.pointSize: fontSize anchors.left: icon.right diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 904807fd6..dfd685978 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -74,6 +74,7 @@ Drawer innerAnchors.left: rectangleButton.left innerAnchors.verticalCenter: rectangleButton.verticalCenter iconUrl: (model.icon)? model.icon : undefined + innerMargin: 20 } @@ -134,11 +135,6 @@ Drawer { stackView.push("qrc:/TrustedNodesView.qml"); }, - "Search Contacts": function(){ - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) - - }, "Paste Link": function() { UriJs.URI.withinString( @@ -155,22 +151,19 @@ Drawer { title: "Trusted Nodes" showOnCoreReady: true - icon: "/icons/attach.svg" - } - ListElement - { - title: "Search Contacts" - showOnCoreReady: true + icon: "/icons/netgraph.svg" } ListElement { title: "Paste Link" showOnCoreReady: true + icon: "/icons/add.svg" } ListElement { title: "Terminate Core" showOnOsAndroid: false + icon: "/icons/exit.svg" } } diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml index 3e9a1f214..4ede4a004 100644 --- a/retroshare-qml-app/src/styles/SideBarStyle.qml +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -7,7 +7,7 @@ QtObject { property QtObject item: QtObject { - property var height: 50 + property var height: 40 property string hoverColor: "lightgrey" property string defaultColor: "white" From 32078d32439bb868776b3a821ebdddaf9185b94e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 18:15:24 +0200 Subject: [PATCH 071/107] Store own gxs information on ChatCache --- retroshare-qml-app/src/ChatCache.qml | 1 + retroshare-qml-app/src/Contacts.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 1f774cda3..cc0a9e85a 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -100,6 +100,7 @@ QtObject { id: contactsCache property var contactsList + property var own function getContactFromGxsId (gxsId) { diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 274483a77..2039b7a36 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -72,6 +72,7 @@ Item if(json.data.length > 0) { + ChatCache.contactsCache.own = json.data[0] contactsView.own_gxs_id = json.data[0].gxs_id contactsView.own_nick = json.data[0].name if(mainWindow.user_name.length === 0) From a8b26298d3502186d08c086da00e843b12bdf790 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Thu, 22 Jun 2017 19:28:14 +0200 Subject: [PATCH 072/107] Add header and footer to sidebar --- retroshare-qml-app/src/components/SideBar.qml | 365 +++++++++++------- .../src/styles/SideBarStyle.qml | 12 +- 2 files changed, 234 insertions(+), 143 deletions(-) diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index dfd685978..d4ab3bdd8 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -14,161 +14,242 @@ Drawer width: Math.min(parent.width, parent.height) / 3 * styles.width dragMargin: 10 - ListView + Rectangle { - id: listView - currentIndex: -1 + width: parent.width + height: parent.height - anchors.fill:parent - clip: true - - snapMode: ListView.SnapToItem - - headerPositioning: ListView.OverlayHeader - - header:Rectangle + ListView { - id:header - property var styles: StyleSideBar.header + id: listView + currentIndex: -1 + + anchors.fill:parent + + clip: true + + snapMode: ListView.SnapToItem + + headerPositioning: ListView.OverlayHeader + + header:Rectangle + { + id:header + property var styles: StyleSideBar.header + + width: parent.width + height: colorHash.height + nickText.height + gxsText.height + 40 + color: styles.color + + AvatarOrColorHash + { + id: colorHash + + gxs_id: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.gxs_id : "" + height: styles.avatarHeight + anchors.margins: styles.avatarMargins + anchors.horizontalCenter: header.horizontalCenter + anchors.top: header.top + } + + Text + { + id: nickText + text: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.name : "" + height: contentHeight + anchors.top: colorHash.bottom + anchors.left: header.left + anchors.right: header.right + anchors.leftMargin: 10 + anchors.rightMargin: 10 + horizontalAlignment:Text.AlignHCenter + wrapMode: Text.Wrap + color: styles.textColor + font.bold: true + font.pixelSize: styles.textNickSize + } + Text + { + id: gxsText + text: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.gxs_id : "" + height: contentHeight + wrapMode: Text.WrapAnywhere + width: header.width + anchors.top: nickText.bottom + anchors.left: header.left + anchors.right: header.right + anchors.leftMargin: 10 + anchors.rightMargin: 10 + horizontalAlignment:Text.AlignHCenter + color: styles.textColor + font.pixelSize: styles.textGxsidSize + } + } + + + + delegate: Item + { + + property var styles: StyleSideBar.item + + id: menuItem + width: parent.width + height: styles.height + + Connections + { + target: mainWindow + onCoreReadyChanged: + { + if (model.showOnCoreReady) + { + setVisible(mainWindow.coreReady) + } + } + } + + Btn + { + buttonText: model.title + width: parent.width + height: parent.height + color: menuItem.styles.defaultColor + hoverColor: menuItem.styles.hoverColor + innerAnchors.left: rectangleButton.left + innerAnchors.verticalCenter: rectangleButton.verticalCenter + iconUrl: (model.icon)? model.icon : undefined + innerMargin: 20 + } + + + MouseArea + { + property var lastItem + id: itemArea + width: parent.width + height: parent.height + onClicked: + { + if (listView.currentIndex != index || stackView.currentItem != lastItem) + { + listView.currentIndex = index + menuList.actions[model.title](); + lastItem = stackView.currentItem + // titleLabel.text = model.title + // stackView.replace(model.source) + } + drawer.close() + } + } + + + + visible: (model.showOnCoreReady)? setVisible(mainWindow.coreReady) : true + + Component.onCompleted: + { + if (model.showOnOsAndroid && !Q_OS_ANDROID) + { + menuItem.visible = false + menuItem.height = 0 + } + } + + function setVisible(b) + { + menuItem.visible = b + if (!b) + { + menuItem.height = 0 + } + else + { + menuItem.height = styles.height + } + } + } + + model: ListModel + { + id: menuList + + property var actions : + { + "Trusted Nodes": function() + { + stackView.push("qrc:/TrustedNodesView.qml"); + }, + "Search Contacts": function() + { + stackView.push("qrc:/Contacts.qml", + {'searching': true} ) + }, + "Paste Link": function() + { + UriJs.URI.withinString( + ClipboardWrapper.getFromClipBoard(), + handleIntentUri); + }, + "Terminate Core": function() + { + rsApi.request("/control/shutdown"); + }, + } + + ListElement + { + title: "Trusted Nodes" + showOnCoreReady: true + icon: "/icons/netgraph.svg" + } + ListElement + { + title: "Search Contacts" + showOnCoreReady: true + icon: "/icons/search.svg" + } + ListElement + { + title: "Paste Link" + showOnCoreReady: true + icon: "/icons/add.svg" + } + ListElement + { + title: "Terminate Core" + showOnOsAndroid: false + icon: "/icons/exit.svg" + } + + } + + ScrollIndicator.vertical: ScrollIndicator { } + } + + Rectangle + { + property var styles: StyleSideBar.footer width: parent.width - height: styles.height + anchors.bottom: parent.bottom + height: Label.contentHeight color: styles.color - Label { - text: "Retroshare" - anchors.centerIn: parent - wrapMode: Text.WordWrap - } - } - - delegate: Item - { - - property var styles: StyleSideBar.item - - id: menuItem - width: parent.width - height: styles.height - - Connections + Label { - target: mainWindow - onCoreReadyChanged: - { - if (model.showOnCoreReady) - { - setVisible(mainWindow.coreReady) - } - } - } + horizontalAlignment: Text.AlignRight + anchors.bottom: parent.bottom + anchors.right: parent.right + text:"Retroshare v.DEV" + color: parent.styles.textColor + anchors.rightMargin: parent.styles.margins + anchors.bottomMargin: parent.styles.margins - Btn - { - buttonText: model.title - width: parent.width - height: parent.height - color: menuItem.styles.defaultColor - hoverColor: menuItem.styles.hoverColor - innerAnchors.left: rectangleButton.left - innerAnchors.verticalCenter: rectangleButton.verticalCenter - iconUrl: (model.icon)? model.icon : undefined - innerMargin: 20 - } - - - MouseArea - { - property var lastItem - id: itemArea - width: parent.width - height: parent.height - onClicked: - { - if (listView.currentIndex != index || stackView.currentItem != lastItem) - { - listView.currentIndex = index - menuList.actions[model.title](); - lastItem = stackView.currentItem - // titleLabel.text = model.title - // stackView.replace(model.source) - } - drawer.close() - } - } - - - - visible: (model.showOnCoreReady)? setVisible(mainWindow.coreReady) : true - - Component.onCompleted: - { - if (model.showOnOsAndroid && !Q_OS_ANDROID) - { - menuItem.visible = false - menuItem.height = 0 - } - } - - function setVisible(b) - { - menuItem.visible = b - if (!b) - { - menuItem.height = 0 - } - else - { - menuItem.height = styles.height - } } } - model: ListModel - { - id: menuList - - property var actions : - { - "Trusted Nodes": function() - { - stackView.push("qrc:/TrustedNodesView.qml"); - }, - "Paste Link": function() - { - UriJs.URI.withinString( - ClipboardWrapper.getFromClipBoard(), - handleIntentUri); - }, - "Terminate Core": function() - { - rsApi.request("/control/shutdown"); - }, - } - - ListElement - { - title: "Trusted Nodes" - showOnCoreReady: true - icon: "/icons/netgraph.svg" - } - ListElement - { - title: "Paste Link" - showOnCoreReady: true - icon: "/icons/add.svg" - } - ListElement - { - title: "Terminate Core" - showOnOsAndroid: false - icon: "/icons/exit.svg" - } - - } - - ScrollIndicator.vertical: ScrollIndicator { } } } diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml index 4ede4a004..491bdf3c2 100644 --- a/retroshare-qml-app/src/styles/SideBarStyle.qml +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -15,8 +15,18 @@ QtObject { } property QtObject header: QtObject { - property var height: 80 property var color: "#0398d5" + property var avatarHeight: 50 + property var avatarMargins: 15 + property var textColor: "white" + property var textNickSize: 14 + property var textGxsidSize: 11 + } + property QtObject footer: QtObject + { + property var color: "white" + property var textColor: "grey" + property var margins: 8 } } From d8eafaf9ea2ae07f62e1d1de50f74f3a224493e2 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 15:01:48 +0200 Subject: [PATCH 073/107] Set search button visibility only on contacts view --- retroshare-qml-app/src/Contacts.qml | 8 +++++++- retroshare-qml-app/src/main-app.qml | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 2039b7a36..5984b0c50 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -30,7 +30,13 @@ Item property bool searching: false onSearchingChanged: !searching && contactsSortWorker.sendMessage({}) - Component.onCompleted: refreshAll() + property string objectName:"contactsView" + + Component.onCompleted: + { + toolBar.state = "CONTACTSVIEW" + refreshAll() + } onFocusChanged: focus && refreshAll() WorkerScript diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 6eb594019..ebe1515b5 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -74,6 +74,13 @@ ApplicationWindow State { name: "CHATVIEW" + }, + State + { + name: "CONTACTSVIEW" + PropertyChanges { target: toolBar; titleText: defaultLabel} + PropertyChanges { target: toolBar; loaderSource: rsIcon} + PropertyChanges { target: searchIcon; searchIconVisibility: true} } ] @@ -112,19 +119,20 @@ ApplicationWindow BtnIcon { + property bool searchIconVisibility: false + id: searchIcon height: (coreReady)? parent.height - 10 : 0 width: (coreReady)? parent.height - 10 : 0 anchors.verticalCenter: parent.verticalCenter imgUrl: "qrc:/icons/search.svg" anchors.right: menu.left + visible: searchIconVisibility && coreReady onClicked: { stackView.push("qrc:/Contacts.qml", {'searching': true} ) } - - visible: coreReady } MouseArea { @@ -160,7 +168,9 @@ ApplicationWindow { if (currentItem) { - if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT") + if (currentItem.objectName != "chatView" && + currentItem.objectName != "contactsView" && + toolBar.state != "DEFAULT") { toolBar.state = "DEFAULT" } From 353b34fcab24be05da1727e6eb6682aa23ae2921 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 15:17:41 +0200 Subject: [PATCH 074/107] Toggle search contacts field using search icon on toolbar --- retroshare-qml-app/src/Contacts.qml | 6 ++++++ retroshare-qml-app/src/components/SideBar.qml | 3 +-- retroshare-qml-app/src/main-app.qml | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 5984b0c50..93784c27c 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -35,6 +35,7 @@ Item Component.onCompleted: { toolBar.state = "CONTACTSVIEW" + toolBar.searchBtnCb = toggleSearchBox refreshAll() } onFocusChanged: focus && refreshAll() @@ -46,6 +47,11 @@ Item onMessage: contactsListModel.json = JSON.stringify(messageObject) } + function toggleSearchBox (){ + if (searching) searching = false + else searching = true + } + function refreshAll() { refreshOwn() diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index d4ab3bdd8..6393afbcc 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -183,8 +183,7 @@ Drawer }, "Search Contacts": function() { - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) + stackView.push("qrc:/Contacts.qml" ) }, "Paste Link": function() { diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index ebe1515b5..ca9a1c2df 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -63,6 +63,8 @@ ApplicationWindow property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" + property var searchBtnCb + states: [ State @@ -120,6 +122,7 @@ ApplicationWindow BtnIcon { property bool searchIconVisibility: false + property var onClickCB: function (){} id: searchIcon height: (coreReady)? parent.height - 10 : 0 @@ -130,8 +133,7 @@ ApplicationWindow visible: searchIconVisibility && coreReady onClicked: { - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) + toolBar.searchBtnCb() } } MouseArea From a9e4271c3589cb3788d5868e90ddfc3286d76b03 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 15:59:04 +0200 Subject: [PATCH 075/107] Transition on when toggle search box --- retroshare-qml-app/src/Contacts.qml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 93784c27c..b4357a90e 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -162,7 +162,7 @@ Item Rectangle { id: searchBox - visible: contactsView.searching +// visible: contactsView.searching height: searchText.height + 10 width: parent.width * 0.9 @@ -177,9 +177,10 @@ Item { id: searchText anchors.verticalCenter: parent.verticalCenter - placeholderText : "Search contacts..." - width: parent.width - 5 +// placeholderText : "Search contacts..." + width: parent.width anchors.leftMargin: 5 + height: 0 background: Rectangle { @@ -193,6 +194,27 @@ Item contactsSortWorker.sendMessage( {'action': 'searchContact', 'sexp': text}) } + + states: + [ + State + { + when: contactsView.searching; + PropertyChanges { target: searchText; height: implicitHeight } + PropertyChanges { target: searchText; placeholderText : "Search contacts..." } + PropertyChanges { target: searchBox; height: searchText.height + 10 } + }, + State + { + when: !contactsView.searching; + PropertyChanges { target: searchText; height: 0 } + PropertyChanges { target: searchBox; height: 0 } + } + ] + transitions: Transition + { + NumberAnimation { property: "height"; duration: 500; easing.type: Easing.InOutQuad} + } } Text From b4ee63ad9be6cc2584c792b1b9feedb0bdcbf1b9 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 16:09:47 +0200 Subject: [PATCH 076/107] Close drawe when click your avatar image to show details --- retroshare-qml-app/src/components/AvatarOrColorHash.qml | 8 ++++++-- retroshare-qml-app/src/components/SideBar.qml | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 04dbda40f..f34d288be 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -25,7 +25,7 @@ Item id: compRoot property string gxs_id - + signal clicked () height: 130 width: height @@ -90,6 +90,10 @@ Item MouseArea { anchors.fill: parent - onClicked: showDetails() + onClicked: + { + compRoot.clicked() + showDetails() + } } } diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 6393afbcc..36080dcb7 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -51,6 +51,7 @@ Drawer anchors.margins: styles.avatarMargins anchors.horizontalCenter: header.horizontalCenter anchors.top: header.top + onClicked: drawer.close() } Text @@ -73,7 +74,7 @@ Drawer { id: gxsText text: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.gxs_id : "" - height: contentHeight +// height: contentHeight wrapMode: Text.WrapAnywhere width: header.width anchors.top: nickText.bottom From c94672118e762c631f8814f29597ad3ad2e9eeab Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 16:33:16 +0200 Subject: [PATCH 077/107] Toolbar return to contacts view when click to icon or label --- retroshare-qml-app/src/components/BtnIcon.qml | 3 ++- retroshare-qml-app/src/main-app.qml | 23 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/components/BtnIcon.qml b/retroshare-qml-app/src/components/BtnIcon.qml index 6ce4f9e99..1492b0f35 100644 --- a/retroshare-qml-app/src/components/BtnIcon.qml +++ b/retroshare-qml-app/src/components/BtnIcon.qml @@ -8,9 +8,10 @@ Item { signal released property var imgUrl: "" + property alias fillMode: image.fillMode Image { - + id: image anchors.fill: parent source: imgUrl diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index ca9a1c2df..44e42d289 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -65,6 +65,15 @@ ApplicationWindow property var searchBtnCb + function openMainPage () + { + if (stackView.currentItem.objectName != "contactsView" ) + { + stackView.push("qrc:/Contacts.qml") + } + + } + states: [ State @@ -103,10 +112,13 @@ ApplicationWindow Component { id: rsIcon - Image + BtnIcon { + height: imageLoader.height + width: imageLoader.height fillMode: Image.PreserveAspectFit - source: "icons/retroshare06.png" + imgUrl: "/icons/retroshare06.png" + onClicked:{ toolBar.openMainPage() } } } @@ -116,8 +128,13 @@ ApplicationWindow anchors.verticalCenter: parent.verticalCenter anchors.left: imageLoader.right anchors.leftMargin: 20 - } + MouseArea { + anchors.fill: parent + onClicked: { toolBar.openMainPage() } + } + + } BtnIcon { From 37089bb73fdd2bd36bf0772e629060cbe3946c89 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 16:36:36 +0200 Subject: [PATCH 078/107] Disable toolbar mouse area on chat view --- retroshare-qml-app/src/main-app.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 44e42d289..58ecbe583 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -85,6 +85,7 @@ ApplicationWindow State { name: "CHATVIEW" + PropertyChanges { target: toolBarText; mouseA.visible: false } }, State { @@ -124,12 +125,15 @@ ApplicationWindow Label { + property alias mouseA: mouseA id: toolBarText anchors.verticalCenter: parent.verticalCenter anchors.left: imageLoader.right anchors.leftMargin: 20 MouseArea { + id: mouseA + visible: true anchors.fill: parent onClicked: { toolBar.openMainPage() } } From 60dae077423c0533ed72f620b8bea892811f350f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 17:26:10 +0200 Subject: [PATCH 079/107] Partialy implement back button --- retroshare-qml-app/src/main-app.qml | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 58ecbe583..5c12c3ebb 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -63,6 +63,9 @@ ApplicationWindow property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" + property var iconsSize: (coreReady)? height - 10 : 0 + property var backBtnVisible: true + property var searchBtnCb function openMainPage () @@ -86,6 +89,7 @@ ApplicationWindow { name: "CHATVIEW" PropertyChanges { target: toolBarText; mouseA.visible: false } +// PropertyChanges { target: toolBar; backBtnVisible: true } }, State { @@ -93,6 +97,7 @@ ApplicationWindow PropertyChanges { target: toolBar; titleText: defaultLabel} PropertyChanges { target: toolBar; loaderSource: rsIcon} PropertyChanges { target: searchIcon; searchIconVisibility: true} + PropertyChanges { target: toolBar; backBtnVisible: false } } ] @@ -140,14 +145,37 @@ ApplicationWindow } + BtnIcon + { + id: backButton + visible: toolBar.backBtnVisible + height: toolBar.iconsSize + width: toolBar.iconsSize + fillMode: Image.PreserveAspectFit + imgUrl: "/icons/microphone.svg" + onClicked: + { + if (stackView.depth > 1) + { + stackView.pop(); + console.log("@@@@@@ depth ", stackView.depth) +// if (stackView.depth-1 == 0) toolBar.backBtnVisible = false + } + else + { + Qt.quit(); + } + } + } + BtnIcon { property bool searchIconVisibility: false property var onClickCB: function (){} id: searchIcon - height: (coreReady)? parent.height - 10 : 0 - width: (coreReady)? parent.height - 10 : 0 + height: toolBar.iconsSize + width: toolBar.iconsSize anchors.verticalCenter: parent.verticalCenter imgUrl: "qrc:/icons/search.svg" anchors.right: menu.left @@ -199,6 +227,7 @@ ApplicationWindow } currentItem.focus = true } + console.log("@@@@@ CHANGED", toolBar.state) } Keys.onReleased: From 34be06c67ae0c2c56975a90a526adaa54ce459ab Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 17:26:51 +0200 Subject: [PATCH 080/107] Disable backbutton implementation --- retroshare-qml-app/src/main-app.qml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 5c12c3ebb..56873dec3 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -64,7 +64,6 @@ ApplicationWindow property string defaultLabel: "RetroShare" property var iconsSize: (coreReady)? height - 10 : 0 - property var backBtnVisible: true property var searchBtnCb @@ -97,7 +96,6 @@ ApplicationWindow PropertyChanges { target: toolBar; titleText: defaultLabel} PropertyChanges { target: toolBar; loaderSource: rsIcon} PropertyChanges { target: searchIcon; searchIconVisibility: true} - PropertyChanges { target: toolBar; backBtnVisible: false } } ] @@ -145,28 +143,7 @@ ApplicationWindow } - BtnIcon - { - id: backButton - visible: toolBar.backBtnVisible - height: toolBar.iconsSize - width: toolBar.iconsSize - fillMode: Image.PreserveAspectFit - imgUrl: "/icons/microphone.svg" - onClicked: - { - if (stackView.depth > 1) - { - stackView.pop(); - console.log("@@@@@@ depth ", stackView.depth) -// if (stackView.depth-1 == 0) toolBar.backBtnVisible = false - } - else - { - Qt.quit(); - } - } - } + BtnIcon { @@ -227,7 +204,6 @@ ApplicationWindow } currentItem.focus = true } - console.log("@@@@@ CHANGED", toolBar.state) } Keys.onReleased: From b848422a2d522f794132389ae272ec8637f20632 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 18:12:55 +0200 Subject: [PATCH 081/107] Add keyring icon --- retroshare-qml-app/src/icons/keyring.svg | 7 +++++++ retroshare-qml-app/src/qml.qrc | 1 + 2 files changed, 8 insertions(+) create mode 100644 retroshare-qml-app/src/icons/keyring.svg diff --git a/retroshare-qml-app/src/icons/keyring.svg b/retroshare-qml-app/src/icons/keyring.svg new file mode 100644 index 000000000..3f2568f95 --- /dev/null +++ b/retroshare-qml-app/src/icons/keyring.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 4685486e5..1473ab043 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -45,5 +45,6 @@ icons/search.svg icons/exit.svg icons/add.svg + icons/keyring.svg From fd38129b094fb2d2122b8da52a8e433023767567 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 18:37:49 +0200 Subject: [PATCH 082/107] Create component to wrap text and icon --- .../src/components/TextAndIcon.qml | 37 +++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 1 + 2 files changed, 38 insertions(+) create mode 100644 retroshare-qml-app/src/components/TextAndIcon.qml diff --git a/retroshare-qml-app/src/components/TextAndIcon.qml b/retroshare-qml-app/src/components/TextAndIcon.qml new file mode 100644 index 000000000..b825a05ab --- /dev/null +++ b/retroshare-qml-app/src/components/TextAndIcon.qml @@ -0,0 +1,37 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + + +ToolButton +{ + height: icon.height + 5 + + property alias iconUrl: icon.source + property alias innerText: innerText.text + + + Image + { + id: icon + + height: innerText.contentHeight + width: innerText.contentHeight + + fillMode: Image.PreserveAspectFit + anchors.left: parent.left + anchors.leftMargin: 4 + anchors.verticalCenter: parent.verticalCenter + } + + Text + { + id: innerText + wrapMode: Text.WrapAnywhere + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + anchors.left: icon.right + anchors.leftMargin: 5 + } + + +} diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index 1473ab043..ced9047d4 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -46,5 +46,6 @@ icons/exit.svg icons/add.svg icons/keyring.svg + components/TextAndIcon.qml From 666ae5ecf3e339b1d76dc59d71f9d23791f114e1 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 18:39:18 +0200 Subject: [PATCH 083/107] Style the trusted node details view --- retroshare-qml-app/src/TrustedNodeDetails.qml | 76 +++++++++++++++++-- retroshare-qml-app/src/TrustedNodesView.qml | 4 +- 2 files changed, 73 insertions(+), 7 deletions(-) diff --git a/retroshare-qml-app/src/TrustedNodeDetails.qml b/retroshare-qml-app/src/TrustedNodeDetails.qml index 210c4c537..252f744d1 100644 --- a/retroshare-qml-app/src/TrustedNodeDetails.qml +++ b/retroshare-qml-app/src/TrustedNodeDetails.qml @@ -18,6 +18,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import "components/." Item { @@ -25,19 +26,48 @@ Item property string pgpName property alias pgpId: pgpIdTxt.text + property bool isOnline property string nodeCert property var locations + + Image + { + id: nodeStatusImage + source: isOnline? + "icons/state-ok.png" : + "icons/state-offline.png" + + fillMode: Image.PreserveAspectFit + + anchors.top: parent.top + anchors.topMargin: 6 + anchors.horizontalCenter: parent.horizontalCenter + } + + + Column { id: pgpColumn - anchors.top: parent.top + anchors.top: nodeStatusImage.bottom + width: parent.width - Text { text: nodeDetailsRoot.pgpName.replace(" (Generated by RetroShare) <>", "") } - Text { id: pgpIdTxt } + Text + { + text: nodeDetailsRoot.pgpName.replace(" (Generated by RetroShare) <>", "") + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 20 + } + Text + { + id: pgpIdTxt + anchors.horizontalCenter: parent.horizontalCenter + color: "darkslategrey" + } } JSONListModel @@ -48,10 +78,36 @@ Item ListView { - width: parent.width + width: parent.width * .75 anchors.top: pgpColumn.bottom + anchors.topMargin: 5 anchors.bottom: buttonsRow.top model: jsonModel.model + anchors.horizontalCenter: parent.horizontalCenter + headerPositioning: ListView.OverlayHeader + + clip: true + snapMode: ListView.SnapToItem + + header:Rectangle + { + color: "aliceblue" + width: parent.width + z: 2 + height: headetText.contentHeight + 10 + radius: 10 + + Text + { + id: headetText + text: "Node locations ("+jsonModel.model.count+")" + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.italic: true + } + + } + delegate: Column { height: 60 @@ -61,8 +117,9 @@ Item Row { + id: idRow height: 30 - spacing: 10 + spacing: 4 Image { @@ -83,7 +140,14 @@ Item } } - Text { text: model.peer_id } + TextAndIcon + { + width: parent.width + innerText: model.peer_id + anchors.horizontalCenter: parent.horizontalCenter + iconUrl: "/icons/keyring.svg" + + } } } diff --git a/retroshare-qml-app/src/TrustedNodesView.qml b/retroshare-qml-app/src/TrustedNodesView.qml index e3d62900a..f2b0a3843 100644 --- a/retroshare-qml-app/src/TrustedNodesView.qml +++ b/retroshare-qml-app/src/TrustedNodesView.qml @@ -67,13 +67,14 @@ Item model: jsonModel.model delegate: Item { + property bool isOnline: jsonModel.isOnline(model.pgp_id) height: 30 width: parent.width Image { id: statusImage - source: jsonModel.isOnline(model.pgp_id) ? + source: isOnline? "icons/state-ok.png" : "icons/state-offline.png" @@ -100,6 +101,7 @@ Item { pgpName: model.name, pgpId: model.pgp_id, + isOnline: isOnline, locations: jsonModel.getLocations( model.pgp_id) } From 48a77c5e1ad488232ed948f01d165bdaa711d658 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 15:36:09 +0200 Subject: [PATCH 084/107] Create component emoji picker --- .../src/components/emoji/EmojiButton.qml | 54 + .../components/emoji/EmojiCategoryButton.qml | 79 ++ .../src/components/emoji/EmojiPicker.qml | 124 ++ .../src/components/emoji/emoji.js | 1068 +++++++++++++++++ retroshare-qml-app/src/qml.qrc | 4 + 5 files changed, 1329 insertions(+) create mode 100644 retroshare-qml-app/src/components/emoji/EmojiButton.qml create mode 100644 retroshare-qml-app/src/components/emoji/EmojiCategoryButton.qml create mode 100644 retroshare-qml-app/src/components/emoji/EmojiPicker.qml create mode 100644 retroshare-qml-app/src/components/emoji/emoji.js diff --git a/retroshare-qml-app/src/components/emoji/EmojiButton.qml b/retroshare-qml-app/src/components/emoji/EmojiButton.qml new file mode 100644 index 000000000..b75ec5f31 --- /dev/null +++ b/retroshare-qml-app/src/components/emoji/EmojiButton.qml @@ -0,0 +1,54 @@ +import QtQuick 2.7 +import QtQuick.Controls.Styles 1.2 + +Rectangle { + id: emojiButton + + + Text { + id: emojiText + color: "gray" + text: qsTr(eCatText) + font.pixelSize: emojiButton.width - 8 + anchors.centerIn: parent + } + + + state: "RELEASED" + states: [ + State { + name: "PRESSED" + PropertyChanges { + target: emojiText + font.pixelSize: emojiButton.width - 10 + } + }, + State { + name: "RELEASED" + PropertyChanges { + target: emojiText + font.pixelSize: emojiButton.width - 8 + } + } + ] + + + MouseArea { + anchors.fill: parent + hoverEnabled: true + + onEntered: { + emojiText.color = "black" + } + onExited: { + emojiText.color = "gray" + } + onPressedChanged: { + emojiButton.state = emojiButton.state == "PRESSED" ? "RELEASED" : "PRESSED" + } + onClicked: { + Qt.emojiClickedHandler(emojiText.text) + } + } + +} diff --git a/retroshare-qml-app/src/components/emoji/EmojiCategoryButton.qml b/retroshare-qml-app/src/components/emoji/EmojiCategoryButton.qml new file mode 100644 index 000000000..19e846d3e --- /dev/null +++ b/retroshare-qml-app/src/components/emoji/EmojiCategoryButton.qml @@ -0,0 +1,79 @@ +import QtQuick 2.7 +import QtQuick.Controls.Styles 1.2 + +Rectangle { + id: emojiCategoryButton + property string categoryName + + + function completedHandler() { + categoryName = eCatName + + //initialize + if (parent.currSelEmojiButton === undefined) { + clickedHandler() + } + } + + function pressedHandler() { + if (state != "SELECTED") { + state = state == "PRESSED" ? "RELEASED" : "PRESSED" + } + } + + function clickedHandler() { + if (parent.currSelEmojiButton !== undefined) { + parent.currSelEmojiButton.state = "RELEASED" + } + + parent.currSelEmojiButton = emojiCategoryButton + state = "SELECTED" + Qt.emojiCategoryChangedHandler(emojiCategoryButton.categoryName) + } + + + Text { + id: emojiText + color: "gray" + text: qsTr(eCatText) + font.pixelSize: emojiCategoryButton.width - 8 + anchors.centerIn: parent + } + + + state: "RELEASED" + states: [ + State { + name: "PRESSED" + PropertyChanges { + target: emojiText + font.pixelSize: emojiCategoryButton.width - 10 + } + }, + State { + name: "RELEASED" + PropertyChanges { + target: emojiText + font.pixelSize: emojiCategoryButton.width - 8 + } + }, + State { + name: "SELECTED" + PropertyChanges { + target: emojiCategoryButton + color: "#ADD6FF" + } + } + ] + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: emojiText.color = "black" + onExited: emojiText.color = "gray" + onPressedChanged: pressedHandler() + onClicked: clickedHandler() + } + + Component.onCompleted: completedHandler() +} diff --git a/retroshare-qml-app/src/components/emoji/EmojiPicker.qml b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml new file mode 100644 index 000000000..00f61e115 --- /dev/null +++ b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml @@ -0,0 +1,124 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import "emoji.js" as EmojiJSON + +Rectangle { + id: emojiPicker + property EmojiCategoryButton currSelEmojiButton + property variant emojiParsedJson + property int buttonWidth: 40 + property TextArea textArea + + //displays all Emoji of one categroy by modifying the ListModel of emojiGrid + function categoryChangedHandler (newCategoryName){ + emojiByCategory.clear() + + for (var i = 0; i < emojiParsedJson.emoji_by_category[newCategoryName].length; i++) { + var elem = emojiParsedJson.emoji_by_category[newCategoryName][i] + emojiByCategory.append({eCatName: newCategoryName, eCatText: elem}) + } + } + + //adds the clicked Emoji (and one ' ' if the previous character isn't an Emoji) to textArea + function emojiClickedHandler(selectedEmoji) { + var strAppnd = "" + var plainText = textArea.getText(0, textArea.length) + + if (plainText.length > 0) { + var lastChar = plainText[plainText.length-1] + if ((lastChar !== ' ') && (lastChar.charCodeAt(0) < 255)) { + strAppnd = " " + } + } + strAppnd += '' + selectedEmoji + '' + + textArea.insert(textArea.cursorPosition, strAppnd) + } + + //parses JSON, publishes button handlers and inits textArea + function completedHandler() { +// emojiParsedJson = JSON.parse(EmojiJSON.emoji_json) + emojiParsedJson = EmojiJSON.emoji_json + for (var i = 0; i < emojiParsedJson.emoji_categories.length; i++) { + var elem = emojiParsedJson.emoji_categories[i] + emojiCategoryButtons.append({eCatName: elem.name, eCatText: elem.emoji_unified}) + } + + Qt.emojiCategoryChangedHandler = categoryChangedHandler + Qt.emojiClickedHandler = emojiClickedHandler + + textArea.cursorPosition = textArea.length + textArea.Keys.pressed.connect(keyPressedHandler) + } + + + //checks if the previous character is an Emoji and adds a ' ' if that's the case + //this is necessary, because Emoji use a bigger font-size, and that font-size is kept using without a ' ' + function keyPressedHandler(event) { + var testStr = txtIn.getText(txtIn.length-2, txtIn.length) + var ptrn = new RegExp("[\uD800-\uDBFF][\uDC00-\uDFFF]") + if ((event.key !== Qt.Key_Backspace) && (ptrn.test(testStr))) { + txtIn.text += " " + txtIn.cursorPosition = txtIn.length + } + } + + + //all emoji of one category + ListModel { + id: emojiByCategory + } + + GridView { + id: emojiGrid + width: parent.width + anchors.fill: parent + anchors.bottomMargin: buttonWidth + cellWidth: buttonWidth; cellHeight: buttonWidth + + model: emojiByCategory + delegate: EmojiButton { + width: buttonWidth + height: buttonWidth + color: emojiPicker.color + } + } + + + //seperator + Rectangle { + color: emojiPicker.color + anchors.bottom: parent.bottom + width: parent.width + height: buttonWidth + } + Rectangle { + color: "black" + anchors.bottom: parent.bottom + anchors.bottomMargin: buttonWidth + width: parent.width + height: 1 + } + + //emoji category selector + ListView { + width: parent.width + anchors.bottom: parent.bottom + anchors.bottomMargin: buttonWidth + orientation: ListView.Horizontal + + model: emojiCategoryButtons + delegate: EmojiCategoryButton { + width: buttonWidth + height: buttonWidth + color: emojiPicker.color + } + } + + ListModel { + id: emojiCategoryButtons + } + + Component.onCompleted: completedHandler() +} + diff --git a/retroshare-qml-app/src/components/emoji/emoji.js b/retroshare-qml-app/src/components/emoji/emoji.js new file mode 100644 index 000000000..cfd751a60 --- /dev/null +++ b/retroshare-qml-app/src/components/emoji/emoji.js @@ -0,0 +1,1068 @@ +var emoji_json = { + "emoji_categories": [ + { + "name": "faces", + "emoji_unified": "😜", + "description": "Faces" + }, + { + "name": "cat_faces", + "emoji_unified": "😸", + "description": "Faces of Cats" + },{ + "name": "animals_and_plants", + "emoji_unified": "🐧", + "description": "Animals and Plants" + },{ + "name": "food_and_drink", + "emoji_unified": "🍻", + "description": "Food and Drinks" + },{ + "name": "places", + "emoji_unified": "🏯", + "description": "Places" + },{ + "name": "music_and_sport", + "emoji_unified": "🎧", + "description": "Music and Sport" + },{ + "name": "objects", + "emoji_unified": "💽", + "description": "Objects" + },{ + "name": "misc", + "emoji_unified": "👌", + "description": "Miscellaneous" + },{ + "name": "symbols", + "emoji_unified": "🔞", + "description": "Symbols" + },{ + "name": "transport", + "emoji_unified": "🚎", + "description": "Transport" + },{ + "name": "seven", + "emoji_unified": "🕴", + "description": "Unicode 7.0" + } + ], + "emoji_by_category": { + "animals_and_plants": [ + "🐶", + "🐺", + "🐱", + "🐭", + "🐹", + "🐰", + "🐸", + "🐯", + "🐨", + "🐻", + "🐷", + "🐽", + "🐮", + "🐗", + "🐵", + "🐒", + "🐴", + "🐑", + "🐘", + "🐼", + "🐧", + "🐦", + "🐤", + "🐥", + "🐣", + "🐔", + "🐍", + "🐢", + "🐛", + "🐝", + "🐜", + "🐞", + "🐌", + "🐙", + "🐚", + "🐠", + "🐟", + "🐬", + "🐳", + "🐋", + "🐄", + "🐏", + "🐀", + "🐃", + "🐅", + "🐇", + "🐉", + "🐎", + "🐐", + "🐓", + "🐕", + "🐖", + "🐁", + "🐂", + "🐲", + "🐡", + "🐊", + "🐫", + "🐪", + "🐆", + "🐈", + "🐩", + "🐾", + "💐", + "🌸", + "🌷", + "🍀", + "🌹", + "🌻", + "🌺", + "🍁", + "🍃", + "🍂", + "🌿", + "🌾", + "🍄", + "🌵", + "🌴", + "🌲", + "🌳", + "🌰", + "🌱", + "🌼" + ], + "cat_faces": [ + "😺", + "😸", + "😻", + "😽", + "😼", + "🙀", + "😿", + "😹", + "😾" + ], + "faces": [ + "😄", + "😃", + "😀", + "😊", + "☺", + "😉", + "😍", + "😘", + "😚", + "😗", + "😙", + "😜", + "😝", + "😛", + "😳", + "😁", + "😔", + "😌", + "😒", + "😞", + "😣", + "😢", + "😂", + "😭", + "😪", + "😥", + "😰", + "😅", + "😓", + "😩", + "😫", + "😨", + "😱", + "😠", + "😡", + "😤", + "😖", + "😆", + "😋", + "😷", + "😎", + "😴", + "😵", + "😲", + "😟", + "😦", + "😧", + "😈", + "👿", + "😮", + "😬", + "😐", + "😕", + "😯", + "😶", + "😇", + "😏", + "😑", + "👲", + "👳", + "👮", + "👷", + "💂", + "👶", + "👦", + "👧", + "👨", + "👩", + "👴", + "👵", + "👱", + "👼", + "👸", + "👹", + "👺", + "🙈", + "🙉", + "🙊", + "💀", + "👽", + "💩" + ], + "food_and_drink": [ + "☕", + "🍵", + "🍶", + "🍼", + "🍺", + "🍻", + "🍸", + "🍹", + "🍷", + "🍴", + "🍕", + "🍔", + "🍟", + "🍗", + "🍖", + "🍝", + "🍛", + "🍤", + "🍱", + "🍣", + "🍥", + "🍙", + "🍘", + "🍚", + "🍜", + "🍲", + "🍢", + "🍡", + "🍳", + "🍞", + "🍩", + "🍮", + "🍦", + "🍨", + "🍧", + "🎂", + "🍰", + "🍪", + "🍫", + "🍬", + "🍭", + "🍯", + "🍎", + "🍏", + "🍊", + "🍋", + "🍒", + "🍇", + "🍉", + "🍓", + "🍑", + "🍈", + "🍌", + "🍐", + "🍍", + "🍠", + "🍆", + "🍅", + "🌽" + ], + "misc": [ + "🔥", + "✨", + "🌟", + "💫", + "💥", + "💢", + "💦", + "💧", + "💤", + "💨", + "👂", + "👀", + "👃", + "👅", + "👄", + "👍", + "👎", + "👌", + "👊", + "✊", + "✌", + "👋", + "✋", + "👐", + "👆", + "👇", + "👉", + "👈", + "🙌", + "🙏", + "☝", + "👏", + "💪", + "🚶", + "🏃", + "💃", + "👫", + "👪", + "👬", + "👭", + "💏", + "💑", + "👯", + "🙆", + "🙅", + "💁", + "🙋", + "💆", + "💇", + "💅", + "👰", + "🙎", + "🙍", + "🙇" + ], + "music_and_sport": [ + "🎨", + "🎬", + "🎤", + "🎧", + "🎼", + "🎵", + "🎶", + "🎹", + "🎻", + "🎺", + "🎷", + "🎸", + "👾", + "🎮", + "🃏", + "🎴", + "🀄", + "🎲", + "🎯", + "🏈", + "🏀", + "⚽", + "⚾", + "🎾", + "🎱", + "🏉", + "🎳", + "⛳", + "🚵", + "🚴", + "🏁", + "🏇", + "🏆", + "🎿", + "🏂", + "🏊", + "🏄", + "🎣" + ], + "objects": [ + "🎍", + "💝", + "🎎", + "🎒", + "🎓", + "🎏", + "🎆", + "🎇", + "🎐", + "🎑", + "🎃", + "👻", + "🎅", + "🎄", + "🎁", + "🎋", + "🎉", + "🎊", + "🎈", + "🎌", + "🔮", + "🎥", + "📷", + "📹", + "📼", + "💿", + "📀", + "💽", + "💾", + "💻", + "📱", + "☎", + "📞", + "📟", + "📠", + "📡", + "📺", + "📻", + "🔊", + "🔉", + "🔈", + "🔇", + "🔔", + "🔕", + "📢", + "📣", + "⏳", + "⌛", + "⏰", + "⌚", + "🔓", + "🔒", + "🔏", + "🔐", + "🔑", + "🔎", + "💡", + "🔦", + "🔆", + "🔅", + "🔌", + "🔋", + "🔍", + "🛁", + "🛀", + "🚿", + "🚽", + "🔧", + "🔩", + "🔨", + "🚪", + "🚬", + "💣", + "🔫", + "🔪", + "💊", + "💉", + "💰", + "💴", + "💵", + "💷", + "💶", + "💳", + "💸", + "📲", + "📧", + "📥", + "📤", + "✉", + "📩", + "📨", + "📯", + "📫", + "📪", + "📬", + "📭", + "📮", + "📦", + "📝", + "📄", + "📃", + "📑", + "📊", + "📈", + "📉", + "📜", + "📋", + "📅", + "📆", + "📇", + "📁", + "📂", + "✂", + "📌", + "📎", + "✒", + "✏", + "📏", + "📐", + "📕", + "📗", + "📘", + "📙", + "📓", + "📔", + "📒", + "📚", + "📖", + "🔖", + "📛", + "🔬", + "🔭", + "📰" + ], + "places": [ + "🏠", + "🏡", + "🏫", + "🏢", + "🏣", + "🏥", + "🏦", + "🏪", + "🏩", + "🏨", + "💒", + "⛪", + "🏬", + "🏤", + "🌇", + "🌆", + "🏯", + "🏰", + "⛺", + "🏭", + "🗼", + "🗾", + "🗻", + "🌄", + "🌅", + "🌃", + "🗽", + "🌉", + "🎠", + "🎡", + "⛲", + "🎢", + "🚢" + ], + "seven": [ + "🌡", + "🌢", + "🌣", + "🌤", + "🌥", + "🌦", + "🌧", + "🌨", + "🌩", + "🌪", + "🌫", + "🌬", + "🌶", + "🍽", + "🎔", + "🎕", + "🎖", + "🎗", + "🎘", + "🎙", + "🎚", + "🎛", + "🎜", + "🎝", + "🎞", + "🎟", + "🏅", + "🏋", + "🏌", + "🏍", + "🏎", + "🏔", + "🏕", + "🏖", + "🏗", + "🏘", + "🏙", + "🏚", + "🏛", + "🏜", + "🏝", + "🏞", + "🏟", + "🏱", + "🏲", + "🏳", + "🏴", + "🏵", + "🏶", + "🏷", + "🐿", + "👁", + "📸", + "📽", + "📾", + "🔾", + "🔿", + "🕄", + "🕅", + "🕆", + "🕇", + "🕈", + "🕉", + "🕊", + "🕨", + "🕩", + "🕪", + "🕫", + "🕬", + "🕭", + "🕮", + "🕯", + "🕰", + "🕱", + "🕲", + "🕳", + "🕴", + "🕵", + "🕶", + "🕷", + "🕸", + "🕹", + "🕻", + "🕼", + "🕽", + "🕾", + "🕿", + "🖀", + "🖁", + "🖂", + "🖃", + "🖄", + "🖅", + "🖆", + "🖇", + "🖈", + "🖉", + "🖊", + "🖋", + "🖌", + "🖍", + "🖎", + "🖏", + "🖐", + "🖑", + "🖒", + "🖓", + "🖔", + "🖕", + "🖖", + "🖗", + "🖘", + "🖙", + "🖚", + "🖛", + "🖜", + "🖝", + "🖞", + "🖟", + "🖠", + "🖡", + "🖢", + "🖣", + "🖥", + "🖦", + "🖧", + "🖨", + "🖩", + "🖪", + "🖫", + "🖬", + "🖭", + "🖮", + "🖯", + "🖰", + "🖱", + "🖲", + "🖳", + "🖴", + "🖵", + "🖶", + "🖷", + "🖸", + "🖹", + "🖺", + "🖻", + "🖼", + "🖽", + "🖾", + "🖿", + "🗀", + "🗀", + "🗂", + "🗃", + "🗄", + "🗅", + "🗆", + "🗇", + "🗈", + "🗉", + "🗊", + "🗋", + "🗌", + "🗍", + "🗎", + "🗏", + "🗐", + "🗑", + "🗒", + "🗓", + "🗔", + "🗕", + "🗖", + "🗗", + "🗘", + "🗙", + "🗚", + "🗛", + "🗜", + "🗝", + "🗞", + "🗟", + "🗠", + "🗡", + "🗢", + "🗣", + "🗤", + "🗥", + "🗦", + "🗧", + "🗨", + "🗩", + "🗪", + "🗫", + "🗬", + "🗭", + "🗯", + "🗯", + "🗰", + "🗱", + "🗲", + "🗳", + "🗴", + "🗵", + "🗶", + "🗷", + "🗸", + "🗹", + "🗺", + "🙁", + "🙂", + "🛆", + "🛇", + "🛈", + "🛉", + "🛊", + "🛋", + "🛌", + "🛍", + "🛎", + "🛏", + "🛠", + "🛡", + "🛢", + "🛣", + "🛤", + "🛥", + "🛦", + "🛧", + "🛨", + "🛩", + "🛪", + "🛫", + "🛬", + "🛰", + "🛱", + "🛲", + "🛳" + ], + "symbols": [ + "1⃣", + "2⃣", + "3⃣", + "4⃣", + "5⃣", + "6⃣", + "7⃣", + "8⃣", + "9⃣", + "0⃣", + "🔟", + "🔢", + "#⃣", + "🔣", + "⬆", + "⬇", + "⬅", + "➡", + "🔠", + "🔡", + "🔤", + "↗", + "↖", + "↘", + "↙", + "↔", + "↕", + "🔄", + "◀", + "▶", + "🔼", + "🔽", + "↩", + "↪", + "ℹ", + "⏪", + "⏩", + "⏫", + "⏬", + "⤵", + "⤴", + "🆗", + "🔀", + "🔁", + "🔂", + "🆕", + "🆙", + "🆒", + "🆓", + "🆖", + "📶", + "🎦", + "🈁", + "🈯", + "🈳", + "🈵", + "🈴", + "🈲", + "🉐", + "🈹", + "🈺", + "🈶", + "🈚", + "🚻", + "🚹", + "🚺", + "🚼", + "🚾", + "🚰", + "🚮", + "🅿", + "♿", + "🚭", + "🈷", + "🈸", + "🈂", + "Ⓜ", + "🛂", + "🛄", + "🛅", + "🛃", + "🉑", + "㊙", + "㊗", + "🆑", + "🆘", + "🆔", + "🚫", + "🔞", + "📵", + "🚯", + "🚱", + "🚳", + "🚷", + "🚸", + "⛔", + "✳", + "❇", + "❎", + "✅", + "✴", + "💟", + "🆚", + "📳", + "📴", + "🅰", + "🅱", + "🆎", + "🅾", + "💠", + "➿", + "♻", + "♈", + "♉", + "♊", + "♋", + "♌", + "♍", + "♎", + "♏", + "♐", + "♑", + "♒", + "♓", + "⛎🔯", + "🏧", + "💹", + "💲", + "💱", + "©", + "®", + "™", + "❌", + "‼", + "⁉", + "❗", + "❓", + "❕", + "❔", + "⭕", + "🔝", + "🔚", + "🔙", + "🔛", + "🔜", + "🔃", + "🕛", + "🕧", + "🕐", + "🕜", + "🕑", + "🕝", + "🕒", + "🕞", + "🕓", + "🕟", + "🕔", + "🕠", + "🕕", + "🕖", + "🕗", + "🕘", + "🕙", + "🕚", + "🕡", + "🕢", + "🕣", + "🕤", + "🕥", + "🕦", + "✖", + "➕", + "➖", + "➗", + "♠", + "♥", + "♣", + "♦", + "💮", + "💯", + "✔", + "☑", + "🔘", + "🔗", + "➰", + "〰", + "〽", + "🔱", + "◼", + "◻", + "◾", + "◽", + "▪", + "▫", + "🔺", + "🔲", + "🔳", + "⚫", + "⚪", + "🔴", + "🔵", + "🔻", + "⬜", + "⬛", + "🔶", + "🔷", + "🔸", + "🔹" + ], + "transport": [ + "⛵", + "🚤", + "🚣", + "⚓", + "🚀", + "✈", + "💺", + "🚁", + "🚂", + "🚊", + "🚉", + "🚞", + "🚆", + "🚄", + "🚅", + "🚈", + "🚇", + "🚝", + "🚋", + "🚃", + "🚎", + "🚌", + "🚍", + "🚙", + "🚘", + "🚗", + "🚕", + "🚖", + "🚛", + "🚚", + "🚨", + "🚓", + "🚔", + "🚒", + "🚑", + "🚐", + "🚲", + "🚡", + "🚟", + "🚠", + "🚜", + "💈", + "🚏", + "🎫", + "🚦", + "🚥", + "⚠", + "🚧", + "🔰", + "⛽", + "🏮", + "🎰", + "♨", + "🗿", + "🎪", + "🎭", + "📍", + "🚩" + ] + } +}; diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index ced9047d4..a27428738 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -47,5 +47,9 @@ icons/add.svg icons/keyring.svg components/TextAndIcon.qml + components/emoji/EmojiPicker.qml + components/emoji/EmojiCategoryButton.qml + components/emoji/EmojiButton.qml + components/emoji/emoji.js From e1498603be723e188de4865c9a919fd1fd22db6b Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 15:36:55 +0200 Subject: [PATCH 085/107] Use emoji picker on chat view --- retroshare-qml-app/src/ChatView.qml | 47 +++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index eb2b66b3e..4e07b6039 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -22,6 +22,7 @@ import QtQuick.Layouts 1.2 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton import "./components" +import "./components/emoji" Item { @@ -104,10 +105,39 @@ Item } + EmojiPicker { + id: emojiPicker + + anchors.fill: parent + anchors.topMargin: parent.height / 2 + anchors.bottomMargin: categorySelectorHeight + + property int categorySelectorHeight: 40 + + color: "white" + buttonWidth: 40 + textArea: inferiorPanel.textMessageArea //the TextArea in which EmojiPicker is pasting the Emoji into + + state: "EMOJI_HIDDEN" + states: [ + State { + name: "EMOJI_HIDDEN" + PropertyChanges { target: emojiPicker; anchors.topMargin: parent.height } + PropertyChanges { target: emojiPicker; anchors.bottomMargin: -1 } + }, + State { + name: "EMOJI_SHOWN" + PropertyChanges { target: emojiPicker; anchors.topMargin: parent.height / 2 } + PropertyChanges { target: emojiPicker; anchors.bottomMargin: categorySelectorHeight } + } + ] + } + Item { property var styles: StyleChat.inferiorPanel + property alias textMessageArea: msgComposer.textMessageArea id: inferiorPanel height: ( msgComposer.height > styles.height)? msgComposer.height: styles.height @@ -147,6 +177,7 @@ Item { id: msgComposer property var styles: StyleChat.inferiorPanel.msgComposer + property alias textMessageArea: flickable.msgField anchors.verticalCenter: parent.verticalCenter anchors.left: attachButton.right @@ -161,6 +192,8 @@ Item Flickable { id: flickable + property alias msgField: msgField + anchors.fill: parent flickableDirection: Flickable.VerticalFlick @@ -190,6 +223,9 @@ Item focus: true + inputMethodHints: Qt.ImhMultiLine + textFormat: TextEdit.RichText + onTextChanged: { if (msgField.length == 0) @@ -230,8 +266,6 @@ Item } } - - BtnIcon { @@ -248,6 +282,15 @@ Item anchors.margins: styles.margin imgUrl: styles.emojiIconUrl + + onClicked: { + if (emojiPicker.state == "EMOJI_HIDDEN") { + emojiPicker.state = "EMOJI_SHOWN" + } else { + emojiPicker.state = "EMOJI_HIDDEN" + } + } + } BtnIcon From 2d7e7d321a2245558c6d44dbd33083b786dbf06e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 16:58:19 +0200 Subject: [PATCH 086/107] Set message bar bigger --- retroshare-qml-app/src/styles/ChatStyle.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/styles/ChatStyle.qml b/retroshare-qml-app/src/styles/ChatStyle.qml index 84216a487..3dd14aef3 100644 --- a/retroshare-qml-app/src/styles/ChatStyle.qml +++ b/retroshare-qml-app/src/styles/ChatStyle.qml @@ -28,7 +28,7 @@ QtObject { property QtObject inferiorPanel: QtObject{ // Panel globals - readonly property int height: 40 + readonly property int height: 50 readonly property string backgroundColor: "white" readonly property string borderColor: "lightGrey" @@ -44,8 +44,8 @@ QtObject { // Button Icon property QtObject btnIcon: QtObject{ - readonly property int width: 30 - readonly property int height: 30 + readonly property int width: 40 + readonly property int height: 40 readonly property int margin: 5 From f975f340a435abd3d7dbf96a16df2f430eaac4e5 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 17:02:00 +0200 Subject: [PATCH 087/107] Hide emoji picker when a message is sent --- retroshare-qml-app/src/ChatView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 4e07b6039..ea4142eb1 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -363,6 +363,7 @@ Item function sendMessage () { + if (emojiPicker.state == "EMOJI_SHOWN") emojiPicker.state = "EMOJI_HIDDEN" var jsonData = {"chat_id":chatView.chatId, "msg":msgField.text} rsApi.request( "/chat/send_message", JSON.stringify(jsonData), function(par) { msgField.text = ""; } ) From b38c9444849e025264bff233f0865cc5678b1305 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 17:02:32 +0200 Subject: [PATCH 088/107] Solve bad name reference error --- retroshare-qml-app/src/components/emoji/EmojiPicker.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/components/emoji/EmojiPicker.qml b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml index 00f61e115..58c23008d 100644 --- a/retroshare-qml-app/src/components/emoji/EmojiPicker.qml +++ b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml @@ -55,11 +55,11 @@ Rectangle { //checks if the previous character is an Emoji and adds a ' ' if that's the case //this is necessary, because Emoji use a bigger font-size, and that font-size is kept using without a ' ' function keyPressedHandler(event) { - var testStr = txtIn.getText(txtIn.length-2, txtIn.length) + var testStr = textArea.getText(textArea.length-2, textArea.length) var ptrn = new RegExp("[\uD800-\uDBFF][\uDC00-\uDFFF]") if ((event.key !== Qt.Key_Backspace) && (ptrn.test(testStr))) { - txtIn.text += " " - txtIn.cursorPosition = txtIn.length + textArea.text += " " + textArea.cursorPosition = textArea.length } } From 6ea85de4bad06f46d5d2c2e430532b1d486db230 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 17:13:44 +0200 Subject: [PATCH 089/107] Disable rich text on message field and span tag when emoji is inserted --- retroshare-qml-app/src/ChatView.qml | 1 - retroshare-qml-app/src/components/emoji/EmojiPicker.qml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index ea4142eb1..3b9a249e5 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -224,7 +224,6 @@ Item focus: true inputMethodHints: Qt.ImhMultiLine - textFormat: TextEdit.RichText onTextChanged: { diff --git a/retroshare-qml-app/src/components/emoji/EmojiPicker.qml b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml index 58c23008d..2818fd789 100644 --- a/retroshare-qml-app/src/components/emoji/EmojiPicker.qml +++ b/retroshare-qml-app/src/components/emoji/EmojiPicker.qml @@ -27,10 +27,10 @@ Rectangle { if (plainText.length > 0) { var lastChar = plainText[plainText.length-1] if ((lastChar !== ' ') && (lastChar.charCodeAt(0) < 255)) { - strAppnd = " " + strAppnd = " " } } - strAppnd += '' + selectedEmoji + '' + strAppnd += selectedEmoji textArea.insert(textArea.cursorPosition, strAppnd) } From 161bd4c227fbb21b25a79410276d0ec31b1c0d6b Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 1 Jul 2017 18:03:55 +0200 Subject: [PATCH 090/107] Increase font size --- retroshare-qml-app/src/ChatBubbleDelegate.qml | 1 + retroshare-qml-app/src/ChatView.qml | 4 +++- retroshare-qml-app/src/styles/ChatStyle.qml | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 3b620a5fd..d7c346cfd 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -95,6 +95,7 @@ Item )? Text.AlignRight : Text.AlignLeft wrapMode: Text.Wrap + font.pixelSize: styles.messageTextSize } } diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 3b9a249e5..d12294bb4 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -112,7 +112,7 @@ Item anchors.topMargin: parent.height / 2 anchors.bottomMargin: categorySelectorHeight - property int categorySelectorHeight: 40 + property int categorySelectorHeight: 50 color: "white" buttonWidth: 40 @@ -225,6 +225,8 @@ Item inputMethodHints: Qt.ImhMultiLine + font.pixelSize: styles.messageBoxTextSize + onTextChanged: { if (msgField.length == 0) diff --git a/retroshare-qml-app/src/styles/ChatStyle.qml b/retroshare-qml-app/src/styles/ChatStyle.qml index 3dd14aef3..d99c66889 100644 --- a/retroshare-qml-app/src/styles/ChatStyle.qml +++ b/retroshare-qml-app/src/styles/ChatStyle.qml @@ -23,6 +23,9 @@ QtObject { readonly property string colorSenderName: "cornflowerblue" readonly property string colorMessageTime: "grey" + // Text + readonly property int messageTextSize: 15 + } @@ -35,6 +38,7 @@ QtObject { property QtObject msgComposer: QtObject{ readonly property string placeHolder: "Send message..." readonly property int maxHeight: 180 + readonly property int messageBoxTextSize: 15 property QtObject background: Rectangle { color: "transparent" @@ -44,8 +48,8 @@ QtObject { // Button Icon property QtObject btnIcon: QtObject{ - readonly property int width: 40 - readonly property int height: 40 + readonly property int width: 35 + readonly property int height: 35 readonly property int margin: 5 From 0a17cbefec6bc58360fff42192e3e7aa413189a0 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 3 Jul 2017 17:03:03 +0200 Subject: [PATCH 091/107] Support for preedit text on predictive keyboards --- retroshare-qml-app/src/ChatView.qml | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index d12294bb4..5e14e82c3 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -229,11 +229,13 @@ Item onTextChanged: { - if (msgField.length == 0) + var msgLenght = (msgField.preeditText)? msgField.preeditText.length : msgField.length + + if (msgLenght == 0) { sendButton.state = "" } - else if (msgField.length > 0) + else if (msgLenght > 0 ) { sendButton.state = "SENDBTN" } @@ -263,6 +265,10 @@ Item shiftPressed = false } } + function reset () + { + Qt.inputMethod.reset() + } } } } @@ -365,9 +371,26 @@ Item function sendMessage () { if (emojiPicker.state == "EMOJI_SHOWN") emojiPicker.state = "EMOJI_HIDDEN" - var jsonData = {"chat_id":chatView.chatId, "msg":msgField.text} + + var msgText = getCompleteMessageText() + + var jsonData = {"chat_id":chatView.chatId, "msg":msgText} rsApi.request( "/chat/send_message", JSON.stringify(jsonData), - function(par) { msgField.text = ""; } ) + function(par) + { + msgField.text = "" + msgField.reset(); + }) + } + + // This function is needed for the compatibility with auto predictive keyboards + function getCompleteMessageText (){ + var completeMsg + if (msgField.preeditText) completeMsg = msgField.text + msgField.preeditText + else completeMsg = msgField.text + return completeMsg + + } } From d19950f0dff2abf5b07a75f98057d975a299810a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 15:35:45 +0200 Subject: [PATCH 092/107] Add support for back key on desktop keyboard --- retroshare-qml-app/src/main-app.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 56873dec3..60d0a62b7 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -193,6 +193,25 @@ ApplicationWindow anchors.fill: parent focus: true onCurrentItemChanged: + { + if (currentItem) + { + currentItem.forceActiveFocus() + setStatus (currentItem) + } + } + + Keys.onReleased: + { + if ((event.key === Qt.Key_Back || Qt.Key_Backspace) && stackView.depth > 1) + { + stackView.pop(); + event.accepted = true; + setStatus (stackView.currentItem) + } + } + + function setStatus (currentItem) { if (currentItem) { From 80cc1b4520c5d5b0a018276427e232d6e2fe6f9d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 15:51:03 +0200 Subject: [PATCH 093/107] Call toolbar change state when pop stackview --- retroshare-qml-app/src/ChatView.qml | 6 +++++- retroshare-qml-app/src/Contacts.qml | 8 ++++++-- retroshare-qml-app/src/main-app.qml | 12 +++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 5e14e82c3..484e670f8 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -58,12 +58,16 @@ Item Component.onCompleted: { refreshData() + } + onFocusChanged: focus && refreshData() + + function changeState () + { toolBar.state = "CHATVIEW" gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) toolBar.titleText = gxsInfo.name toolBar.loaderSource = userHash } - onFocusChanged: focus && refreshData() Component { diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index b4357a90e..415c33eb8 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -34,12 +34,16 @@ Item Component.onCompleted: { - toolBar.state = "CONTACTSVIEW" - toolBar.searchBtnCb = toggleSearchBox refreshAll() } onFocusChanged: focus && refreshAll() + function changeState () + { + toolBar.state = "CONTACTSVIEW" + toolBar.searchBtnCb = toggleSearchBox + } + WorkerScript { id: contactsSortWorker diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 60d0a62b7..daa61504e 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -221,17 +221,15 @@ ApplicationWindow { toolBar.state = "DEFAULT" } + else if (typeof currentItem.changeState === 'function') + { + currentItem.changeState () + } + currentItem.focus = true } } - Keys.onReleased: - if (event.key === Qt.Key_Back && stackView.depth > 1) - { - stackView.pop(); - event.accepted = true; - } - state: "core_down" initialItem: BusyOverlay { message: qsTr("Connecting to core...") } From 8ebd0f770f5b58bf28e2dc0b1b72320b0fa90f75 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 17:20:42 +0200 Subject: [PATCH 094/107] Solve crash bug with toolbar loader when pop push a chat view, loading AvatarOrColorHash from toolbar --- retroshare-qml-app/src/ChatView.qml | 16 +--------------- retroshare-qml-app/src/main-app.qml | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 484e670f8..3cbc41b72 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -65,22 +65,8 @@ Item { toolBar.state = "CHATVIEW" gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) + toolBar.gxsSource = gxsInfo.gxs toolBar.titleText = gxsInfo.name - toolBar.loaderSource = userHash - } - - Component - { - id: userHash - - AvatarOrColorHash - { - id: colorHash - - gxs_id: gxsInfo.gxs - height: toolBar.height - 4 - anchors.leftMargin: 2 - } } diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index daa61504e..8138d0eab 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -56,11 +56,13 @@ ApplicationWindow function addUriHandler(path, fun) { uriHandlersRegister[path] = fun } function delUriHandler(path, fun) { delete uriHandlersRegister[path] } + header: ToolBar { id: toolBar property alias titleText: toolBarText.text property alias loaderSource: imageLoader.sourceComponent + property alias gxsSource: imageLoader.gxsSource property string defaultLabel: "RetroShare" property var iconsSize: (coreReady)? height - 10 : 0 @@ -88,6 +90,7 @@ ApplicationWindow { name: "CHATVIEW" PropertyChanges { target: toolBarText; mouseA.visible: false } + PropertyChanges { target: toolBar; loaderSource: userHash } // PropertyChanges { target: toolBar; backBtnVisible: true } }, State @@ -109,8 +112,12 @@ ApplicationWindow { id: imageLoader anchors.verticalCenter: parent.verticalCenter - height: Math.max(30, toolBar.height - 4) + height: toolBar.height - 4 anchors.left: tolbarLeftPadding.right + asynchronous: true + + property string gxsSource; + } Component @@ -126,6 +133,21 @@ ApplicationWindow } } + Component + { + id: userHash + + AvatarOrColorHash + { + id: colorHash + + gxs_id: imageLoader.gxsSource + height: toolBar.height - 4 + anchors.leftMargin: 2 + } + + } + Label { property alias mouseA: mouseA @@ -196,8 +218,7 @@ ApplicationWindow { if (currentItem) { - currentItem.forceActiveFocus() - setStatus (currentItem) + setStatus (currentItem) } } @@ -230,6 +251,7 @@ ApplicationWindow } } + state: "core_down" initialItem: BusyOverlay { message: qsTr("Connecting to core...") } From ddaa03514c0f9d88e0096c7bc629ed645fb439be Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 18:46:11 +0200 Subject: [PATCH 095/107] Solve contacts view onhover bug on android platforms --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 21ed893c0..5267447f6 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -32,18 +32,18 @@ Item property var lastMessageData: ({}) property var locale: Qt.locale() - Rectangle { + id: contactItem anchors.fill: parent - color: contactItem.containsMouse ? "lightgrey" : "transparent" + color: contactItemArea.containsPress ? "lightgrey" : "transparent" width: parent.width height: parent.height MouseArea { - id: contactItem + id: contactItemArea anchors.fill: parent onClicked: { From 163f6b14afd9bf4e2399904d1c90e6764483b174 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 7 Jul 2017 14:28:41 +0200 Subject: [PATCH 096/107] Qml-app update all available icons to SVG --- retroshare-qml-app/src/ContactDetails.qml | 5 ++-- .../src/GxsIdentityDelegate.qml | 5 ++-- retroshare-qml-app/src/Locations.qml | 2 +- retroshare-qml-app/src/RsLoginPassView.qml | 4 ++- retroshare-qml-app/src/TrustedNodeDetails.qml | 11 ++++--- retroshare-qml-app/src/TrustedNodesView.qml | 5 ++-- .../src/components/ColorHash.qml | 9 ++++-- retroshare-qml-app/src/components/SideBar.qml | 6 ++-- .../src/icons/application-menu.png | Bin 387 -> 0 bytes .../src/icons/application-menu.svg | 13 +++++++++ .../src/icons/edit-image-face-detect.png | Bin 2926 -> 0 bytes .../src/icons/edit-image-face-detect.svg | 13 +++++++++ .../src/icons/emblem-locked.png | Bin 2204 -> 0 bytes .../src/icons/emblem-locked.svg | 18 ++++++++++++ .../src/icons/network-connect.svg | 13 +++++++++ .../src/icons/network-disconnect.svg | 21 ++++++++++++++ .../src/icons/rating-unrated.png | Bin 5426 -> 0 bytes .../src/icons/rating-unrated.svg | 13 +++++++++ retroshare-qml-app/src/icons/rating.png | Bin 3519 -> 0 bytes retroshare-qml-app/src/icons/rating.svg | 17 +++++++++++ .../src/icons/state-offline.png | Bin 4498 -> 0 bytes .../src/icons/state-offline.svg | 27 ++++++++++++++++++ retroshare-qml-app/src/icons/state-ok.png | Bin 5080 -> 0 bytes retroshare-qml-app/src/icons/state-ok.svg | 24 ++++++++++++++++ retroshare-qml-app/src/main-app.qml | 6 ++-- retroshare-qml-app/src/qml.qrc | 16 ++++++----- 26 files changed, 202 insertions(+), 26 deletions(-) delete mode 100644 retroshare-qml-app/src/icons/application-menu.png create mode 100644 retroshare-qml-app/src/icons/application-menu.svg delete mode 100644 retroshare-qml-app/src/icons/edit-image-face-detect.png create mode 100644 retroshare-qml-app/src/icons/edit-image-face-detect.svg delete mode 100644 retroshare-qml-app/src/icons/emblem-locked.png create mode 100644 retroshare-qml-app/src/icons/emblem-locked.svg create mode 100644 retroshare-qml-app/src/icons/network-connect.svg create mode 100644 retroshare-qml-app/src/icons/network-disconnect.svg delete mode 100644 retroshare-qml-app/src/icons/rating-unrated.png create mode 100644 retroshare-qml-app/src/icons/rating-unrated.svg delete mode 100644 retroshare-qml-app/src/icons/rating.png create mode 100644 retroshare-qml-app/src/icons/rating.svg delete mode 100644 retroshare-qml-app/src/icons/state-offline.png create mode 100644 retroshare-qml-app/src/icons/state-offline.svg delete mode 100644 retroshare-qml-app/src/icons/state-ok.png create mode 100644 retroshare-qml-app/src/icons/state-ok.svg diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index c30e4b6a6..836822d24 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -69,9 +69,10 @@ Item Image { source: cntDt.is_contact ? - "qrc:/icons/rating.png" : - "qrc:/icons/rating-unrated.png" + "qrc:/icons/rating.svg" : + "qrc:/icons/rating-unrated.svg" height: parent.height - 4 + sourceSize.height: height fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 21ed893c0..92abc5667 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -185,9 +185,10 @@ Item Image { source: model.is_contact ? - "qrc:/icons/rating.png" : - "qrc:/icons/rating-unrated.png" + "qrc:/icons/rating.svg" : + "qrc:/icons/rating-unrated.svg" height: parent.height - 4 + sourceSize.height: height fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter diff --git a/retroshare-qml-app/src/Locations.qml b/retroshare-qml-app/src/Locations.qml index 5662adaf7..1742ac26a 100644 --- a/retroshare-qml-app/src/Locations.qml +++ b/retroshare-qml-app/src/Locations.qml @@ -47,7 +47,7 @@ Item target: loginView visible: true buttonText: qsTr("Save") - iconUrl: "qrc:/icons/edit-image-face-detect.png" + iconUrl: "qrc:/icons/edit-image-face-detect.svg" suggestionText: qsTr("Create your profile") onSubmit: { diff --git a/retroshare-qml-app/src/RsLoginPassView.qml b/retroshare-qml-app/src/RsLoginPassView.qml index 88f92e2ae..7ea4a800d 100644 --- a/retroshare-qml-app/src/RsLoginPassView.qml +++ b/retroshare-qml-app/src/RsLoginPassView.qml @@ -24,7 +24,7 @@ Item { id: loginView property string buttonText: qsTr("Unlock") - property string iconUrl: "qrc:/icons/emblem-locked.png" + property string iconUrl: "qrc:/icons/emblem-locked.svg" property string login property bool loginPreset: false property bool advancedMode: false @@ -53,6 +53,8 @@ Item { source: loginView.iconUrl Layout.alignment: Qt.AlignHCenter + height: 128 + sourceSize.height: height } Text diff --git a/retroshare-qml-app/src/TrustedNodeDetails.qml b/retroshare-qml-app/src/TrustedNodeDetails.qml index 252f744d1..5aac8315e 100644 --- a/retroshare-qml-app/src/TrustedNodeDetails.qml +++ b/retroshare-qml-app/src/TrustedNodeDetails.qml @@ -37,9 +37,11 @@ Item { id: nodeStatusImage source: isOnline? - "icons/state-ok.png" : - "icons/state-offline.png" + "icons/state-ok.svg" : + "icons/state-offline.svg" + height: 128 + sourceSize.height: height fillMode: Image.PreserveAspectFit anchors.top: parent.top @@ -125,10 +127,11 @@ Item { id: statusImage source: model.is_online ? - "icons/state-ok.png" : - "icons/state-offline.png" + "icons/network-connect.svg" : + "icons/network-disconnect.svg" height: parent.height - 4 + sourceSize.height: height fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter } diff --git a/retroshare-qml-app/src/TrustedNodesView.qml b/retroshare-qml-app/src/TrustedNodesView.qml index f2b0a3843..9bb79317e 100644 --- a/retroshare-qml-app/src/TrustedNodesView.qml +++ b/retroshare-qml-app/src/TrustedNodesView.qml @@ -75,10 +75,11 @@ Item { id: statusImage source: isOnline? - "icons/state-ok.png" : - "icons/state-offline.png" + "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 diff --git a/retroshare-qml-app/src/components/ColorHash.qml b/retroshare-qml-app/src/components/ColorHash.qml index 7d9f6ca16..ba4b5be32 100644 --- a/retroshare-qml-app/src/components/ColorHash.qml +++ b/retroshare-qml-app/src/components/ColorHash.qml @@ -28,8 +28,13 @@ Rectangle Image { - source: "qrc:/icons/edit-image-face-detect.png" - anchors.fill: parent + source: "qrc:/icons/edit-image-face-detect.svg" + anchors.centerIn: parent + height: parent.height + width: parent.width + sourceSize.height: height + sourceSize.width: width + fillMode: Image.PreserveAspectFit } Rectangle diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 36080dcb7..790e1fb54 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -16,11 +16,11 @@ Drawer Rectangle { - width: parent.width - height: parent.height + width: parent.width + height: parent.height - ListView + ListView { id: listView currentIndex: -1 diff --git a/retroshare-qml-app/src/icons/application-menu.png b/retroshare-qml-app/src/icons/application-menu.png deleted file mode 100644 index 07efd491fd1a2ecbe40c005541b9213c60cdeeae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^4M3dD!3HGv@9pXWQY^(zo*^7SP{WbZ0pxQQctjR6 zFic(y!i*O;eK-ablq_+LC<)F_D=AMbN@XZ7FW1Y=%Pvk%EJ)SMFG`>N&PIxXfsw(} z#WAE}&fD9Dg+~HJSRCu8O3aO1p(0`D^DM<@l4Hz=rk8FT4ldb!?sLt)6StPJ8+bDm zGIa<$%wc%MBB0)2!FYsI!4Id + + + + + diff --git a/retroshare-qml-app/src/icons/edit-image-face-detect.png b/retroshare-qml-app/src/icons/edit-image-face-detect.png deleted file mode 100644 index 3a5324bbd886eb7cf5f358777d51bb61371dcccf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2926 zcmbtWc{CJUAHHKO^IB)9ELmnGicB)9NnXns#4rijr%3kfdPRmQ#aN<}7+FVl?O9_e z$u?n>&XEiyl9R$vb&PAlpBzua8|Z`r*~|;sn&O| z-#vRmAx}X$`Dl$p3_;%SY5jnPcN5Yz4t4ldu#iHe0`KvI_ z@}4e&rZV+rHZ`ke*S#9Mr;QCQjQ4smb;dUH7QJIvdvZtexP;|e@4U@?+72`4#2hoM zgR5s64?~?&?b+BudrcI$qzO~!zan8>+RvPnV%540YA>c8rA#?OWm5kg5YsOq5lfyN zv&%`523e63pnRgb%KT*)JvyK2qmMbAo@B+^?X(A%LrOps;#T#7pcFLCaTBH`?+;p^ z3I1Pj=hra~i;foOpX>>He7+5AMv@bMxVJiS3B3az>W zB_usF>!&PuK%LJ+!ty%pIrFnUfU$DglatSfl`x#rno5&mRUlzC#|%eNSMoL@!4Th% zkM6jAAVTN(@txqAceggbYox0=2=cC?NMRR6?e2Vo4>y7HSAH*(Q($j2w=swIjeCSQ z&tM5xqoTH}2oBET5jT&D4qcv;Vi^O~;<0<+<@@ZTm63Bjxe|W2|A6Jqkpw2yA2w4| zwYew4IL!Lk_Ed#Uol^uW^fKrS*!k_@t2MR=)DeB7&)KZw^7vs%7O8AycqxruR$W`W z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u=A{=4-MP*7Ux zod&;vLXe>YE*p2cJ^{wbh~+U89%)oa7gQv=${?@BAsv-W&S-#u8Mdqqik>Ed8mv0k zI_xl?v8Cv88tEx!FVM60@t~!CIYH|H=i+>*QDjg+Pl$toe`0v@|iJNiy*g7d1`e zUH4A9T}KX!y1iIzXve0$NTKyYZ)cu)Q<_-z72BgQK0dy~bheaxmjanUiMEo#AfMx> zk&#G?LhB!Vm|7@Sp`}i+^U4Ei4c{=6`QQdTHmGk$-J2;p>BiFtTad>WOmcB?@qKgS zH?Dj;O=MEXD^MUj diff --git a/retroshare-qml-app/src/icons/edit-image-face-detect.svg b/retroshare-qml-app/src/icons/edit-image-face-detect.svg new file mode 100644 index 000000000..4e2ebb93b --- /dev/null +++ b/retroshare-qml-app/src/icons/edit-image-face-detect.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/retroshare-qml-app/src/icons/emblem-locked.png b/retroshare-qml-app/src/icons/emblem-locked.png deleted file mode 100644 index fb1ec9eb6774562cb15248b81b4008f56c08b37a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2204 zcmd5;_fwMz6MjPvMWjX$0wM~WbVXVMp;ze$(mN^;N(i9^LX|2dbfriWK{<&629X31 zqrjn{2psi<5KelL(3FdR!1w#NGrQ03&NDl+GdsJRX=7!=!zs!M0057fsi7SMale&= zjbZzByoVUTg3>p0;9y8RhhGLG28Ws6LIJ=m`nQ6f-s?|cBt;^PoFnZ+10pfr5&i%M zgHgPL3_|&OhxsdpMg%_CfQbSChlrV>oJy^YkARvvX^qI;dUZ)cnZsEci`i6l)5~ ze}gw|iU|X%OS*vQ>hx`DmIcw07NyoGgp00z4}$C4)vZgagk=>2q!56OIy6S=>XJrTwlc7w{=+EAD*@$ywU-L3=xg=6Id;u z-Gw<`IhJ17C0_o8rb2Waa2+zQT;->6wrZJ;cd7M4%WBtN(015$ZEzO4^|2?b?fi}cd8tmE@Qn3L9)hMJ_G;p^y5f@AZyCau;Q=whLIj^kzt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j{D&>+S1qInXz}$G!12^u}Wqf z(7=C)Z!fK6HwCiTqqmnb$XHO3{RWp8K3qHb&lw0pvlz#;!bfgk5kwG|dH^l|o}d*8Zl7 zAsRPHg-~#lixgIAJYGUZ5lXVzB$cm${3+!Q>o3#%dw5Rad`0d<7gBSPSD(1F^&O>e zhI1-v3zP+UT`F;!9k6Sc+;YJ(2Pqz(obFfk|4s$mkA!a}1%ZC7 z#!xuv%z<~IHymBFg>+DdBlnPsY>YcZNwtIw_5ST|KQ7&;o1^^ZQ90Zx;n{Rc65|++ zoT=w?W-n?Mw{g4yzCBV>9!0fID21N>h&*1*Y2mnH=*;njQfcF8G}l*B(}y9f#_YOq z?H?uPO;fq$otHUgd=>CG6|&c!9U(}Z9J5eH*5R5)#ds7-ggsHW{>2Myo + + + + + + diff --git a/retroshare-qml-app/src/icons/network-connect.svg b/retroshare-qml-app/src/icons/network-connect.svg new file mode 100644 index 000000000..5f0c0b82e --- /dev/null +++ b/retroshare-qml-app/src/icons/network-connect.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/retroshare-qml-app/src/icons/network-disconnect.svg b/retroshare-qml-app/src/icons/network-disconnect.svg new file mode 100644 index 000000000..1a1575cf1 --- /dev/null +++ b/retroshare-qml-app/src/icons/network-disconnect.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/retroshare-qml-app/src/icons/rating-unrated.png b/retroshare-qml-app/src/icons/rating-unrated.png deleted file mode 100644 index 98ef79739867cfac775992537313e95726d81931..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5426 zcmXX~1yoee7k-O?NT-D4BAv2;g!IxZDlABc!V*%_4JwU_NbX9PgfuQ4N-61zbS#K; z%7V1~-|w9NoHK9En{%e_{l0s@nfM2W+EnChFU6Zz&7%~N=6EPyOr$+!G_pJ zT^C6PmQXT>IPm|5myWp)0HhTDS0T8%{XVdh)mPKZ*Vq%~8({D42m}NKh`V?^^?73N z49vc8KR_nsmkbzk{+3sGJf6(oI%r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lr?J2(Br}j!YHZ4loqq0mdf;4cFub7KcAv{sz90s$LYOPv8 zF(Oa%;(1&SIq6HBdPCXUDD`|5qCn6GZoCB&rMu6Eo~#*kr57)XMnn>f2Kqt0+?n=d zP2x5?H5a};rJuUL2!GLV3ViyJ0s4zMSts?P4gbHB`)*oahxbq zG}UDaM{_dyKl1he?!J1(rkfXxuufHYzL%Vp|F=A(?yUr#q<#WD-RYQiulPAoLiPDY z$aN+wARb=ei2lmLUr;!7ak#&~U&r|=O-qhFoU7~pMfjD3!B`v3pl8yf7$7~KSXn$O zaI@?AHLPcII=P01h5#gVa*eP + + + + + diff --git a/retroshare-qml-app/src/icons/rating.png b/retroshare-qml-app/src/icons/rating.png deleted file mode 100644 index debb3e51aa7329a7a77c7281673d7bc137f3aefa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3519 zcmV;w4M6gVP)JYdRiNRILCOMYH#! zTn&IYUtIr`h7E^ggsK$4wxrskJpBKk$cn|0Y^S-1%u$sB$k>@b0Ir?>IBfdC$kx4-85fs_cfRjpy~u5jyy8$cj(3q-6wv> z&v;BzRRXxR`}js+!%Wv$B7fmiI3+<<37{a>mu7KUqIGxn+Dl(n8B~n`T6bsH3AD}P zQVY?kI*AoY)d&Df9|LAJ%v0ghE!`u_J&vd(s0snZcb{CXuw@RnEP%rOo&{7wRD}Q> ztMDb}`ddXl-MC*T2_4bF8*DXTJeN+_I@i zOF9uvyJfFbsK^XZo3pxbvGD;ct<0t3ipv1&pVDw`H2d0x{eJGDj^nHy*t&esWxGbH zxC~Gm$$Z9x#s?5ftcqJCs;CUGEvfd2Q1(?W+VAHgIn5V7lJ0DH%Om@~Q&AbgNiXMwWK0IlCYxJZdupvubwpk^9maep z+YI11p+_i%#s}1L%Jw{AS!RHn_GDr;1zxAf{eCV|C=~ymel)Q6Is&n~>=|JW}*=2yS@Ywy7UgHDQ zifxr$(aF-x0IJfw>-Y+6dnK?Ek(Gk30#*Va0!niVRym6>An1^a42kOD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6(GJrhup6@>_aNME!PZ zViXVvU>ZUOb_e+?fSZ#?E(eTmf-G(P?+5rQfUvzF=m5@uivLIGeHDO~&MqJo*d>-; zugDJIjOl{n!aDiJ+j$m*5&GsnK^B;^GH14O*^C&t5)|b8+j`|tez4v&L<9q6SmECyk(t@==3NB#e}Wpd(q zymP~zk?-1h=PN4Q2iR`ezZggSoeS_S19*H6@V~%{r`lti`V#In{$vKWM2_`$#JYsS zS}!Z3i_b^Jd>aL{^kh;%v&&}RRQPhbJ^J0rFGTi(=I%_J2!97$@3QIl>+{hiyE>)d zvfU~1a}?lawa~W}*|B8dnN{gT?4SK^e1LREY;Wpdbe+Pd0XOUUEj(^#eJiEsO9t4m zXQaU@I7eMDH7fA6ntb@L_jX?Xt_${D;f^1kSUh^x`ZGZv1&TlBrPk(DN5q#GaQKn| zLItPT=f5Mc%ND1pKM~teN{tWW71Gm*=+1oJUM6>jWL z#5zrsQJV|ENcTHE_O zA}@RGzf>968u5Iafv(ZgoxOje tC}hAaY3|N6w)ABGHU90_7kcgM{{VV37_VOro2mc+002ovPDHLkV1g0})l~oh diff --git a/retroshare-qml-app/src/icons/rating.svg b/retroshare-qml-app/src/icons/rating.svg new file mode 100644 index 000000000..9432f9f21 --- /dev/null +++ b/retroshare-qml-app/src/icons/rating.svg @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/retroshare-qml-app/src/icons/state-offline.png b/retroshare-qml-app/src/icons/state-offline.png deleted file mode 100644 index b8236bd29afd80ef3670b79269424a7e78bf53bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4498 zcmV;D5pC{?P)S1cQ35Pv`H{#EK_iS942B<) z$)u~3cns_6h>p7M97h*+XJmF=*J*KdcHQ~mjIMg(?ySz4almLGRr#?X*fE9xLIxQH zCe4opL?WvQ8caHLSKa+1fr+uJ(w%fwb$9rj!yoj!uim%2ZeG2*@4fp7Nrczy6}xxu zo~dctbY{*LLR`hnlL1^xM8lbR1b|ThIspU#d`?8C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cl3B{J*ee6US#_WJdTc75n@Lp=n<~BrVNA}D<~;SV@J7d(fyli}-KGBN{WE(>38|AFvJ zHB(ZYx@~m^0yz0e|9X2vz@>tS^fFV7j_z`a4}l}z<&+FCC_@0y@lj0b$@n#NprO|5 z@d#m%x5wGl)s_4av0e~psEvEN1OVNK^5D`s~Wm#{WkW_4L+IAN)UXG>?0dP3O@37M}E$r(Y05}{1 zMB$fUghJsD8Y3b&9O3u!7`0` zf}~w1cOKGch%AEPx0Wwou3m5eS(Z-#cuv=x`I?N3jF(`;!A4f%a%y!Td~UZ6vmwGd zpwCipB6^&NjvLhbwj@bEM-n?hUS3`&7*%%bFqto0f)${T1IV)6&dd+Ocp=CtNs?ab zIT$i2(TIL+w+2&TyqcGn*9nB#45BDXH4M(T>*3yvjEpUAw|l%9`t0WB8|OC>&}6p` zlTcNrpP&Cv*ie+q<$9Qz`&$sYkcj^1@p$gH^Ym-8V8T;&YcL0Xb=ghxFJzb0eU=v% z7G9c~n%W3pW&~H=Lqt#J=H|Z9b2eU5u;ra?4FHm9LM#BG&04Zx!G$D}hJ(4HqM`{- zr*kt5j)Cb75gpew?NuR!Ja+8ZcPlC?f`b%nD{nQuJCj-64da{%iNxbe@^A3={-EE{ zyd+7N1E>XHw1FfXX94U5;0JJmna>hY!Z}3gt;>tDCQnUr1XWBR3VeqP@3-jb~WlB0JE1ITd0=POR z>Josit^hu6JAv%0WLAc&o8_2@^dB zds52;8F)eM81_hE;hZm{t$fh|Vua7Hvk}eXS&0Dw5BaQ9=s1SpDJbcCk zA2F{Jp)RFwJby4;bO4Lk)YLT22~hyhOby5(ARCNJ(0%acC;%PkUYg$y;0S^J8nB<3 kw!M=-|Gh|F=?2381FW19DiPiw5&!@I07*qoM6N<$g3F;ve*gdg diff --git a/retroshare-qml-app/src/icons/state-offline.svg b/retroshare-qml-app/src/icons/state-offline.svg new file mode 100644 index 000000000..def7ac155 --- /dev/null +++ b/retroshare-qml-app/src/icons/state-offline.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/retroshare-qml-app/src/icons/state-ok.png b/retroshare-qml-app/src/icons/state-ok.png deleted file mode 100644 index d4e84fdc3791c147dc0de04815401d4d7d524e18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5080 zcmV;}6DRD6P)K~#90?VW3M6jipz|GT=A4j}|1f+8}5kf(qk%)$rg4Gt1R zx+-b3aR%in;PrubM1_0ra>mScWGN#$KE?++8bDq58YQHw69gTJf`}4S9%9lsf=>*B zARS1D?yh}5bb=64Ro$Jgev#i77O8#e>}3Dz)TwjMK8KLRNRpJTC`thl?mY|1A-XXXdK` z^pDW3_W{@hV2$7Juc@uA{UJj4jX4P~fTE(Jvr|%1eosWx09+b{DjC2QB3kM9`(LT4 zsW}vdIt?RX1z@#W#}Ls%03v|Y7`fqL=G8>>s4UA{V&p@YNH_slt=2*!`fmW&#M+k* ztRtca9S+BPv34XB5=HR9`tgOiyTIGxVjv34XF;$8rvD5f*>eMEFO zV%OA%%5i4?TaO++$}1}?TVm~u7I7^ANs`7g^UDARb>TLL0DKC-#mp{25WY|p+5S z>6Mk0%|`eZE^#G*($dm_ilVFqP!K|~w*WjS%ksMhxz#CcUn2_pgFfPa<-}wFh3AMGgE+hR4 zmbegrBuSSr^Ev?M1Yy3Ph!#2=junWbcdFHDolZoL0_YQj`45VsTvJn1v(sq5^oY3t zBuUC<=8XW(4Z?htq9}9Xb@Wr8PVB*AyJ=4u~_~dMDV{NqH&29 zd;qAfuHJ;exWU&trek{b>h*XOTlq20JuuSY;1mh{&S6ujmM+mQ`B03)YR1b0rXY7PDC5rZg+XK{D~E5X=(QZ*sNjF zPf?Tw(efuMoj^&F&SmC30D7pH94DfS9S%ohH2jG*ZSx+V07z3YX*Qe9LyVf$JejDp z0Bwp^3qFWw$(a&-0FY(5fruW~Fv;-we0N2|7sCZmQc{xDHh-?hUW>)D*l0iE4Q5_~ zK)!(*bM1D!>O&JL3>SdOWSR}_WmSKP_jPkdAj|SGB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({mdi;&J6_Rf;bPLECj|)dLyu5 uM>9Z&0d|3@k- + + + + + + + diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 8138d0eab..cec7be699 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -197,9 +197,11 @@ ApplicationWindow Image { - source: "qrc:/icons/application-menu.png" + source: "qrc:/icons/application-menu.svg" height: parent.height - 10 - width: parent.height - 10 + width: height + sourceSize.height: height + sourceSize.width: height anchors.centerIn: parent } diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index a27428738..6332dc6da 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -10,13 +10,13 @@ TrustedNodesView.qml ChatView.qml icons/retroshare06.png - icons/state-offline.png - icons/state-ok.png + icons/state-offline.svg + icons/state-ok.svg GxsIdentityDelegate.qml - icons/edit-image-face-detect.png - icons/application-menu.png + icons/edit-image-face-detect.svg + icons/application-menu.svg ContactSort.js - icons/emblem-locked.png + icons/emblem-locked.svg BusyOverlay.qml URI.js TokensManager.qml @@ -24,8 +24,8 @@ TrustedNodeDetails.qml ClipboardWrapper.qml ContactDetails.qml - icons/rating-unrated.png - icons/rating.png + icons/rating-unrated.svg + icons/rating.svg TimedPopup.qml ChatCache.qml ChatBubbleDelegate.qml @@ -51,5 +51,7 @@ components/emoji/EmojiCategoryButton.qml components/emoji/EmojiButton.qml components/emoji/emoji.js + icons/network-connect.svg + icons/network-disconnect.svg From 5205301e1093b036587151520eec808dcc8cd1d4 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 8 Jul 2017 17:39:56 +0200 Subject: [PATCH 097/107] Solve bug that push view when android keyboard is shown --- retroshare-qml-app/src/android/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-qml-app/src/android/AndroidManifest.xml b/retroshare-qml-app/src/android/AndroidManifest.xml index f7bb601cb..321e1bd15 100644 --- a/retroshare-qml-app/src/android/AndroidManifest.xml +++ b/retroshare-qml-app/src/android/AndroidManifest.xml @@ -11,6 +11,7 @@ android:label="RetroShare" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:screenOrientation="unspecified" + android:windowSoftInputMode="adjustResize" android:launchMode="singleTask"> From 509ea355d3bb50c8bd3bea87f6f92dc4cdf7cda5 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 8 Jul 2017 19:28:54 +0200 Subject: [PATCH 098/107] Refactor to be more aesthetics --- .../src/GxsIdentityDelegate.qml | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 9a1ab4c0b..828735289 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -24,7 +24,7 @@ import "./components" Item { id: delegateRoot - height: 50 + height: 57 width: parent.width @@ -89,27 +89,51 @@ Item } } + Rectangle + { + id: backgroundRectangle + anchors.fill: parent.fill + anchors.right: parent.right + width: parent.width - colorHash.width - 15 + height: parent.height + color:"transparent" + + Rectangle + { + id: borderBottom + width: parent.width + height: 1 + anchors.bottom: parent.bottom + anchors.right: parent.right + color: "lightgrey" + } + } + + Column { id: chatInfoRow height: parent.height - width: parent.width - (isContactIcon.width *3.5) + width: parent.width - isContactRow.width - colorHash.width anchors.left: colorHash.right - anchors.leftMargin: 5 + anchors.leftMargin: 10 + anchors.right: isContactRow.left + anchors.rightMargin: 5 + Item { width: parent.width height: parent.height /2 - Text { id: nickText color: model.own ? "blue" : "black" text: model.name font.bold: true + anchors.bottom: parent.bottom } Text @@ -117,6 +141,7 @@ Item text: setTime() anchors.right: parent.right color: "darkslategrey" + anchors.bottom: parent.bottom } } @@ -124,7 +149,7 @@ Item { id: lastMessageText width: parent.width - height: parent.height /2 + height: (lastMessageData && lastMessageData.msg !== undefined)? parent.height /2 : 0 Text { @@ -153,10 +178,10 @@ Item color: "cornflowerblue" antialiasing: true - height: parent.height - 2 + height: parent.height - 6 radius: height/2 width: height - anchors.verticalCenter: parent.verticalCenter +// anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right Text @@ -174,14 +199,13 @@ Item Row { + id: isContactRow anchors.right: parent.right anchors.rightMargin: 10 anchors.verticalCenter: parent.verticalCenter height: parent.height - 10 spacing: 4 - - Image { source: model.is_contact ? From 0a3a04c245d5ede83e8ac185419bd461ca251862 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 11:49:52 +0200 Subject: [PATCH 099/107] Change menu icon position to left --- retroshare-qml-app/src/main-app.qml | 127 +++++++++++++++------------- 1 file changed, 69 insertions(+), 58 deletions(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index cec7be699..faf3a0076 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -108,14 +108,81 @@ ApplicationWindow width: 4 } + MouseArea + { + id: menu + height: parent.height + width: parent.height + + anchors.left: tolbarLeftPadding.right + anchors.verticalCenter: parent.verticalCenter + + onClicked: sideBar.open() + + Image + { + source: "qrc:/icons/application-menu.svg" + height: parent.height - 10 + width: height + sourceSize.height: height + sourceSize.width: height + anchors.centerIn: parent + } + + SideBar { + id: sideBar + } + } + + + + Label + { + property alias mouseA: mouseA + id: toolBarText + anchors.verticalCenter: parent.verticalCenter + anchors.left: menu.right + anchors.leftMargin: 20 + + MouseArea { + id: mouseA + visible: true + anchors.fill: parent + onClicked: { toolBar.openMainPage() } + } + + } + + BtnIcon + { + property bool searchIconVisibility: false + property var onClickCB: function (){} + + id: searchIcon + height: toolBar.iconsSize + width: toolBar.iconsSize + anchors.verticalCenter: parent.verticalCenter + imgUrl: "qrc:/icons/search.svg" + anchors.right: imageLoader.left + anchors.rightMargin: 5 + visible: searchIconVisibility && coreReady + onClicked: + { + toolBar.searchBtnCb() + } + } + Loader { id: imageLoader - anchors.verticalCenter: parent.verticalCenter height: toolBar.height - 4 - anchors.left: tolbarLeftPadding.right + asynchronous: true + anchors.right: parent.right + anchors.rightMargin: 2 + anchors.verticalCenter: parent.verticalCenter + property string gxsSource; } @@ -148,67 +215,11 @@ ApplicationWindow } - Label - { - property alias mouseA: mouseA - id: toolBarText - anchors.verticalCenter: parent.verticalCenter - anchors.left: imageLoader.right - anchors.leftMargin: 20 - - MouseArea { - id: mouseA - visible: true - anchors.fill: parent - onClicked: { toolBar.openMainPage() } - } - - } - BtnIcon - { - property bool searchIconVisibility: false - property var onClickCB: function (){} - id: searchIcon - height: toolBar.iconsSize - width: toolBar.iconsSize - anchors.verticalCenter: parent.verticalCenter - imgUrl: "qrc:/icons/search.svg" - anchors.right: menu.left - visible: searchIconVisibility && coreReady - onClicked: - { - toolBar.searchBtnCb() - } - } - MouseArea - { - id: menu - height: parent.height - width: parent.height - anchors.right: parent.right - anchors.rightMargin: 2 - anchors.verticalCenter: parent.verticalCenter - onClicked: sideBar.open() - - Image - { - source: "qrc:/icons/application-menu.svg" - height: parent.height - 10 - width: height - sourceSize.height: height - sourceSize.width: height - anchors.centerIn: parent - } - - SideBar { - id: sideBar - } - } } StackView From 402a2562c58f02cfcc31f69e0623c3fa4d004074 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 12:23:02 +0200 Subject: [PATCH 100/107] Set Retroshare image if no gxs identity is passed --- .../src/components/AvatarOrColorHash.qml | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index f34d288be..11c775cf6 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -39,16 +39,24 @@ Item { console.log("getDetails() ", compRoot.gxs_id ) ++compRoot.avatarAttemptCnt - rsApi.request( - "/identity/get_identity_details", - JSON.stringify({ gxs_id: compRoot.gxs_id }), - function(par) - { - var jData = JSON.parse(par.response).data - setDetails(jData) - if(!compRoot.has_avatar && - compRoot.avatarAttemptCnt < 3) getDetails() - }) + if (gxs_id) + { + rsApi.request( + "/identity/get_identity_details", + JSON.stringify({ gxs_id: compRoot.gxs_id }), + function(par) + { + var jData = JSON.parse(par.response).data + setDetails(jData) + if(!compRoot.has_avatar && + compRoot.avatarAttemptCnt < 3) getDetails() + }) + } + else + { + has_avatar = true + contactAvatar.source = "/icons/retroshare06.png" + } } function setDetails(data) { From b77629eed49817b2e95baec8b56c22a3a945c83c Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 12:27:49 +0200 Subject: [PATCH 101/107] Disable Retroshare toolbar button if core is not ready --- retroshare-qml-app/src/main-app.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index faf3a0076..889bf7ace 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -196,7 +196,10 @@ ApplicationWindow width: imageLoader.height fillMode: Image.PreserveAspectFit imgUrl: "/icons/retroshare06.png" - onClicked:{ toolBar.openMainPage() } + onClicked: + { + if (coreReady) toolBar.openMainPage() + } } } From 7653cfa008540f604c56c399dfd32024c3a65c5f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 12:44:33 +0200 Subject: [PATCH 102/107] Search details if have gxs_id and the default image is set --- .../src/components/AvatarOrColorHash.qml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 11c775cf6..fe0597356 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -34,13 +34,17 @@ Item ////////////// The following should be considered privates ///////////////////// property bool has_avatar: false + property bool default_image: false property int avatarAttemptCnt: 0 + property string noGxsImage: "/icons/retroshare06.png" + function getDetails() { console.log("getDetails() ", compRoot.gxs_id ) ++compRoot.avatarAttemptCnt if (gxs_id) { + default_image = false rsApi.request( "/identity/get_identity_details", JSON.stringify({ gxs_id: compRoot.gxs_id }), @@ -55,7 +59,8 @@ Item else { has_avatar = true - contactAvatar.source = "/icons/retroshare06.png" + default_image = true + contactAvatar.source = noGxsImage } } function setDetails(data) @@ -78,8 +83,9 @@ Item } - Component.onCompleted: if(visible && !has_avatar) getDetails() - onVisibleChanged: if(visible && !has_avatar) getDetails() + Component.onCompleted: if(visible && (!has_avatar || default_image ) ) getDetails() + + onVisibleChanged: if(visible && (!has_avatar || default_image ) ) getDetails() Image { From 80dd0006e731e0b4a8bebcc1b8a449716b7b01c7 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 13:11:48 +0200 Subject: [PATCH 103/107] Refactor drawer properties to be more aesthetic --- retroshare-qml-app/src/components/Btn.qml | 1 + retroshare-qml-app/src/components/SideBar.qml | 27 ++++++++++--------- .../src/styles/SideBarStyle.qml | 6 +++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/retroshare-qml-app/src/components/Btn.qml b/retroshare-qml-app/src/components/Btn.qml index 26626a5aa..6af29ac74 100644 --- a/retroshare-qml-app/src/components/Btn.qml +++ b/retroshare-qml-app/src/components/Btn.qml @@ -6,6 +6,7 @@ Item id: button property alias buttonText: innerText.text; + property alias buttonTextPixelSize: innerText.font.pixelSize property alias innerAnchors: innerElements.anchors; property alias rectangleButton: rectangleButton; diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index 790e1fb54..0361c23eb 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -57,7 +57,7 @@ Drawer Text { id: nickText - text: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.name : "" + text: (ChatCache.contactsCache.own)?ChatCache.contactsCache.own.name : "Retroshare" height: contentHeight anchors.top: colorHash.bottom anchors.left: header.left @@ -122,6 +122,7 @@ Drawer innerAnchors.verticalCenter: rectangleButton.verticalCenter iconUrl: (model.icon)? model.icon : undefined innerMargin: 20 + buttonTextPixelSize: menuItem.styles.pixelSize } @@ -178,14 +179,14 @@ Drawer property var actions : { + "Contacts": function() + { + stackView.push("qrc:/Contacts.qml" ) + }, "Trusted Nodes": function() { stackView.push("qrc:/TrustedNodesView.qml"); }, - "Search Contacts": function() - { - stackView.push("qrc:/Contacts.qml" ) - }, "Paste Link": function() { UriJs.URI.withinString( @@ -195,9 +196,15 @@ Drawer "Terminate Core": function() { rsApi.request("/control/shutdown"); - }, + } } + ListElement + { + title: "Contacts" + showOnCoreReady: true + icon: "/icons/search.svg" + } ListElement { title: "Trusted Nodes" @@ -205,12 +212,6 @@ Drawer icon: "/icons/netgraph.svg" } ListElement - { - title: "Search Contacts" - showOnCoreReady: true - icon: "/icons/search.svg" - } - ListElement { title: "Paste Link" showOnCoreReady: true @@ -242,7 +243,7 @@ Drawer horizontalAlignment: Text.AlignRight anchors.bottom: parent.bottom anchors.right: parent.right - text:"Retroshare v.DEV" + text: parent.styles.text color: parent.styles.textColor anchors.rightMargin: parent.styles.margins anchors.bottomMargin: parent.styles.margins diff --git a/retroshare-qml-app/src/styles/SideBarStyle.qml b/retroshare-qml-app/src/styles/SideBarStyle.qml index 491bdf3c2..1ebe90244 100644 --- a/retroshare-qml-app/src/styles/SideBarStyle.qml +++ b/retroshare-qml-app/src/styles/SideBarStyle.qml @@ -3,15 +3,16 @@ pragma Singleton QtObject { - property var width: 1.5 + property var width: 2 // Number of third parts of screen (for example 2/3) property QtObject item: QtObject { - property var height: 40 + property var height: 50 property string hoverColor: "lightgrey" property string defaultColor: "white" property string pressColor: "slategrey" + property int pixelSize: 14 } property QtObject header: QtObject { @@ -27,6 +28,7 @@ QtObject { property var color: "white" property var textColor: "grey" property var margins: 8 + property string text: "Retroshare Dev Version" } } From c60c084c2aeab036c3675c47aa5d3578b9ea4e5c Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 13:17:19 +0200 Subject: [PATCH 104/107] Augment trusted node list elements size --- retroshare-qml-app/src/TrustedNodesView.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/TrustedNodesView.qml b/retroshare-qml-app/src/TrustedNodesView.qml index 9bb79317e..4cc7a3401 100644 --- a/retroshare-qml-app/src/TrustedNodesView.qml +++ b/retroshare-qml-app/src/TrustedNodesView.qml @@ -68,7 +68,7 @@ Item delegate: Item { property bool isOnline: jsonModel.isOnline(model.pgp_id) - height: 30 + height: 54 width: parent.width Image @@ -91,6 +91,7 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.left: statusImage.right anchors.leftMargin: 10 + font.pixelSize: 15 } MouseArea { From 36708efa8c7706bb4f5388cfe9a0a766b58325be Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 13:34:11 +0200 Subject: [PATCH 105/107] Set separator line in delegate root item --- .../src/GxsIdentityDelegate.qml | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 828735289..2b8142cf3 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -65,6 +65,26 @@ Item hoverEnabled: true } + Rectangle + { + id: backgroundRectangle + anchors.fill: parent.fill + anchors.right: parent.right + width: parent.width - colorHash.width - 15 + height: parent.height + color:"transparent" + + Rectangle + { + id: borderBottom + width: parent.width + height: 1 + anchors.bottom: parent.bottom + anchors.right: parent.right + color: "lightgrey" + } + } + Rectangle { anchors.fill: parent @@ -89,27 +109,6 @@ Item } } - Rectangle - { - id: backgroundRectangle - anchors.fill: parent.fill - anchors.right: parent.right - width: parent.width - colorHash.width - 15 - height: parent.height - color:"transparent" - - Rectangle - { - id: borderBottom - width: parent.width - height: 1 - anchors.bottom: parent.bottom - anchors.right: parent.right - color: "lightgrey" - } - } - - Column { From 53eadfdc1985cb25fc7d2c7c0829f0bf8f788c36 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 15:40:37 +0200 Subject: [PATCH 106/107] Create avatar cache and identity details cache --- retroshare-qml-app/src/ChatCache.qml | 27 +++++++++-- .../src/components/AvatarOrColorHash.qml | 45 +++++++++++++------ 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index cc0a9e85a..6e7b55c72 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -101,6 +101,8 @@ QtObject id: contactsCache property var contactsList property var own + property var identityDetails: ({}) + function getContactFromGxsId (gxsId) { @@ -109,10 +111,29 @@ QtObject { if (contactsList[i].gxs_id == gxsId) return contactsList[i] } - - - } + + function getIdentityDetails (gxsId) + { + if (identityDetails[gxsId]) return identityDetails[gxsId] + return "" + } + + function setIdentityDetails (jData) + { + identityDetails[jData.gxs_id] = jData + } + + function getIdentityAvatar (gxsId) + { + + if (identityDetails[gxsId] && identityDetails[gxsId].avatar !== undefined) + { + return identityDetails[gxsId].avatar + } + return "" + } + } } diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index fe0597356..b50002687 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -45,16 +45,25 @@ Item if (gxs_id) { default_image = false - rsApi.request( - "/identity/get_identity_details", - JSON.stringify({ gxs_id: compRoot.gxs_id }), - function(par) - { - var jData = JSON.parse(par.response).data - setDetails(jData) - if(!compRoot.has_avatar && - compRoot.avatarAttemptCnt < 3) getDetails() - }) + var hasAvatarCached = hasAvatar (ChatCache.contactsCache.getIdentityAvatar(gxs_id)) + if ( !hasAvatarCached ) + { + rsApi.request( + "/identity/get_identity_details", + JSON.stringify({ gxs_id: compRoot.gxs_id }), + function(par) + { + var jData = JSON.parse(par.response).data + ChatCache.contactsCache.setIdentityDetails(jData) + setDetails(jData) + if(!compRoot.has_avatar && + compRoot.avatarAttemptCnt < 3) getDetails() + }) + } + else + { + setDetails(ChatCache.contactsCache.getIdentityDetails(gxs_id)) + } } else { @@ -65,14 +74,23 @@ Item } function setDetails(data) { - compRoot.has_avatar = data.avatar.length > 0 + compRoot.has_avatar = hasAvatar (data.avatar) if(compRoot.has_avatar) { - contactAvatar.source = - "data:image/png;base64," + data.avatar + setImage(data.avatar) } } + function hasAvatar (avatar) + { + return avatar.length > 0 + } + function setImage (source) + { + contactAvatar.source = + "data:image/png;base64," + source + } + function showDetails() { console.log("showDetails() ", gxs_id) @@ -80,7 +98,6 @@ Item stackView.push( "qrc:/ContactDetails.qml", {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) - } Component.onCompleted: if(visible && (!has_avatar || default_image ) ) getDetails() From 1917e673f270dd53d622647d2ca0ebab218d2eec Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sun, 9 Jul 2017 15:55:04 +0200 Subject: [PATCH 107/107] Load cached avatars on contacts view --- .../src/GxsIdentityDelegate.qml | 12 ++---- .../src/components/AvatarOrColorHash.qml | 40 +++++++++++++------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 2b8142cf3..41ad5454f 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -91,22 +91,18 @@ Item color: "transparent" anchors.margins: 5 - - ColorHash + AvatarOrColorHash { id: colorHash - hash: model.gxs_id + gxs_id: model.gxs_id + height: parent.height - 4 anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 2 - MouseArea - { - anchors.fill: parent - onClicked: delegateRoot.showDetails() - } + onlyCached: true } Column diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index b50002687..35eb30efd 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -25,6 +25,7 @@ Item id: compRoot property string gxs_id + property bool onlyCached: false signal clicked () height: 130 @@ -54,15 +55,14 @@ Item function(par) { var jData = JSON.parse(par.response).data - ChatCache.contactsCache.setIdentityDetails(jData) - setDetails(jData) + saveDetails(jData) if(!compRoot.has_avatar && compRoot.avatarAttemptCnt < 3) getDetails() }) } else { - setDetails(ChatCache.contactsCache.getIdentityDetails(gxs_id)) + setImage(ChatCache.contactsCache.getIdentityDetails(gxs_id)) } } else @@ -72,12 +72,19 @@ Item contactAvatar.source = noGxsImage } } - function setDetails(data) + function saveDetails(data) + { + ChatCache.contactsCache.setIdentityDetails(data) + setImage(data) + + } + function setImage (data) { compRoot.has_avatar = hasAvatar (data.avatar) if(compRoot.has_avatar) { - setImage(data.avatar) + contactAvatar.source = + "data:image/png;base64," + data.avatar } } @@ -85,11 +92,6 @@ Item { return avatar.length > 0 } - function setImage (source) - { - contactAvatar.source = - "data:image/png;base64," + source - } function showDetails() { @@ -100,9 +102,23 @@ Item {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) } - Component.onCompleted: if(visible && (!has_avatar || default_image ) ) getDetails() + Component.onCompleted: startComponent () - onVisibleChanged: if(visible && (!has_avatar || default_image ) ) getDetails() + onVisibleChanged: startComponent () + + function startComponent () + { + if (onlyCached && hasAvatar (ChatCache.contactsCache.getIdentityAvatar(gxs_id) ) ) + { + console.log("load cached avatar") + setImage(ChatCache.contactsCache.getIdentityDetails(gxs_id)) + + } + else if (!onlyCached) + { + if(visible && (!has_avatar || default_image ) ) getDetails() + } + } Image {