diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index a5ba8fca..a220c9f7 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -453,6 +453,18 @@ 0 profiles loaded with that password + + + your-profiles + Your Profiles + + + + + your-servers + Your Profiles + + unlock diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index abbf18b7..a3048125 100644 Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index 4f3deba3..ec54d325 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -545,6 +545,18 @@ Right-click to reset. 0 profiles loaded with that password 0 profiles loaded with that password + + + your-profiles + Your Profiles + Your Profiles + + + + your-servers + Your Profiles + Your Servers + unlock diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index d2d3e951..000671df 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -453,6 +453,18 @@ 0 profiles loaded with that password + + + your-profiles + Your Profiles + + + + + your-servers + Your Profiles + + unlock diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 627dd4fd..5f17bd16 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -453,6 +453,18 @@ 0 profiles loaded with that password + + + your-profiles + Your Profiles + + + + + your-servers + Your Profiles + + unlock diff --git a/qml/panes/ProfileManagerPane.qml b/qml/panes/ProfileManagerPane.qml index 0c0375cb..beceedde 100644 --- a/qml/panes/ProfileManagerPane.qml +++ b/qml/panes/ProfileManagerPane.qml @@ -95,19 +95,62 @@ ColumnLayout { } - Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS - color: Theme.backgroundMainColor - width: thecol.width + Opaque.ResponsiveContainer { Layout.fillHeight: true Layout.fillWidth: true - Layout.minimumWidth: Layout.maximumWidth - //Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : 450 - ProfileList { - anchors.fill: parent + + Rectangle { + color: Theme.backgroundMainColor + + Layout.fillHeight: true + Layout.fillWidth: true + + Opaque.ScalingLabel { + id: profileLabel + size: Theme.primaryTextSize + font.family: Fonts.applicationFontRegular.name + font.styleName: "Bold" + + //: Your Profiles + text: qsTr("your-profiles") + } + + ProfileList { + anchors.top: profileLabel.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + } } + + Rectangle { + color: Theme.backgroundMainColor + + Layout.fillHeight: true + Layout.fillWidth: true + + Opaque.ScalingLabel { + id: serverLabel + size: Theme.primaryTextSize + font.family: Fonts.applicationFontRegular.name + font.styleName: "Bold" + + //: Your Profiles + text: qsTr("your-servers") + } + + ServerList { + anchors.top: serverLabel.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + } + } + } + } diff --git a/qml/widgets/ServerList.qml b/qml/widgets/ServerList.qml new file mode 100644 index 00000000..5d50ea44 --- /dev/null +++ b/qml/widgets/ServerList.qml @@ -0,0 +1,120 @@ +import QtGraphicalEffects 1.0 +import QtQuick 2.7 +import QtQuick.Controls 2.4 +import QtQuick.Controls.Material 2.0 +import QtQuick.Layouts 1.3 + +import "../opaque" as Opaque +import "../opaque/theme" + +ColumnLayout { + id: root + + MouseArea { + anchors.fill: parent + + onClicked: { + forceActiveFocus() + } + } + + Opaque.Flickable { // Profile List + id: sv + Layout.minimumHeight: 100 + Layout.fillHeight: true + Layout.minimumWidth: parent.width + Layout.maximumWidth: parent.width + contentWidth: colContacts.width + contentHeight: colContacts.height + + + ColumnLayout { + id: colContacts + width: sv.width + spacing: 0 + + Connections { // ADD/REMOVE CONTACT ENTRIES + target: gcd + + onAddProfile: function(handle, displayName, image, tag) { + + // don't add duplicates + for (var i = 0; i < profilesModel.count; i++) { + if (profilesModel.get(i)["_handle"] == handle) { + return + } + } + + // find index for insert (sort by onion) + var index = profilesModel.count + for (var i = 0; i < profilesModel.count; i++) { + if (profilesModel.get(i)["_handle"] > handle) { + index = i + break + } + } + + profilesModel.insert(index, + { + _handle: handle, + _displayName: displayName, + _image: image, + _tag: tag, + _status: 4, + }) + } + + /* + onRemoveProfile: function(handle) { + for(var i = 0; i < profilesModel.count; i++){ + if(profilesModel.get(i)["_handle"] == handle) { + console.log("deleting contact " + profilesModel.get(i)["_handle"]) + profilesModel.remove(i) + return + } + } + }*/ + + onResetProfileList: function() { + profilesModel.clear() + } + } + + ListModel { // Profile OBJECTS ARE STORED HERE ... + id: profilesModel + } + + Repeater { + id: profileList + model: profilesModel // ... AND DISPLAYED HERE + delegate: ProfileRow { + handle: _handle + displayName: _displayName + image: _image + tag: _tag + Layout.fillWidth: true + } + } + + Opaque.PortraitRow { + Layout.fillWidth: true + handle: "" + displayName: qsTr("add-new-profile-btn") + nameColor: Theme.mainTextColor + image: "/fontawesome/regular/user.svg" + tag: "" + portraitBorderColor: Theme.portraitOnlineBorderColor + portraitColor: Theme.portraitOnlineBackgroundColor + badgeVisible: true + badgeContent: Image { + source: gcd.assetPath + "/fontawesome/solid/plus.svg" + height: Theme.badgeTextSize * gcd.themeScale + width: height + } + badgeColor: Theme.defaultButtonColor + + onClicked: function(handle) { profileAddEditPane.reset(); parentStack.pane = parentStack.addEditProfilePane } + } + } + } +}