new scaling system pass one #457

Open
erinn wants to merge 4 commits from newzoom into master
13 changed files with 175 additions and 210 deletions
Showing only changes of commit 72af3dbeeb - Show all commits

View File

@ -14,7 +14,7 @@ clean:
linux: linux:
date date
qtdeploy -qt_version $(QT_BUILD_VERSION) build linux 2>&1 | tee qtdeploy.log | pv qtdeploy -docker -qt_version $(QT_BUILD_VERSION) build linux 2>&1 | tee qtdeploy.log | pv
date date
cp -R assets deploy/linux/ cp -R assets deploy/linux/

@ -1 +1 @@
Subproject commit 6b285e4bbc2a673fceb1c0ffb0065d1dae9c5f8b Subproject commit 136e613ab596ae70edfa73fc6019f5dde44e0a08

View File

@ -11,70 +11,77 @@ import "../opaque/controls" as Awesome
import "../utils.js" as Utils import "../utils.js" as Utils
import "../opaque/styles" import "../opaque/styles"
import "../opaque/theme" import "../opaque/theme"
import "../widgets" as W
ColumnLayout { ColumnLayout {
id: listpanel
Layout.fillWidth: true Layout.fillWidth: true
width: parent.width width:parent.width
id: listpanel // todo: margins don't seem to be getting applied to search/additem textboxes? not sure why
Layout.margins: Theme.paddingStandard
property bool online: false property bool online: false
Text {
Layout.fillWidth: true
}
Opaque.IconTextField { Item {
id: filter width: 1
visible:listpanel.online height: Theme.paddingStandard
width: parent.width - 2 * Theme.paddingStandard }
//: ex: "Find..." Opaque.IconTextField {
placeholderText: qsTr("search-list") id: filter
horizontalAlignment: TextInput.AlignHCenter visible:listpanel.online
icon: gcd.assetPath + "core/search-24px.webp" Layout.fillWidth: true
//: ex: "Find..."
placeholderText: qsTr("search-list")
horizontalAlignment: TextInput.AlignHCenter
icon: gcd.assetPath + "core/search-24px.webp"
onTextChanged: { onTextChanged: {
listView.filter = text listView.filter = text
if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) { if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) {
listView.currentIndex = -1 listView.currentIndex = -1
} }
} }
} }
Opaque.Icon { Opaque.Icon {
visible:!listpanel.online visible:!listpanel.online
source: gcd.assetPath + "core/negative_heart_24px.webp" source: gcd.assetPath + "core/negative_heart_24px.webp"
iconColor: Theme.mainTextColor iconColor: Theme.mainTextColor
erinn marked this conversation as resolved Outdated
Outdated
Review

This shouldn't be commented out

This shouldn't be commented out
backgroundColor: Theme.backgroundPaneColor backgroundColor: Theme.backgroundPaneColor
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
height: 150 height: 150
width: 150 width: 150
} }
// Label {
// visible:!listpanel.online Opaque.Label {
// color: Theme.mainTextColor visible:!listpanel.online
// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter horizontalAlignment: Text.AlignHCenter
// elide: Text.ElideRight Layout.fillWidth: true
// font.pixelSize: 18 * gcd.themeScale elide: Text.ElideRight
// text: qsTr("peer-not-online") size: Theme.textMediumPt
// } text: qsTr("peer-not-online")
}
Flickable { // THE MESSAGE LIST ITSELF Flickable { // THE MESSAGE LIST ITSELF
id: sv id: sv
clip: true clip: true
visible:listpanel.online visible:listpanel.online
Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
contentWidth: parent.width contentWidth: parent.width
contentHeight: parent.height contentHeight: parent.height
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: 800 maximumFlickVelocity: 800
Connections { Connections {
@ -87,143 +94,138 @@ ColumnLayout {
} }
} }
Connections { Connections {
id: cnxns2 id: cnxns2
target: gcd target: gcd
onClearMessages: function() { onClearMessages: function() {
jsonModel4.clear() jsonModel4.clear()
} }
onAppendMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) { onAppendMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) {
handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error)
} }
onPrependMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) { onPrependMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) {
handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error)
} }
function handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) { function handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) {
var msg var msg
try { try {
msg = JSON.parse(message) msg = JSON.parse(message)
} catch (e) { } catch (e) {
return return
} }
if (msg.o != 4) return if (msg.o != 4) return
if (msg.t != undefined) { if (msg.t != undefined) {
jsonModel4.insert(0,{ jsonModel4.insert(0,{
"title":msg.t, "title":msg.t,
"selected":false, "selected":false,
"from": from, "from": from,
"displayName": displayName, "displayName": displayName,
"timestamp": ts, "timestamp": ts,
"complete": false "complete": false
}) })
} }
if(msg.c != undefined) { if(msg.c != undefined) {
jsonModel4.get(msg.c).complete = true jsonModel4.get(msg.c).complete = true
} }
} }
onUpdateContactStatus: function(_handle, _status, _loading) { onUpdateContactStatus: function(_handle, _status, _loading) {
if (gcd.selectedConversation == _handle) { if (gcd.selectedConversation == _handle) {
// Group is Synced OR p2p is Authenticated // Group is Synced OR p2p is Authenticated
if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) { if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) {
newlistitem.readOnly = false newlistitem.readOnly = false
listpanel.online = true listpanel.online = true
} else { } else {
newlistitem.readOnly = true newlistitem.readOnly = true
listpanel.online= false listpanel.online= false
} }
} }
} }
} }
ScrollBar.vertical: ScrollBar{ ScrollBar.vertical: ScrollBar{
policy: ScrollBar.AlwaysOn policy: ScrollBar.AlwaysOn
} }
ListView { ListView {
id: listView id: listView
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 10 anchors.leftMargin: 10
anchors.topMargin: 10 anchors.topMargin: 10
width: parent.width - 50 width: parent.width - 50
height: parent.height - 20 height: parent.height - 20
orientation: Qt.Vertical orientation: Qt.Vertical
spacing: 10 spacing: 10
model: jsonModel4 model: jsonModel4
property string filter: "" property string filter: ""
delegate: delegate:
Item { Item {
width: parent.width width: Listview.view.width
height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0 height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0
visible: title.indexOf(listView.filter) >= 0 visible: title.indexOf(listView.filter) >= 0
Column { Column {
width: parent.width width: parent.width
RowLayout { RowLayout {
CheckBox { CheckBox {
checked: complete checked: complete
onClicked: { onClicked: {
var msg = JSON.stringify({"o":4, "c":index}) var msg = JSON.stringify({"o":4, "c":index})
gcd.sendMessage(msg, newlistitem.nextMessageID++) gcd.sendMessage(msg, newlistitem.nextMessageID++)
} }
} }
RowLayout { RowLayout {
Text { Text {
id: texttitle id: texttitle
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap") text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap")
leftPadding: 10 leftPadding: 10
topPadding: 5 topPadding: 5
bottomPadding:5 bottomPadding:5
color: Theme.mainTextColor color: Theme.mainTextColor
} }
} }
} }
Opaque.HLine{} Opaque.HLine{}
} }
} }
focus: true focus: true
ListModel { ListModel {
id: jsonModel4 id: jsonModel4
} }
} }
} }
Opaque.ButtonTextField {
id: newlistitem
visible:listpanel.online
readOnly: false
button_text: qsTr("add-list-item-btn")
dropShadowColor: Theme.dropShadowPaneColor
property int nextMessageID: 1
width: parent.width - 2 * Theme.paddingStandard
onClicked: {
if (newlistitem.text != "") {
var msg = JSON.stringify({"o":4, "t":newlistitem.text})
gcd.sendMessage(msg, nextMessageID++)
}
newlistitem.text = ""
}
}
Opaque.HLine{}
Opaque.ButtonTextField {
id: newlistitem
visible:listpanel.online
readOnly: false
button_text: qsTr("add-list-item-btn")
dropShadowColor: Theme.dropShadowPaneColor
property int nextMessageID: 1
Layout.fillWidth: true
onClicked: {
if (newlistitem.text != "") {
var msg = JSON.stringify({"o":4, "t":newlistitem.text})
gcd.sendMessage(msg, nextMessageID++)
}
newlistitem.text = ""
}
}
} }

