new scaling system pass two
the build was successful Details

This commit is contained in:
erinn 2020-12-17 08:10:57 -08:00
parent c87bf93b0e
commit 32b617d3ec
19 changed files with 144 additions and 171 deletions

View File

@ -42,12 +42,7 @@ type GrandCentralDispatcher struct {
_ int `property:"torStatus"` _ int `property:"torStatus"`
_ string `property:"os"` _ string `property:"os"`
_ bool `property:"firstTime"` _ bool `property:"firstTime"`
// phasing out themeScale in three steps: _ int `property:"scaleFactor,auto,changed"`
// 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:"theme,auto,changed"`
_ string `property:"locale,auto,changed"` _ string `property:"locale,auto,changed"`
_ string `property:"version"` _ string `property:"version"`
@ -103,7 +98,7 @@ type GrandCentralDispatcher struct {
// settings helpers // settings helpers
_ func(str string) `signal:"InvokePopup"` _ func(str string) `signal:"InvokePopup"`
_ func(locale string, zoom float32, theme string) `signal:"SupplySettings"` _ func(locale string, scale int, theme string) `signal:"SupplySettings"`
_ func(groupID, name, server, invitation string, accepted bool, addrbooknames, addrbookaddrs []string) `signal:"SupplyGroupSettings"` _ func(groupID, name, server, invitation string, accepted bool, addrbooknames, addrbookaddrs []string) `signal:"SupplyGroupSettings"`
_ func(onion, nick string, authorization string, storage string) `signal:"SupplyPeerSettings"` _ func(onion, nick string, authorization string, storage string) `signal:"SupplyPeerSettings"`
_ func(server string, key_types []string, keys []string) `signal:"SupplyServerSettings"` _ func(server string, key_types []string, keys []string) `signal:"SupplyServerSettings"`
@ -111,8 +106,8 @@ type GrandCentralDispatcher struct {
// signals emitted from the ui (and implemented in go, below) // signals emitted from the ui (and implemented in go, below)
// ui // ui
_ func() `signal:"onActivate,auto"` _ func() `signal:"onActivate,auto"`
_ func(pane int) `signal:"setRootPaneState",auto` _ func(pane int) `signal:"setRootPaneState,auto"`
_ func(pane int) `signal:"setProfilePaneState",auto` _ func(pane int) `signal:"setProfilePaneState,auto"`
// profile managemenet // profile managemenet
_ func(onion, nick string) `signal:"updateNick,auto"` _ func(onion, nick string) `signal:"updateNick,auto"`
_ func(handle string) `signal:"loadProfile,auto"` _ func(handle string) `signal:"loadProfile,auto"`
@ -163,8 +158,7 @@ func (this *GrandCentralDispatcher) init() {
firstTime := false firstTime := false
this.GlobalSettings, firstTime = ReadGlobalSettings() this.GlobalSettings, firstTime = ReadGlobalSettings()
this.SetFirstTime(firstTime) this.SetFirstTime(firstTime)
this.SetThemeScale(this.GlobalSettings.Zoom) this.SetScaleFactor(this.GlobalSettings.Scale)
this.SetThemeScaleNew(this.GlobalSettings.Scale)
this.SetTheme(this.GlobalSettings.Theme) this.SetTheme(this.GlobalSettings.Theme)
this.SetExperimentsEnabled(this.GlobalSettings.ExperimentsEnabled) this.SetExperimentsEnabled(this.GlobalSettings.ExperimentsEnabled)
this.SetExperiments(this.GlobalSettings.Experiments) this.SetExperiments(this.GlobalSettings.Experiments)
@ -460,7 +454,7 @@ func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, over
} }
func (this *GrandCentralDispatcher) requestSettings() { func (this *GrandCentralDispatcher) requestSettings() {
this.SupplySettings(this.GlobalSettings.Locale, this.GlobalSettings.Zoom, this.GlobalSettings.Theme) this.SupplySettings(this.GlobalSettings.Locale, this.GlobalSettings.Scale, this.GlobalSettings.Theme)
} }
func (this *GrandCentralDispatcher) saveSettings(zoom, locale string) { func (this *GrandCentralDispatcher) saveSettings(zoom, locale string) {
@ -780,12 +774,7 @@ func (this *GrandCentralDispatcher) setLocaleHelper(locale string) {
this.QMLEngine.Retranslate() this.QMLEngine.Retranslate()
} }
func (this *GrandCentralDispatcher) themeScaleChanged(newThemeScale float32) { func (this *GrandCentralDispatcher) scaleFactorChanged(newScale int) {
this.GlobalSettings.Zoom = newThemeScale
WriteGlobalSettings(this.GlobalSettings)
}
func (this *GrandCentralDispatcher) themeScaleNewChanged(newScale int) {
this.GlobalSettings.Scale = newScale this.GlobalSettings.Scale = newScale
WriteGlobalSettings(this.GlobalSettings) WriteGlobalSettings(this.GlobalSettings)
} }

View File

@ -9,15 +9,13 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
"runtime"
) )
const GlobalSettingsFilename = "ui.globals" const GlobalSettingsFilename = "ui.globals"
const saltFile = "SALT" const saltFile = "SALT"
type GlobalSettings struct { type GlobalSettings struct {
Zoom float32 // deprecated Scale int
Scale int // the new hotness
Locale string Locale string
Theme string Theme string
PreviousPid int64 PreviousPid int64
@ -27,7 +25,6 @@ type GlobalSettings struct {
} }
var DefaultGlobalSettings = GlobalSettings{ var DefaultGlobalSettings = GlobalSettings{
Zoom: 1.9,
Scale: 2, Scale: 2,
Locale: "en", Locale: "en",
Theme: "light", Theme: "light",
@ -61,9 +58,6 @@ func InitGlobalSettingsFile(directory string, password string) error {
func ReadGlobalSettings() (*GlobalSettings, bool) { func ReadGlobalSettings() (*GlobalSettings, bool) {
settings := DefaultGlobalSettings settings := DefaultGlobalSettings
if runtime.GOOS == "android" {
settings.Zoom = 2.9
}
settings.Locale = core.QLocale_System().Name() settings.Locale = core.QLocale_System().Name()
settingsBytes, err := the.GlobalSettingsFile.Read() settingsBytes, err := the.GlobalSettingsFile.Read()

View File

@ -40,17 +40,17 @@ ApplicationWindow {
retText = retText.replace(/\n/g,"<br/>").replace(/\s\s/g, "&nbsp;&nbsp;") retText = retText.replace(/\n/g,"<br/>").replace(/\s\s/g, "&nbsp;&nbsp;")
// mutant standard stickers // mutant standard stickers
if (isntEditable) retText = Mutant.standard.parse(retText, 1.5 * gcd.themeScale * Theme.chatSize) if (isntEditable) retText = Mutant.standard.parse(retText, ptToPx(Theme.chatSize))
return retText return retText
} }
function ptToPx(pt) { function ptToPx(pt) {
return Screen.pixelDensity * 25.4 * pt / 72 return Math.floor(Screen.pixelDensity * 25.4 * pt / 72)
} }
function pxToPt(px) { function pxToPt(px) {
return px * 72 / (Screen.pixelDensity * 25.4) return Math.floor(px * 72 / (Screen.pixelDensity * 25.4))
} }
StackView { StackView {
@ -199,7 +199,6 @@ ApplicationWindow {
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: (divider.visible ? divider.left : parent.right) anchors.right: (divider.visible ? divider.left : parent.right)
//anchors.topMargin: 10 * gcd.themeScale
dualPane: theStack.pane != theStack.emptyPane || theStack.pane == undefined dualPane: theStack.pane != theStack.emptyPane || theStack.pane == undefined
} }
@ -207,7 +206,7 @@ ApplicationWindow {
id: divider id: divider
width: 2 width: 2
anchors.right: parent.right anchors.right: parent.right
height: parent.height - (20 * gcd.themeScale) height: parent.height - 2 * Theme.paddingStandard
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: theStack.pane != theStack.emptyPane visible: theStack.pane != theStack.emptyPane
//Layout.fillHeight: true //Layout.fillHeight: true
@ -244,7 +243,7 @@ ApplicationWindow {
Layout.fillHeight: true Layout.fillHeight: true
OverlayPane { // messagePane OverlayPane { // messagePane
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 10// * gcd.themeScale anchors.topMargin: Theme.paddingSmall
} }
} }

@ -1 +1 @@
Subproject commit 136e613ab596ae70edfa73fc6019f5dde44e0a08 Subproject commit 10123e56a6a6d251c0ff707e793de857250d7ad4

View File

@ -16,8 +16,6 @@ W.Overlay {
property bool loading property bool loading
property string historyState: "DefaultDeleteHistory" property string historyState: "DefaultDeleteHistory"
//horizontalPadding: 15 * gcd.themeScale
Connections { Connections {
target: mm target: mm
onRowsInserted: { onRowsInserted: {
@ -137,7 +135,7 @@ W.Overlay {
property string txt: section property string txt: section
color: Theme.backgroundMainColor color: Theme.backgroundMainColor
width: parent.width width: parent.width
height: texmet.height + 6 + 12// * gcd.themeScale height: texmet.height + 6 + 2 * Theme.paddingSmall
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -156,7 +154,7 @@ W.Overlay {
// ... and this can be changed to // ... and this can be changed to
// text: parent.parent.section // text: parent.parent.section
text: parent.parent.txt text: parent.parent.txt
font.pixelSize: Theme.chatSize * gcd.themeScale font.pointSize: Theme.textSmallPt
color: Theme.messageFromOtherTextColor color: Theme.messageFromOtherTextColor
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -165,7 +163,7 @@ W.Overlay {
TextMetrics { TextMetrics {
id: texmet id: texmet
text: txtDate.text text: txtDate.text
font.pixelSize: Theme.chatSize * gcd.themeScale font: txtDate.font
} }
} }
} }

View File

@ -27,13 +27,15 @@ Rectangle {
groupAddr.text = "" groupAddr.text = ""
onionLabel.text = gcd.selectedProfile onionLabel.text = gcd.selectedProfile
gcd.requestPeeredServers()
} }
Column { Column {
anchors.fill: parent anchors.fill: parent
spacing: 25 * gcd.themeScale spacing: Theme.paddingSmall
leftPadding: 20 * gcd.themeScale leftPadding: Theme.paddingStandard
rightPadding: 20 * gcd.themeScale rightPadding: Theme.paddingStandard
Opaque.Label { Opaque.Label {
id: shareLabel id: shareLabel
@ -54,7 +56,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
readOnly: true readOnly: true
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
button_text: qsTr("copy-btn") button_text: qsTr("copy-btn")
dropShadowColor: Theme.dropShadowPaneColor dropShadowColor: Theme.dropShadowPaneColor
@ -68,7 +70,7 @@ Rectangle {
Rectangle { // Spacer Rectangle { // Spacer
width: 1 width: 1
height: 25 * gcd.themeScale height: Theme.paddingStandard
color: root.color color: root.color
} }
@ -89,16 +91,16 @@ Rectangle {
Column { // Add a peer Column { // Add a peer
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: 20 * gcd.themeScale leftPadding: Theme.paddingStandard
rightPadding: 20 * gcd.themeScale rightPadding: Theme.paddingStandard
spacing: 25 * gcd.themeScale spacing: Theme.paddingSmall
Opaque.UnderlineTextField { Opaque.UnderlineTextField {
id: peerAddr id: peerAddr
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Address //: Address
@ -110,7 +112,7 @@ Rectangle {
id: peerName id: peerName
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Name //: Name
@ -121,9 +123,9 @@ Rectangle {
Column { // Create a group Column { // Create a group
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: 20 * gcd.themeScale leftPadding: Theme.paddingStandard
rightPadding: 20 * gcd.themeScale rightPadding: Theme.paddingStandard
spacing: 25 * gcd.themeScale spacing: Theme.paddingSmall
Opaque.UnderlineTextField { Opaque.UnderlineTextField {
@ -131,7 +133,7 @@ Rectangle {
id: groupNameCreate id: groupNameCreate
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Group Name //: Group Name
@ -139,24 +141,18 @@ Rectangle {
} }
Row { Column {
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter
Column { visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment")
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") Opaque.Label {
width: parent.width / 2 //: Server
Opaque.Label { text: qsTr("server")
//: Server
text: qsTr("server")
}
} }
Opaque.ComboBox {
Column { width:parent.width
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") model: ListModel {
width: parent.width / 2 id: cbServerList
Opaque.Label {
//: Invitation
text: qsTr("invitation")
} }
} }
} }
@ -164,9 +160,9 @@ Rectangle {
Column { // Join a group Column { // Join a group
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: 20 * gcd.themeScale leftPadding: Theme.paddingStandard
rightPadding: 20 * gcd.themeScale rightPadding: Theme.paddingStandard
spacing: 25 * gcd.themeScale spacing: Theme.paddingSmall
Opaque.UnderlineTextField { Opaque.UnderlineTextField {
@ -174,7 +170,7 @@ Rectangle {
id: groupAddr id: groupAddr
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Address //: Address
@ -187,7 +183,7 @@ Rectangle {
Rectangle { // Spacer Rectangle { // Spacer
width: 1 width: 1
height: 25 * gcd.themeScale height: Theme.paddingStandard
color: root.color color: root.color
} }
@ -195,8 +191,6 @@ Rectangle {
Opaque.Button { Opaque.Button {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: 40 * gcd.themeScale
//: Add Peer | Create Group | Join Group //: Add Peer | Create Group | Join Group
text: tabBar.currentItem.text text: tabBar.currentItem.text
@ -204,6 +198,9 @@ Rectangle {
if (tabBar.currentIndex == 0) { if (tabBar.currentIndex == 0) {
gcd.addPeer(peerName.text, peerAddr.text) gcd.addPeer(peerName.text, peerAddr.text)
theStack.currentIndex = theStack.emptyPane theStack.currentIndex = theStack.emptyPane
} else if (tabBar.currentIndex == 1) {
gcd.createGroup(cbServerList.get(cbServerList.selectedIndex).text, groupNameCreate.text);
theStack.currentIndex = theStack.emptyPane
} else if (tabBar.currentIndex == 2) { } else if (tabBar.currentIndex == 2) {
gcd.addGroup(groupAddr.text) gcd.addGroup(groupAddr.text)
theStack.currentIndex = theStack.emptyPane theStack.currentIndex = theStack.emptyPane
@ -213,4 +210,16 @@ Rectangle {
} }
Connections {
target: gcd
onSupplyPeeredServers: function(servers) {
console.log("Servers are here:!" + servers);
cbServerList.clear();
for (var i=0;i<servers.length;i++) {
cbServerList.append( {"text": servers[i], "value": servers[i]});
}
}
}
} }

View File

@ -80,14 +80,13 @@ Opaque.SettingsList { // settingsPane
checked: root.authorization == Const.auth_blocked checked: root.authorization == Const.auth_blocked
onCheckedChanged: function() { onCheckedChanged: function() {
if (root.authorization == Const.auth_blocked) { if (!checked) {
root.authorization = Const.auth_unknown root.authorization = Const.auth_unknown
gcd.setPeerAuthorization(txtOnion.text, Const.auth_unknown) gcd.setPeerAuthorization(txtOnion.text, Const.auth_unknown)
} else { } else {
root.authorization = Const.auth_blocked root.authorization = Const.auth_blocked
gcd.setPeerAuthorization(txtOnion.text, Const.auth_blocked) gcd.setPeerAuthorization(txtOnion.text, Const.auth_blocked)
} }
isToggled = root.authorization == Const.auth_blocked
} }
} }
} }

View File

@ -100,8 +100,7 @@ Opaque.Flickable {
id: leftContents id: leftContents
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Layout.alignment : Qt.AlignHCenter + Qt.AlignTop Layout.alignment : Qt.AlignHCenter + Qt.AlignTop
width: 400 * gcd.themeScale spacing: Theme.paddingSmall
spacing: 10 * gcd.themeScale
Opaque.Label { Opaque.Label {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -114,7 +113,7 @@ Opaque.Flickable {
// spacing // spacing
Rectangle { Rectangle {
height: 30 * gcd.themeScale height: Theme.paddingSmall
width: 100 width: 100
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
} }
@ -153,7 +152,7 @@ Opaque.Flickable {
// spacing // spacing
Rectangle { Rectangle {
visible: mode == mode_edit visible: mode == mode_edit
height: 10 * gcd.themeScale height: Theme.paddingSmall
width: 100 width: 100
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
} }
@ -173,7 +172,7 @@ Opaque.Flickable {
visible: mode == mode_edit visible: mode == mode_edit
readOnly: true readOnly: true
width: leftCol.width - (40*gcd.themeScale) width: leftCol.width - (2 * Theme.paddingStandard)
button_text: qsTr("copy-btn") button_text: qsTr("copy-btn")
dropShadowColor: Theme.dropShadowPaneColor dropShadowColor: Theme.dropShadowPaneColor
@ -188,7 +187,7 @@ Opaque.Flickable {
// spacing // spacing
Rectangle { Rectangle {
visible: radioNoPassword.checked visible: radioNoPassword.checked
height: 30 * gcd.themeScale height: Theme.paddingSmall
width: 100 width: 100
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
} }
@ -213,7 +212,7 @@ Opaque.Flickable {
// spacing // spacing
Rectangle { Rectangle {
height: 30 * gcd.themeScale height: Theme.paddingSmall
width: 100 width: 100
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
@ -230,7 +229,7 @@ Opaque.Flickable {
Rectangle { Rectangle {
id: rightCol id: rightCol
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
anchors.topMargin: 80 * gcd.themeScale anchors.topMargin: Theme.paddingLarge
height: rightContents.height height: rightContents.height
implicitHeight: height implicitHeight: height
Layout.fillWidth: true Layout.fillWidth: true
@ -244,14 +243,14 @@ Opaque.Flickable {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Layout.alignment : Qt.AlignHCenter + Qt.AlignTop Layout.alignment : Qt.AlignHCenter + Qt.AlignTop
width: 400 * gcd.themeScale spacing: Theme.paddingSmall
spacing: 40 * gcd.themeScale padding: Theme.paddingStandard
Opaque.UnderlineTextField { Opaque.UnderlineTextField {
id: txtProfileName id: txtProfileName
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Your Display Name //: Your Display Name
@ -262,7 +261,7 @@ Opaque.Flickable {
RowLayout { RowLayout {
visible: (mode == mode_add) || (tag == "v1-defaultPassword") visible: (mode == mode_add) || (tag == "v1-defaultPassword")
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//id: radioButtons //id: radioButtons
@ -295,7 +294,7 @@ Opaque.Flickable {
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Current Password //: Current Password
@ -311,7 +310,7 @@ Opaque.Flickable {
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
echoMode: TextInput.Password echoMode: TextInput.Password
@ -331,7 +330,7 @@ Opaque.Flickable {
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: parent.width - (40*gcd.themeScale) width: parent.width - (2 * Theme.paddingStandard)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//: Reenter password //: Reenter password
@ -410,7 +409,7 @@ Opaque.Flickable {
Opaque.Button { Opaque.Button {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 20 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
//: Delete Profile //: Delete Profile
text: qsTr("delete-profile-btn") text: qsTr("delete-profile-btn")
@ -429,7 +428,7 @@ Opaque.Flickable {
size: Theme.textSmallPt size: Theme.textSmallPt
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 20 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
//: Type DELETE to confirm //: Type DELETE to confirm
text: qsTr("delete-confirm-label")+ ":" text: qsTr("delete-confirm-label")+ ":"
@ -441,9 +440,9 @@ Opaque.Flickable {
visible: deleting visible: deleting
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
width: 300 * gcd.themeScale width: parent.width - (2 * Theme.paddingStandard)
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 20 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
placeholderText: qsTr("delete-confirm-label") placeholderText: qsTr("delete-confirm-label")
} }
@ -453,7 +452,7 @@ Opaque.Flickable {
height: Theme.primaryTextSize * 1.5 height: Theme.primaryTextSize * 1.5
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 20 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
//: Really Delete Profile //: Really Delete Profile
text: qsTr("delete-profile-confirm-btn") text: qsTr("delete-profile-confirm-btn")
@ -476,7 +475,7 @@ Opaque.Flickable {
// spacing // spacing
Rectangle { Rectangle {
height: 30 * gcd.themeScale height: Theme.paddingSmall
width: 100 width: 100
color: Theme.backgroundPaneColor color: Theme.backgroundPaneColor
} }

View File

@ -82,7 +82,7 @@ ColumnLayout {
// space // space
Rectangle { Rectangle {
width: 1 width: 1
height: 20 * gcd.themeScale height: Theme.paddingStandard
color: Theme.backgroundMainColor color: Theme.backgroundMainColor
} }
@ -101,8 +101,8 @@ ColumnLayout {
size: Theme.textSubHeaderPt size: Theme.textSubHeaderPt
bold: true bold: true
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 25 * gcd.themeScale anchors.leftMargin: Theme.paddingStandard
bottomPadding: 10 * gcd.themeScale bottomPadding: Theme.paddingSmall
//: Your Profiles //: Your Profiles
text: qsTr("your-profiles") text: qsTr("your-profiles")

View File

@ -76,14 +76,13 @@ Opaque.SettingsList { // settingsPane
id: zoomSlider id: zoomSlider
from: 0 from: 0
to: 4 to: 4
value: gcd.themeScaleNew value: gcd.scaleFactor
snapMode: Slider.SnapAlways snapMode: Slider.SnapAlways
stepSize: 1 stepSize: 1
onValueChanged: { onValueChanged: {
windowItem.width = windowItem.width windowItem.width = windowItem.width
gcd.themeScale = 1.0 gcd.scaleFactor = zoomSlider.value
gcd.themeScaleNew = zoomSlider.value
} }
width: 200 width: 200
} }
@ -252,7 +251,7 @@ Opaque.SettingsList { // settingsPane
Connections { Connections {
target: gcd target: gcd
onSupplySettings: function(locale, zoom, theme) { onSupplySettings: function(locale, scale, theme) {
for (var i=0; i < cbLangItems.count; i++) { for (var i=0; i < cbLangItems.count; i++) {
var item = cbLangItems.get(i) var item = cbLangItems.get(i)
if (item["value"] == locale) { if (item["value"] == locale) {

View File

@ -21,7 +21,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 100 * gcd.themeScale anchors.topMargin: 60 + 10 * Theme.scale
width: 200 width: 200
height: 200 height: 200
@ -31,7 +31,7 @@ Item {
id: splashImage id: splashImage
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: aniKnot.bottom anchors.top: aniKnot.bottom
anchors.topMargin: 20 * gcd.themeScale anchors.topMargin: Theme.paddingStandard
source: "qrc:/qml/images/cwtch_title.png" source: "qrc:/qml/images/cwtch_title.png"
} }
@ -41,7 +41,7 @@ Item {
id: loadingLabel id: loadingLabel
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: splashImage.bottom anchors.top: splashImage.bottom
anchors.topMargin: 10 * gcd.themeScale anchors.topMargin: Theme.paddingSmall
//: Loading tor... //: Loading tor...
text: qsTr("loading-tor") text: qsTr("loading-tor")
@ -53,7 +53,7 @@ Item {
id: opImage id: opImage
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 20 * gcd.themeScale anchors.bottomMargin: Theme.paddingStandard
source: "qrc:/qml/images/Open_Privacy_Logo_lightoutline.png" source: "qrc:/qml/images/Open_Privacy_Logo_lightoutline.png"
} }

View File

@ -12,7 +12,6 @@ ColumnLayout {
id: root id: root
property alias dualPane: myprof.dualPane property alias dualPane: myprof.dualPane
property real logscale: 4 * Math.log10(gcd.themeScale + 1)
MyProfile { // CURRENT PROFILE INFO AND CONTROL BAR MyProfile { // CURRENT PROFILE INFO AND CONTROL BAR
id: myprof id: myprof
@ -216,23 +215,15 @@ ColumnLayout {
id: blockedToggle id: blockedToggle
property bool showing: true property bool showing: true
leftPadding: 32 * logscale // for review: uhhh....?
topPadding: 16 * logscale leftPadding: Theme.paddingLarge
bottomPadding: 8 * logscale topPadding: Theme.paddingStandard
spacing: 5 * logscale bottomPadding: Theme.paddingSmall
Opaque.Label { Opaque.Label {
id: blockLbl id: blockLbl
text: qsTr("blocked") text: qsTr("blocked") + blockedToggle.showing ? "▲" : "▼"
size: Theme.textSmallPt
color: Theme.portraitBlockedTextColor
}
Opaque.Label {
id: blockBtn
text: blockedToggle.showing ? "▲" : "▼"
size: Theme.textSmallPt size: Theme.textSmallPt
color: Theme.portraitBlockedTextColor color: Theme.portraitBlockedTextColor
} }

View File

@ -34,11 +34,11 @@ Opaque.PortraitRow {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 1 * gcd.themeScale anchors.leftMargin: Theme.paddingMinimal
anchors.rightMargin: 25 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
height: parent.height * .1 height: parent.height * .1
width: 100 * gcd.themeScale width: 50 + 20 * Theme.scale
indeterminate: true indeterminate: true
@ -54,14 +54,14 @@ Opaque.PortraitRow {
size: parent.height/4 size: parent.height/4
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 25 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
anchors.leftMargin: 1 * gcd.themeScale anchors.leftMargin: Theme.paddingMinimal
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
content: Label { content: Label {
id: lblUnread id: lblUnread
color: Theme.portraitContactBadgeTextColor color: Theme.portraitContactBadgeTextColor
font.pixelSize: Theme.badgeTextSize * gcd.themeScale font.pointSize: Theme.textBadgeLabelPt
font.weight: Font.Bold font.weight: Font.Bold
text: badge > 99 ? "99+" : badge text: badge > 99 ? "99+" : badge
} }
@ -71,16 +71,16 @@ Opaque.PortraitRow {
visible: authorization == Const.auth_unknown visible: authorization == Const.auth_unknown
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 1 * gcd.themeScale anchors.leftMargin: Theme.paddingMinimal
anchors.rightMargin: 25 * gcd.themeScale anchors.rightMargin: Theme.paddingStandard
spacing: 16 * gcd.themeScale spacing: Theme.paddingSmall
Opaque.Icon { Opaque.Icon {
source: gcd.assetPath + "core/favorite-24px.webp" source: gcd.assetPath + "core/favorite-24px.webp"
iconColor: Theme.toolbarIconColor iconColor: Theme.toolbarIconColor
backgroundColor: rowColor backgroundColor: rowColor
height: 18 * gcd.themeScale height: Theme.uiIconSizeS
width: 18 * gcd.themeScale width: Theme.uiIconSizeS
onClicked: { gcd.setPeerAuthorization(handle, Const.auth_approved)} onClicked: { gcd.setPeerAuthorization(handle, Const.auth_approved)}
} }
@ -89,8 +89,8 @@ Opaque.PortraitRow {
source: gcd.assetPath + "core/delete-24px.webp" source: gcd.assetPath + "core/delete-24px.webp"
iconColor: Theme.toolbarIconColor iconColor: Theme.toolbarIconColor
backgroundColor: rowColor backgroundColor: rowColor
height: 18 * gcd.themeScale height: Theme.uiIconSizeS
width: 18 * gcd.themeScale width: Theme.uiIconSizeS
onClicked: gcd.setPeerAuthorization(handle, Const.auth_blocked) onClicked: gcd.setPeerAuthorization(handle, Const.auth_blocked)
} }

View File

@ -29,8 +29,6 @@ Rectangle {
property string error property string error
property bool calendarEvent property bool calendarEvent
property real logscale: 4 * Math.log10(gcd.themeScale + 1)
Connections { Connections {
target: gcd target: gcd
@ -86,10 +84,10 @@ Rectangle {
Rectangle { // THIS IS JUST A PRETTY MESSAGE-HOLDING RECTANGLE Rectangle { // THIS IS JUST A PRETTY MESSAGE-HOLDING RECTANGLE
id: rectMessageBubble id: rectMessageBubble
height: (handle.visible ? handle.height : 0) + (10 * gcd.themeScale) + colMessageBubble.height + 8 height: (handle.visible ? handle.height : 0) + colMessageBubble.height + 2 * Theme.paddingMinimal
width: colMessageBubble.width + 6 width: colMessageBubble.width + 2 * Theme.radiusM
color: fromMe ? Theme.messageFromMeBackgroundColor : (calendarEvent ? Theme.messageFromOtherBackgroundColor : Theme.messageFromOtherBackgroundColor) color: fromMe ? Theme.messageFromMeBackgroundColor : (calendarEvent ? Theme.messageFromOtherBackgroundColor : Theme.messageFromOtherBackgroundColor)
radius: 15 * logscale radius: Theme.radiusL
anchors.left: fromMe ? undefined : (calendarEvent ? undefined : imgProfile.right) //parent.left anchors.left: fromMe ? undefined : (calendarEvent ? undefined : imgProfile.right) //parent.left
anchors.right: fromMe ? (calendarEvent ? undefined : parent.right) : undefined anchors.right: fromMe ? (calendarEvent ? undefined : parent.right) : undefined
@ -125,7 +123,6 @@ Rectangle {
bold: true bold: true
leftPadding: Theme.paddingSmall leftPadding: Theme.paddingSmall
rightPadding: Theme.paddingSmall rightPadding: Theme.paddingSmall
topPadding: Theme.paddingSmall
} }
Column { Column {

View File

@ -58,7 +58,7 @@ ColumnLayout {
Opaque.EmojiDrawer { Opaque.EmojiDrawer {
id: emojiDrawer id: emojiDrawer
Layout.fillWidth: true Layout.fillWidth: true
size: 24 * gcd.themeScale size: Theme.uiIconSizeM
onPicked: function(shortcode) { onPicked: function(shortcode) {
if (!txtMessage.enabled) return if (!txtMessage.enabled) return
@ -71,7 +71,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
height: statusText.visible ? statusText.height + (4 * gcd.themeScale) : 3 * gcd.themeScale height: statusText.visible ? statusText.height + (2 * Theme.paddingMinimal) : Theme.paddingMinimal
implicitHeight: height implicitHeight: height
color: Theme.dividerColor color: Theme.dividerColor
@ -97,8 +97,8 @@ ColumnLayout {
Rectangle { // MESSAGE ENTRY TEXTFIELD Rectangle { // MESSAGE ENTRY TEXTFIELD
id: rectMessage id: rectMessage
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: 120 * gcd.themeScale Layout.minimumHeight: 60 + 20 * Theme.scale
Layout.maximumHeight: 120 * gcd.themeScale Layout.maximumHeight: 60 + 20 * Theme.scale
color: Theme.backgroundMainColor color: Theme.backgroundMainColor
Opaque.Flickable { Opaque.Flickable {
@ -109,9 +109,9 @@ ColumnLayout {
TextArea { TextArea {
id: txtMessage id: txtMessage
font.pixelSize: Theme.chatSize * gcd.themeScale font.pointSize: Theme.chatSize
text: "" text: ""
padding: 6 * gcd.themeScale padding: Theme.paddingSmall
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
textFormat: Text.PlainText textFormat: Text.PlainText
width: rectMessage.width width: rectMessage.width
@ -152,7 +152,7 @@ ColumnLayout {
ColumnLayout { ColumnLayout {
id: colRight id: colRight
spacing: 0 spacing: 0
width: 100 * gcd.themeScale width: Theme.uiIconSizeM + 2 * Theme.paddingStandard
Layout.minimumWidth: width Layout.minimumWidth: width
Layout.preferredWidth: width Layout.preferredWidth: width
@ -162,9 +162,8 @@ ColumnLayout {
id: btnSend id: btnSend
source: gcd.assetPath + "core/send-24px.webp" source: gcd.assetPath + "core/send-24px.webp"
width: colRight.width width: colRight.width
// floor(...) needed or else send icon won't scale properly(?!?) height: Theme.uiIconSizeM + 2 * Theme.paddingMinimal
height: Math.floor(50 * gcd.themeScale) size: Theme.uiIconSizeM
size: 36 * gcd.themeScale
sourceWidth: size sourceWidth: size
sourceHeight: size sourceHeight: size
@ -191,9 +190,9 @@ ColumnLayout {
id: btnEmoji id: btnEmoji
source: gcd.assetPath + "core/mood-24px.webp" source: gcd.assetPath + "core/mood-24px.webp"
size: 25 size: Theme.uiIconSizeS
height: 36 * gcd.themeScale height: Theme.uiIconSizeS + 2 * Theme.paddingMinimal
width: 48 * gcd.themeScale width: colRight.width / 2
backgroundColor: enabled ? Theme.altButtonColor : Theme.altButtonDisabledColor backgroundColor: enabled ? Theme.altButtonColor : Theme.altButtonDisabledColor
hilightBackgroundColor: backgroundColor hilightBackgroundColor: backgroundColor
@ -206,9 +205,9 @@ ColumnLayout {
id: btnAttach id: btnAttach
source: gcd.assetPath + "core/attach_file-24px.webp" source: gcd.assetPath + "core/attach_file-24px.webp"
size: 25 size: Theme.uiIconSizeS
height: 36 * gcd.themeScale height: Theme.uiIconSizeS + 2 * Theme.paddingMinimal
width: 48 * gcd.themeScale width: colRight.width / 2
backgroundColor: enabled ? Theme.altButtonColor : Theme.altButtonDisabledColor backgroundColor: enabled ? Theme.altButtonColor : Theme.altButtonDisabledColor
hilightBackgroundColor: backgroundColor hilightBackgroundColor: backgroundColor

View File

@ -114,7 +114,7 @@ ColumnLayout {
badgeVisible: true badgeVisible: true
badgeContent: Image { badgeContent: Image {
source: gcd.assetPath + "core/fontawesome/solid/plus.webp" source: gcd.assetPath + "core/fontawesome/solid/plus.webp"
height: Theme.badgeTextSize * gcd.themeScale height: Theme.uiIconSizeS
width: height width: height
} }
badgeColor: Theme.portraitProfileBadgeColor badgeColor: Theme.portraitProfileBadgeColor

View File

@ -36,7 +36,7 @@ RowLayout {
badgeContent: Opaque.Icon {// Profle Type badgeContent: Opaque.Icon {// Profle Type
id: profiletype id: profiletype
source: tag == "v1-userPassword" ? gcd.assetPath + "core/lock-24px.webp" : gcd.assetPath + "core/lock_open-24px.webp" source: tag == "v1-userPassword" ? gcd.assetPath + "core/lock-24px.webp" : gcd.assetPath + "core/lock_open-24px.webp"
height: Theme.badgeTextSize * gcd.themeScale height: Theme.uiIconSizeS
width: height width: height
iconColor: Theme.defaultButtonTextColor iconColor: Theme.defaultButtonTextColor

View File

@ -104,7 +104,7 @@ ColumnLayout {
badgeVisible: true badgeVisible: true
badgeContent: Image { badgeContent: Image {
source: gcd.assetPath + "core/fontawesome/solid/plus.webp" source: gcd.assetPath + "core/fontawesome/solid/plus.webp"
height: Theme.badgeTextSize * gcd.themeScale height: Theme.uiIconSizeS
width: height width: height
} }
badgeColor: Theme.defaultButtonColor badgeColor: Theme.defaultButtonColor

View File

@ -12,8 +12,8 @@ import "../const"
Rectangle { Rectangle {
id: statusbar id: statusbar
readonly property int openHeight: 25 readonly property int openHeight: Theme.uiIconSizeS + 2 * Theme.paddingMinimal
readonly property int hideHeight: 10 readonly property int hideHeight: Theme.paddingClickTarget
property bool isHover: false property bool isHover: false
@ -27,9 +27,9 @@ Rectangle {
opacity: 0 opacity: 0
anchors.right: networkStatus.left anchors.right: networkStatus.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5 * gcd.themeScale anchors.rightMargin: Theme.paddingMinimal
font.pixelSize: Theme.statusTextSize * gcd.themeScale font.pixelSize: Theme.statusTextSize
} }
Opaque.Icon { Opaque.Icon {
@ -37,9 +37,9 @@ Rectangle {
opacity: 0 opacity: 0
anchors.right: connectionStatus.left anchors.right: connectionStatus.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5 * gcd.themeScale anchors.rightMargin: Theme.paddingMinimal
height: 18 height: Theme.uiIconSizeS
width: 18 width: Theme.uiIconSizeS
} }
@ -48,9 +48,9 @@ Rectangle {
opacity: 0 opacity: 0
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 10 * gcd.themeScale anchors.rightMargin: Theme.paddingSmall
height: 18 * gcd.themeScale height: Theme.uiIconSizeS
width: 18 * gcd.themeScale width: Theme.uiIconSizeS
} }
function changeStatus() { function changeStatus() {