From 290b0b26dbc89659304feecb91c08256f1950f5d Mon Sep 17 00:00:00 2001 From: erinn Date: Mon, 14 Dec 2020 17:22:20 -0800 Subject: [PATCH] new scaling system pass one --- go/ui/gcd.go | 11 ++ go/ui/settings.go | 6 +- i18n/translation_de.ts | 52 +++++---- i18n/translation_en.ts | 63 ++++++---- i18n/translation_fr.ts | 52 +++++---- i18n/translation_pt.ts | 52 +++++---- qml/main.qml | 50 +++++--- qml/opaque | 2 +- qml/overlays/BulletinOverlay.qml | 9 +- qml/overlays/ListOverlay.qml | 26 ++--- qml/panes/AddPeerGroupPane.qml | 9 +- qml/panes/GroupSettingsPane.qml | 7 +- qml/panes/OverlayPane.qml | 17 +-- qml/panes/PeerSettingsPane.qml | 6 +- qml/panes/ProfileAddEditPane.qml | 41 ++++--- qml/panes/ProfileManagerPane.qml | 42 +++---- qml/panes/ServerAddEditPane.qml | 16 +-- qml/panes/ServerInfoPane.qml | 13 +-- qml/panes/SettingsPane.qml | 193 +++++++++++++++++++++---------- qml/panes/SplashPane.qml | 5 +- qml/widgets/ContactList.qml | 31 ++--- qml/widgets/ContactRow.qml | 2 +- qml/widgets/ExperimentToggle.qml | 16 +-- qml/widgets/Message.qml | 36 +++--- qml/widgets/MessageEditor.qml | 7 +- qml/widgets/MyProfile.qml | 167 ++++++++++---------------- qml/widgets/ProfileList.qml | 10 -- qml/widgets/ProfileRow.qml | 6 +- qml/widgets/ServerList.qml | 14 +-- 29 files changed, 501 insertions(+), 460 deletions(-) diff --git a/go/ui/gcd.go b/go/ui/gcd.go index 5d3fe715..2ee99c44 100644 --- a/go/ui/gcd.go +++ b/go/ui/gcd.go @@ -42,7 +42,12 @@ type GrandCentralDispatcher struct { _ int `property:"torStatus"` _ string `property:"os"` _ bool `property:"firstTime"` + // phasing out themeScale in three steps: + // 1 (current): switch labels to themeScaleNew + // 2: switch everything else to themeScaleNew + // 3: refactor: delete themeScale, rename themeScaleNew -> themeScale _ float32 `property:"themeScale,auto,changed"` + _ int `property:"themeScaleNew,auto,changed"` _ string `property:"theme,auto,changed"` _ string `property:"locale,auto,changed"` _ string `property:"version"` @@ -159,6 +164,7 @@ func (this *GrandCentralDispatcher) init() { this.GlobalSettings, firstTime = ReadGlobalSettings() this.SetFirstTime(firstTime) this.SetThemeScale(this.GlobalSettings.Zoom) + this.SetThemeScaleNew(this.GlobalSettings.Scale) this.SetTheme(this.GlobalSettings.Theme) this.SetExperimentsEnabled(this.GlobalSettings.ExperimentsEnabled) this.SetExperiments(this.GlobalSettings.Experiments) @@ -779,6 +785,11 @@ func (this *GrandCentralDispatcher) themeScaleChanged(newThemeScale float32) { WriteGlobalSettings(this.GlobalSettings) } +func (this *GrandCentralDispatcher) themeScaleNewChanged(newScale int) { + this.GlobalSettings.Scale = newScale + WriteGlobalSettings(this.GlobalSettings) +} + // Turn on/off global experiments func (this *GrandCentralDispatcher) experimentsEnabledChanged(enabled bool) { this.GlobalSettings.ExperimentsEnabled = enabled diff --git a/go/ui/settings.go b/go/ui/settings.go index 4e8b3530..f6abab32 100644 --- a/go/ui/settings.go +++ b/go/ui/settings.go @@ -16,7 +16,8 @@ const GlobalSettingsFilename = "ui.globals" const saltFile = "SALT" type GlobalSettings struct { - Zoom float32 + Zoom float32 // deprecated + Scale int // the new hotness Locale string Theme string PreviousPid int64 @@ -27,6 +28,7 @@ type GlobalSettings struct { var DefaultGlobalSettings = GlobalSettings{ Zoom: 1.9, + Scale: 2, Locale: "en", Theme: "light", PreviousPid: -1, @@ -76,7 +78,7 @@ func ReadGlobalSettings() (*GlobalSettings, bool) { return &settings, true //firstTime = true } - log.Debugf("Settings: %v", settings) + log.Debugf("Settings: %#v", settings) return &settings, false } diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 4106f6e4..f84a8ca0 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -122,19 +122,19 @@ ChatOverlay - + chat-history-default This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right. - + chat-history-disabled Message history is disabled. - + chat-history-enabled Message history is enabled. @@ -148,7 +148,7 @@ Adresse hier hinzufügen, um einen Kontakt aufzunehmen - + blocked @@ -285,18 +285,18 @@ Klicken, um DM zu senden - + could-not-send-msg-error Could not send this message Nachricht konnte nicht gesendet werden - + acknowledged-label bestätigt - + pending-label Bestätigung ausstehend @@ -569,36 +569,36 @@ ProfileManagerPane - + enter-profile-password Enter a password to view your profiles - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + your-profiles Your Profiles - + your-servers Your Profiles - + unlock Unlock @@ -649,40 +649,47 @@ - + + medium-text-label + medium text + + + + large-text-label + large text Groß - + setting-theme Theme - + theme-light - + theme-dark - + experiments-enabled Theme - + version %1 tor %2 Version %1 with tor %2 - + builddate %2 Built on: %2 @@ -693,8 +700,9 @@ defaultmäßige Textgröße (Skalierungsfaktor: - + small-text-label + small text Klein @@ -737,7 +745,7 @@ main - + new-connection-pane-title New Connection diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index 9a0ae436..bf63587a 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -135,24 +135,35 @@ ChatOverlay - + chat-history-default This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right. Your history with this peer is ephemeral and will not be saved. If you would like to save history, please go to settings and turn it on. - + chat-history-disabled Message history is disabled. Message history is disabled. - + chat-history-enabled Message history is enabled. Message history is enabled. + + Collapser/Expander Widget + + collapser-show + Show + + + collapser-hide + Hide + + ContactList @@ -161,7 +172,7 @@ ... paste an address here to add a contact... - + blocked Blocked @@ -378,18 +389,18 @@ Right-click to reset. Click to DM - + could-not-send-msg-error Could not send this message Could not send this message - + acknowledged-label Acknowledged - + pending-label Pending @@ -688,36 +699,36 @@ Right-click to reset. ProfileManagerPane - + enter-profile-password Enter a password to view your profiles Enter a password to view your profiles - + password Password - + error-0-profiles-loaded-for-password 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 Unlock Unlock @@ -777,34 +788,41 @@ Right-click to reset. Zoom level - + + medium-text-label + medium text + + + + large-text-label + large text Large - + setting-theme Theme Theme - + theme-light Light - + theme-dark Dark - + experiments-enabled Theme Experiments enabled - + version %1 tor %2 Version %1 with tor %2 Version %1 with tor %2 @@ -815,7 +833,7 @@ Right-click to reset. Version %1 - + builddate %2 Built on: %2 Built on: %2 @@ -826,8 +844,9 @@ Right-click to reset. Default size text (scale factor: - + small-text-label + small text Small @@ -878,7 +897,7 @@ Right-click to reset. main - + new-connection-pane-title New Connection New Connection diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index 845397ac..31bd7626 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -122,19 +122,19 @@ ChatOverlay - + chat-history-default This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right. - + chat-history-disabled Message history is disabled. - + chat-history-enabled Message history is enabled. @@ -148,7 +148,7 @@ ... coller une adresse ici pour ajouter un contact... - + blocked @@ -285,18 +285,18 @@ Envoyer un message privé - + could-not-send-msg-error Could not send this message Impossible d'envoyer ce message - + acknowledged-label Confirmé - + pending-label En attente @@ -569,36 +569,36 @@ ProfileManagerPane - + enter-profile-password Enter a password to view your profiles - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + your-profiles Your Profiles - + your-servers Your Profiles - + unlock Unlock @@ -649,40 +649,47 @@ - + + medium-text-label + medium text + + + + large-text-label + large text Large - + setting-theme Theme - + theme-light - + theme-dark - + experiments-enabled Theme - + version %1 tor %2 Version %1 with tor %2 - + builddate %2 Built on: %2 @@ -693,8 +700,9 @@ Taille par défaut du texte (échelle: - + small-text-label + small text Petit @@ -737,7 +745,7 @@ main - + new-connection-pane-title New Connection diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index c5988b10..d7704262 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -122,19 +122,19 @@ ChatOverlay - + chat-history-default This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right. - + chat-history-disabled Message history is disabled. - + chat-history-enabled Message history is enabled. @@ -148,7 +148,7 @@ … cole um endereço aqui para adicionar um contato… - + blocked @@ -285,18 +285,18 @@ Clique para DM - + could-not-send-msg-error Could not send this message Não deu para enviar esta mensagem - + acknowledged-label Confirmada - + pending-label Pendente @@ -569,36 +569,36 @@ ProfileManagerPane - + enter-profile-password Enter a password to view your profiles - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + your-profiles Your Profiles - + your-servers Your Profiles - + unlock Unlock @@ -649,40 +649,47 @@ - + + medium-text-label + medium text + + + + large-text-label + large text Grande - + setting-theme Theme - + theme-light - + theme-dark - + experiments-enabled Theme - + version %1 tor %2 Version %1 with tor %2 - + builddate %2 Built on: %2 @@ -693,8 +700,9 @@ Texto tamanho padrão (fator de escala: - + small-text-label + small text Pequeno @@ -737,7 +745,7 @@ main - + new-connection-pane-title New Connection diff --git a/qml/main.qml b/qml/main.qml index 5cde6080..321261dd 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 import QtQuick.Window 2.11 -import "opaque" +import "opaque" as Opaque import "opaque/fonts" import "opaque/fonts/MutantStandard.js" as Mutant import "opaque/theme" @@ -17,7 +17,7 @@ import "utils.js" as Utils ApplicationWindow { id: windowItem - width: 1200 + width: 600 + Theme.scale * 200 height: 800 visible: true title: "cwtch" + "" @@ -26,7 +26,7 @@ ApplicationWindow { readonly property real ratio: height / width - FontAwesome { // PRETTY BUTTON ICONS + Opaque.FontAwesome { // PRETTY BUTTON ICONS id: awesome resource: "qrc:/qml/opaque/fonts/fontawesome.ttf" } @@ -94,10 +94,13 @@ ApplicationWindow { // The actual app property Item mainLayout: Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true color: Theme.backgroundMainColor - Toolbar { + Opaque.Toolbar { id: toolbar + rightPaneWidth: theStack.width onLeftMenu: { gcd.requestSettings() @@ -186,10 +189,10 @@ ApplicationWindow { Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS color: Theme.backgroundMainColor Layout.fillHeight: true - Layout.minimumWidth: Theme.sidePaneMinSize * gcd.themeScale - Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : (Theme.sidePaneMinSize * gcd.themeScale) + Layout.minimumWidth: Theme.sidePaneMinSize + Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : Theme.sidePaneMinSize Layout.fillWidth: theStack.pane == theStack.emptyPane ? true : false - visible: (windowItem.width >= (Theme.doublePaneMinSize * gcd.themeScale) && !Qt.inputMethod.visible) || theStack.pane == theStack.emptyPane + visible: (windowItem.width >= Theme.doublePaneMinSize && !Qt.inputMethod.visible) || theStack.pane == theStack.emptyPane ContactList { anchors.top: parent.top @@ -230,7 +233,10 @@ ApplicationWindow { readonly property int addPeerGroupPane: 4 readonly property int serverInfoPane: 5 - Item { anchors.fill: parent } // empty + Item { // empty + Layout.fillWidth: true + Layout.fillHeight: true + } Rectangle { color: Theme.backgroundMainColor @@ -243,16 +249,27 @@ ApplicationWindow { } - PeerSettingsPane { anchors.fill: parent } + PeerSettingsPane { + Layout.fillWidth: true + Layout.fillHeight: true + } - GroupSettingsPane{ anchors.fill: parent } + GroupSettingsPane{ + Layout.fillWidth: true + Layout.fillHeight: true + } AddPeerGroupPane { id: addPeerGroupPaneInstance - anchors.fill: parent + Layout.fillWidth: true + Layout.fillHeight: true + } - ServerInfoPane { anchors.fill: parent } + ServerInfoPane { + Layout.fillWidth: true + Layout.fillHeight: true + } onCurrentIndexChanged: { gcd.setProfilePaneState(theStack.currentIndex) @@ -267,8 +284,6 @@ ApplicationWindow { addPeerGroupPaneInstance.reset() } } - - onWidthChanged: {toolbar.titleWidth = width} } } } @@ -384,19 +399,18 @@ ApplicationWindow { anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 20 - width: lblPopup.width + 30 - height: lblPopup.height + 8 * gcd.themeScale + width: lblPopup.width + 2 * gcd.paddingStandard + height: lblPopup.height + 2 * gcd.paddingStandard color: "#000000" opacity: 0.5 radius: 15 visible: false - Label { + Opaque.Label { id: lblPopup anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - font.pixelSize: 18 * gcd.themeScale color: "#FFFFFF" } } diff --git a/qml/opaque b/qml/opaque index 48d9d1d1..6b285e4b 160000 --- a/qml/opaque +++ b/qml/opaque @@ -1 +1 @@ -Subproject commit 48d9d1d11f4efe612419ea66371c4b147f74667d +Subproject commit 6b285e4bbc2a673fceb1c0ffb0065d1dae9c5f8b diff --git a/qml/overlays/BulletinOverlay.qml b/qml/overlays/BulletinOverlay.qml index a1230854..b14c4314 100644 --- a/qml/overlays/BulletinOverlay.qml +++ b/qml/overlays/BulletinOverlay.qml @@ -14,6 +14,7 @@ import "../utils.js" as Utils ColumnLayout { Layout.fillWidth: true width:parent.width + Layout.margins: Theme.paddingStandard Text { Layout.fillWidth: true @@ -26,10 +27,7 @@ ColumnLayout { style: CwtchTextFieldStyle{} - anchors.left: parent.left - anchors.right: parent.right - - anchors.margins: 10 + width: parent.width - 2 * parent.padding onTextChanged: { bulletinView.filter = text @@ -247,8 +245,7 @@ ColumnLayout { id: btnSend icon: "regular/paper-plane" text: "post" - anchors.right: parent.right - anchors.rightMargin: 2 + Layout.alignment: Qt.AlignRight property int nextMessageID: 1 diff --git a/qml/overlays/ListOverlay.qml b/qml/overlays/ListOverlay.qml index 47334736..0f1e9063 100644 --- a/qml/overlays/ListOverlay.qml +++ b/qml/overlays/ListOverlay.qml @@ -14,7 +14,7 @@ import "../opaque/theme" ColumnLayout { Layout.fillWidth: true - width:parent.width + width: parent.width id: listpanel property bool online: false @@ -25,9 +25,7 @@ ColumnLayout { Opaque.IconTextField { id: filter visible:listpanel.online - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 10 + width: parent.width - 2 * Theme.paddingStandard //: ex: "Find..." placeholderText: qsTr("search-list") @@ -54,14 +52,14 @@ ColumnLayout { height: 150 width: 150 } - Label { - visible:!listpanel.online - color: Theme.mainTextColor - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - elide: Text.ElideRight - font.pixelSize: 18 * gcd.themeScale - text: qsTr("peer-not-online") - } +// Label { +// visible:!listpanel.online +// color: Theme.mainTextColor +// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter +// elide: Text.ElideRight +// font.pixelSize: 18 * gcd.themeScale +// text: qsTr("peer-not-online") +// } @@ -212,9 +210,7 @@ ColumnLayout { button_text: qsTr("add-list-item-btn") dropShadowColor: Theme.dropShadowPaneColor property int nextMessageID: 1 - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 10 + width: parent.width - 2 * Theme.paddingStandard onClicked: { if (newlistitem.text != "") { diff --git a/qml/panes/AddPeerGroupPane.qml b/qml/panes/AddPeerGroupPane.qml index 9c4d206b..0c9f863e 100644 --- a/qml/panes/AddPeerGroupPane.qml +++ b/qml/panes/AddPeerGroupPane.qml @@ -26,7 +26,6 @@ Rectangle { groupNameCreate.text = "" groupAddr.text = "" - groupNameJoin.text = "" onionLabel.text = gcd.selectedProfile } @@ -37,14 +36,14 @@ Rectangle { leftPadding: 20 * gcd.themeScale rightPadding: 20 * gcd.themeScale - Opaque.ScalingLabel { + Opaque.Label { id: shareLabel anchors { left: parent.left right: parent.right } horizontalAlignment:Text.AlignHCenter - size: Theme.secondaryTextSize + size: Theme.textSmallPt wrapMode: Text.Wrap //: Send this address to peers you want to connect with @@ -147,7 +146,7 @@ Rectangle { Column { visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") width: parent.width / 2 - Opaque.ScalingLabel { + Opaque.Label { //: Server text: qsTr("server") } @@ -156,7 +155,7 @@ Rectangle { Column { visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") width: parent.width / 2 - Opaque.ScalingLabel { + Opaque.Label { //: Invitation text: qsTr("invitation") } diff --git a/qml/panes/GroupSettingsPane.qml b/qml/panes/GroupSettingsPane.qml index 2c6842e9..9a0f3f48 100644 --- a/qml/panes/GroupSettingsPane.qml +++ b/qml/panes/GroupSettingsPane.qml @@ -14,7 +14,6 @@ import "../const" Opaque.SettingsList { // groupSettingsPane id: gsp - anchors.fill: parent property string groupID property variant addrbook property bool connected: false @@ -77,7 +76,7 @@ Opaque.SettingsList { // groupSettingsPane } Opaque.Setting { - property color backgroundColor: parent.color + property color backgroundColor: "red"//parent.color inline: true label: qsTr("server-info") field: Column { @@ -86,7 +85,7 @@ Opaque.SettingsList { // groupSettingsPane RowLayout { width: parent.width Layout.fillWidth: true - Opaque.ScalingLabel { + Opaque.Label { text: gsp.connected ? qsTr("server-connectivity-connected") : qsTr("server-connectivity-disconnected") Layout.alignment: Qt.AlignLeft } @@ -104,7 +103,7 @@ Opaque.SettingsList { // groupSettingsPane width: parent.width Layout.fillWidth: true - Opaque.ScalingLabel { + Opaque.Label { text: gsp.synced ? qsTr("server-synced") : qsTr("server-not-synced") Layout.alignment: Qt.AlignLeft } diff --git a/qml/panes/OverlayPane.qml b/qml/panes/OverlayPane.qml index 3e0da544..f81a9b14 100644 --- a/qml/panes/OverlayPane.qml +++ b/qml/panes/OverlayPane.qml @@ -30,6 +30,7 @@ ColumnLayout { StackLayout { id: overlayStack Layout.fillWidth: true + Layout.fillHeight: true width: parent.width @@ -44,23 +45,23 @@ ColumnLayout { ChatOverlay { //0 - Layout.maximumHeight: overlayStack.height - Layout.maximumWidth: overlayStack.width +// Layout.maximumHeight: overlayStack.height +// Layout.maximumWidth: overlayStack.width } ListOverlay{ //1 - Layout.maximumHeight: overlayStack.height - Layout.maximumWidth: overlayStack.width +// Layout.maximumHeight: overlayStack.height +// Layout.maximumWidth: overlayStack.width } BulletinOverlay{ //2 - Layout.maximumHeight: overlayStack.height - Layout.maximumWidth: overlayStack.width +// Layout.maximumHeight: overlayStack.height +// Layout.maximumWidth: overlayStack.width } MembershipOverlay { //3 - Layout.maximumHeight: overlayStack.height - Layout.maximumWidth: overlayStack.width +// Layout.maximumHeight: overlayStack.height +// Layout.maximumWidth: overlayStack.width } } diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index a2aaaf34..bd977c09 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -14,8 +14,6 @@ import "../const" Opaque.SettingsList { // settingsPane id: root - anchors.fill: parent - anchors.topMargin: 20 width: parent.width height: parent.height contentHeight: peerSettings.height + 20 @@ -80,8 +78,8 @@ Opaque.SettingsList { // settingsPane field: Opaque.ToggleSwitch { anchors.right: parent.right - isToggled: root.authorization == Const.auth_blocked - onToggled: function() { + checked: root.authorization == Const.auth_blocked + onCheckedChanged: function() { if (root.authorization == Const.auth_blocked) { root.authorization = Const.auth_unknown gcd.setPeerAuthorization(txtOnion.text, Const.auth_unknown) diff --git a/qml/panes/ProfileAddEditPane.qml b/qml/panes/ProfileAddEditPane.qml index 180f2c0e..2ef17138 100644 --- a/qml/panes/ProfileAddEditPane.qml +++ b/qml/panes/ProfileAddEditPane.qml @@ -103,9 +103,9 @@ Opaque.Flickable { width: 400 * gcd.themeScale spacing: 10 * gcd.themeScale - Opaque.ScalingLabel { + Opaque.Label { anchors.horizontalCenter: parent.horizontalCenter - size: Theme.primaryTextSize + size: Theme.textMediumPt //: New Profile || Edit Profile text: mode == mode_add ? qsTr("new-profile") : qsTr("edit-profile") @@ -122,9 +122,8 @@ Opaque.Flickable { Opaque.Portrait { id: portrait - size: 250 - - Layout.preferredHeight: size + Layout.preferredHeight: implicitHeight + Layout.preferredWidth: implicitWidth anchors.horizontalCenter: parent.horizontalCenter portraitBorderColor: Theme.portraitOnlineBorderColor @@ -136,18 +135,18 @@ Opaque.Flickable { badgeContent: Image {// Profle Type id: profiletype - source: radioUsePassword.checked ? gcd.assetPath + "core/lock-24px.webp" : gcd.assetPath + "core/lock-open-24px.webp" - height: 40 * gcd.themeScale + source: radioUsePassword.checked ? gcd.assetPath + "core/lock-24px.webp" : gcd.assetPath + "core/lock_open-24px.webp" + height: Theme.uiIconSizeS width: height } } - Opaque.ScalingLabel { + Opaque.Label { id: nameLabel visible: mode == mode_edit anchors.horizontalCenter: parent.horizontalCenter - size: Theme.primaryTextSize + size: Theme.textMediumPt bold: true } @@ -159,10 +158,10 @@ Opaque.Flickable { color: Theme.backgroundPaneColor } - Opaque.ScalingLabel { + Opaque.Label { visible: mode == mode_edit anchors.horizontalCenter: parent.horizontalCenter - size: Theme.secondaryTextSize + size: Theme.textSmallPt //: Send this address to peers you want to connect with text: qsTr("profile-oniblon-label") @@ -200,10 +199,10 @@ Opaque.Flickable { color: leftCol.color anchors.horizontalCenter: parent.horizontalCenter - Opaque.ScalingLabel { + Opaque.Label { id: noPasswordLabel width: parent.width - size: Theme.secondaryTextSize + size: Theme.textSmallPt anchors.horizontalCenter: parent.horizontalCenter //: Not using a password on this account means that all data stored locally will not be encrypted @@ -342,10 +341,10 @@ Opaque.Flickable { } - Opaque.ScalingLabel { + Opaque.Label { id: passwordErrorLabel anchors.horizontalCenter: parent.horizontalCenter - size: Theme.secondaryTextSize + size: Theme.textSmallPt //: Passwords do not match text: txtPassword1.text.length == 0 ? qsTr("password-error-empty") : qsTr("password-error-match") @@ -353,10 +352,10 @@ Opaque.Flickable { color: Theme.textfieldErrorColor } - Opaque.ScalingLabel { + Opaque.Label { id: passwordChangeErrorLabel anchors.horizontalCenter: parent.horizontalCenter - size: Theme.secondaryTextSize + size: Theme.textSmallPt //: Error changing password: Supplied password rejected text: qsTr("password-change-error") @@ -366,7 +365,7 @@ Opaque.Flickable { Opaque.Button { // ADD or SAVE button - height: Theme.primaryTextSize * 1.5 + //height: Theme.primaryTextSize * 1.5 anchors.horizontalCenter: parent.horizontalCenter @@ -418,7 +417,7 @@ Opaque.Flickable { text: qsTr("delete-profile-btn") //icon: "regular/trash-alt" visible: mode == mode_edit - height: Theme.primaryTextSize * 1.5 + //height: Theme.primaryTextSize * 1.5 onClicked: { @@ -426,9 +425,9 @@ Opaque.Flickable { } } - Opaque.ScalingLabel { + Opaque.Label { id: deleteConfirmLabel - size: Theme.secondaryTextSize + size: Theme.textSmallPt anchors.right: parent.right anchors.rightMargin: 20 * gcd.themeScale diff --git a/qml/panes/ProfileManagerPane.qml b/qml/panes/ProfileManagerPane.qml index f21ff010..a44a83a4 100644 --- a/qml/panes/ProfileManagerPane.qml +++ b/qml/panes/ProfileManagerPane.qml @@ -22,30 +22,28 @@ ColumnLayout { id: thecol anchors.fill: parent - spacing: 20 * gcd.themeScale + spacing: Theme.paddingSmall - Opaque.ScalingLabel { - Layout.alignment: Qt.AlignHCenter - wrapMode: TextEdit.Wrap - size: Theme.primaryTextSize - - font.family: Fonts.applicationFontRegular.name - font.styleName: "Bold" + Opaque.Label { + horizontalAlignment: Text.AlignHCenter + width: parent.width + Layout.fillWidth: true + bold: true //: Enter a password to view your profiles text: qsTr("enter-profile-password") } RowLayout { - width: 700 * gcd.themeScale + //width: 700 * gcd.themeScale Layout.alignment: Qt.AlignHCenter Opaque.UnderlineTextField { id: txtPassword //anchors.horizontalCenter: parent.horizontalCenter //Layout.fillWidth: true - Layout.maximumWidth: 450 * gcd.themeScale - Layout.minimumWidth: 450 * gcd.themeScale + //Layout.maximumWidth: 450 * gcd.themeScale + //Layout.minimumWidth: 450 * gcd.themeScale Layout.rightMargin: 40 Layout.leftMargin: 40 @@ -56,8 +54,6 @@ ColumnLayout { Opaque.Button { id: "button" - width: 100 * gcd.themeScale - height: Theme.primaryTextSize * gcd.themeScale //: Unlock text: qsTr("unlock") @@ -70,7 +66,7 @@ ColumnLayout { } } - Opaque.ScalingLabel { + Opaque.Label { id: error Layout.alignment: Qt.AlignHCenter color: Theme.textfieldErrorColor @@ -106,11 +102,10 @@ ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - Opaque.ScalingLabel { + Opaque.Label { id: profileLabel - size: Theme.subHeaderSize - font.family: Fonts.applicationFontRegular.name - font.styleName: "Bold" + size: Theme.textSubHeaderPt + bold: true anchors.left: parent.left anchors.leftMargin: 25 * gcd.themeScale bottomPadding: 10 * gcd.themeScale @@ -135,14 +130,13 @@ ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - Opaque.ScalingLabel { + Opaque.Label { id: serverLabel - size: Theme.subHeaderSize - font.family: Fonts.applicationFontRegular.name - font.styleName: "Bold" + size: Theme.textSubHeaderPt + bold: true anchors.left: parent.left - anchors.leftMargin: 25 * gcd.themeScale - bottomPadding: 10 * gcd.themeScale + anchors.leftMargin: Theme.paddingStandard + bottomPadding: Theme.paddingSmall //: Your Profiles text: qsTr("your-servers") diff --git a/qml/panes/ServerAddEditPane.qml b/qml/panes/ServerAddEditPane.qml index 1eff6f0d..3058263b 100644 --- a/qml/panes/ServerAddEditPane.qml +++ b/qml/panes/ServerAddEditPane.qml @@ -39,9 +39,9 @@ Opaque.SettingsList { // Add Profile Pane anchors.horizontalCenter: parent.horizontalCenter width: 700 - Opaque.ScalingLabel { + Opaque.Label { text: server_name - size: 16 + header: true } Opaque.Setting { @@ -51,9 +51,9 @@ Opaque.SettingsList { // Add Profile Pane field: Opaque.ToggleSwitch { anchors.right: parent.right - isToggled: serverAddEditPane.server_available - onToggled: function() { - serverAddEditPane.server_available = !serverAddEditPane.server_available + checked: serverAddEditPane.server_available + onCheckedChanged: function() { + //serverAddEditPane.server_available = !serverAddEditPane.server_available if (serverAddEditPane.server_available) { gcd.startServer(serverAddEditPane.server_name) } else { @@ -75,9 +75,9 @@ Opaque.SettingsList { // Add Profile Pane field: Opaque.ToggleSwitch { anchors.right: parent.right - isToggled: serverAddEditPane.autostart_server - onToggled: function() { - serverAddEditPane.autostart_server = !serverAddEditPane.autostart_server + checked: serverAddEditPane.autostart_server + onCheckedChanged: function() { + //serverAddEditPane.autostart_server = !serverAddEditPane.autostart_server gcd.autostartServer(serverAddEditPane.server_name, serverAddEditPane.autostart_server) } } diff --git a/qml/panes/ServerInfoPane.qml b/qml/panes/ServerInfoPane.qml index 372ed12d..fe313a2b 100644 --- a/qml/panes/ServerInfoPane.qml +++ b/qml/panes/ServerInfoPane.qml @@ -14,9 +14,8 @@ import "../const" Opaque.SettingsList { // groupSettingsPane id: gsp - anchors.fill: parent property string serverName - property color backgroundColor: parent.color + property color backgroundColor: "red"//parent.color?? property bool connected: false property bool synced: false @@ -66,11 +65,11 @@ Opaque.SettingsList { // groupSettingsPane onSupplyServerSettings: function(server, key_names, keys) { gsp.serverName = server; toolbar.setTitle(qsTr("server-settings")); - console.log("Servers: " + key_names); - for (let i=0; i