View File

@ -76,7 +76,6 @@ Opaque.SettingsList { // groupSettingsPane
} }
Opaque.Setting { Opaque.Setting {
property color backgroundColor: "red"//parent.color
inline: true inline: true
erinn marked this conversation as resolved Outdated
Outdated
Review

undebug :)

undebug :)
label: qsTr("server-info") label: qsTr("server-info")
field: Column { field: Column {

View File

@ -45,23 +45,15 @@ ColumnLayout {
ChatOverlay { //0 ChatOverlay { //0
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
} }
erinn marked this conversation as resolved Outdated
Outdated
Review

if we don't need them then we should delete?

if we don't need them then we should delete?
ListOverlay{ //1 ListOverlay{ //1
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
} }
BulletinOverlay{ //2 BulletinOverlay{ //2
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
} }
MembershipOverlay { //3 MembershipOverlay { //3
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
} }
} }

View File

@ -365,7 +365,6 @@ Opaque.Flickable {
Opaque.Button { // ADD or SAVE button Opaque.Button { // ADD or SAVE button
//height: Theme.primaryTextSize * 1.5
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
erinn marked this conversation as resolved Outdated
Outdated
Review

switch to new textSize?

switch to new textSize?
Outdated
Review

it calculates its own height

it calculates its own height

View File

@ -35,16 +35,10 @@ ColumnLayout {
} }
RowLayout { RowLayout {
//width: 700 * gcd.themeScale
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
erinn marked this conversation as resolved Outdated
Outdated
Review

I think this did need a min size of some kind?

I think this did need a min size of some kind?
Outdated
Review

maybe an android thing?

maybe an android thing?
Opaque.UnderlineTextField { Opaque.UnderlineTextField {
id: txtPassword id: txtPassword
//anchors.horizontalCenter: parent.horizontalCenter
//Layout.fillWidth: true
//Layout.maximumWidth: 450 * gcd.themeScale
//Layout.minimumWidth: 450 * gcd.themeScale
Layout.rightMargin: 40 Layout.rightMargin: 40
Layout.leftMargin: 40 Layout.leftMargin: 40
placeholderText: qsTr("password") placeholderText: qsTr("password")

View File

@ -53,7 +53,7 @@ Opaque.SettingsList { // Add Profile Pane
checked: serverAddEditPane.server_available checked: serverAddEditPane.server_available
onCheckedChanged: function() { onCheckedChanged: function() {
//serverAddEditPane.server_available = !serverAddEditPane.server_available serverAddEditPane.server_available = checked
erinn marked this conversation as resolved Outdated
Outdated
Review

uncomment

uncomment
if (serverAddEditPane.server_available) { if (serverAddEditPane.server_available) {
gcd.startServer(serverAddEditPane.server_name) gcd.startServer(serverAddEditPane.server_name)
} else { } else {
@ -63,12 +63,6 @@ Opaque.SettingsList { // Add Profile Pane
} }
} }
Opaque.Setting { Opaque.Setting {
label: qsTr("server-autostart") label: qsTr("server-autostart")
@ -77,7 +71,7 @@ Opaque.SettingsList { // Add Profile Pane
checked: serverAddEditPane.autostart_server checked: serverAddEditPane.autostart_server
onCheckedChanged: function() { onCheckedChanged: function() {
//serverAddEditPane.autostart_server = !serverAddEditPane.autostart_server serverAddEditPane.autostart_server = checked
gcd.autostartServer(serverAddEditPane.server_name, serverAddEditPane.autostart_server) gcd.autostartServer(serverAddEditPane.server_name, serverAddEditPane.autostart_server)
} }
} }

View File

@ -65,11 +65,6 @@ Opaque.SettingsList { // groupSettingsPane
onSupplyServerSettings: function(server, key_names, keys) { onSupplyServerSettings: function(server, key_names, keys) {
gsp.serverName = server; gsp.serverName = server;
toolbar.setTitle(qsTr("server-settings")); toolbar.setTitle(qsTr("server-settings"));
// console.log("Servers: " + key_names);
// for (let i=0; i<key_names.length;i++) {
// // TODO: Actually do something with these keys
// console.log("FOUND SERVER KEY " + key_names[i] + " " + keys[i]);
// }
} }
erinn marked this conversation as resolved Outdated
Outdated
Review

delete :)

delete :)
} }

View File

@ -119,7 +119,7 @@ Rectangle {
color: Theme.messageFromOtherTextColor color: Theme.messageFromOtherTextColor
elide: Text.ElideRight multiline: false
width: parent.width - leftPadding - rightPadding // padding width: parent.width - leftPadding - rightPadding // padding
size: Theme.chatSize size: Theme.chatSize
bold: true bold: true
@ -134,14 +134,12 @@ Rectangle {
width: Math.max(lbl.width, ts.width + ack.width + 10) width: Math.max(lbl.width, ts.width + ack.width + 10)
anchors.top: fromMe ? parent.top : (calendarEvent ? parent.top : handle.bottom) anchors.top: fromMe ? parent.top : (calendarEvent ? parent.top : handle.bottom)
anchors.topMargin: 10 * gcd.themeScale
TextEdit { // this is used as a helper to calculate the message box width TextEdit { // this is used as a helper to calculate the message box width
id: dummy id: dummy
visible: false visible: false
padding: 6 * gcd.themeScale padding: Theme.paddingSmall
leftPadding: 10 * gcd.themeScale font.pointSize: lbl.font.pointSize
font.pixelSize: gcd.themeScale * Theme.chatSize
wrapMode: TextEdit.NoWrap wrapMode: TextEdit.NoWrap
text: lbl.text text: lbl.text
textFormat: Text.RichText textFormat: Text.RichText
@ -152,7 +150,6 @@ Rectangle {
text: parse(message, Theme.uiEmojiSize, true) text: parse(message, Theme.uiEmojiSize, true)
color: fromMe ? Theme.messageFromMeTextColor : Theme.messageFromOtherTextColor color: fromMe ? Theme.messageFromMeTextColor : Theme.messageFromOtherTextColor
padding: Theme.paddingSmall padding: Theme.paddingSmall
leftPadding: Theme.paddingStandard
font.pointSize: Theme.textSmallPt font.pointSize: Theme.textSmallPt
selectByMouse: gcd.os != "android" selectByMouse: gcd.os != "android"
readOnly: true readOnly: true

View File

@ -15,6 +15,7 @@ import "../const"
Item { Item {
id: root id: root
Layout.fillWidth: true Layout.fillWidth: true
width: parent.width
property bool online: false property bool online: false
property int state: Const.state_disconnected property int state: Const.state_disconnected

View File

@ -104,10 +104,6 @@ RowLayout {
hilightBackgroundColor: Theme.backgroundHilightElementColor hilightBackgroundColor: Theme.backgroundHilightElementColor
iconColor: Theme.altTextColor iconColor: Theme.altTextColor
//anchors.verticalCenter: parent.verticalCenter
// Layout.alignment: Qt.AlignVCenter
height: root.height / 2 height: root.height / 2
erinn marked this conversation as resolved Outdated
Outdated
Review

delete?

delete?
width: root.height / 2 width: root.height / 2
size: root.height / 2 size: root.height / 2

View File

@ -63,10 +63,6 @@ ColumnLayout {
_messages: messages _messages: messages
}) })
} }
// onResetServerList: function() {
// serversModel.clear()
// }
} }
erinn marked this conversation as resolved Outdated
Outdated
Review

uncomment?

uncomment?
Outdated
Review

never gets called

never gets called
ListModel { // Profile OBJECTS ARE STORED HERE ... ListModel { // Profile OBJECTS ARE STORED HERE ...