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:
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
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 "../opaque/styles"
import "../opaque/theme"
import "../widgets" as W
ColumnLayout {
id: listpanel
Layout.fillWidth: true
width: parent.width
id: listpanel
width:parent.width
// todo: margins don't seem to be getting applied to search/additem textboxes? not sure why
Layout.margins: Theme.paddingStandard
property bool online: false
Text {
Layout.fillWidth: true
}
Opaque.IconTextField {
id: filter
visible:listpanel.online
width: parent.width - 2 * Theme.paddingStandard
Item {
width: 1
height: Theme.paddingStandard
}
//: ex: "Find..."
placeholderText: qsTr("search-list")
horizontalAlignment: TextInput.AlignHCenter
icon: gcd.assetPath + "core/search-24px.webp"
Opaque.IconTextField {
id: filter
visible:listpanel.online
Layout.fillWidth: true
//: ex: "Find..."
placeholderText: qsTr("search-list")
horizontalAlignment: TextInput.AlignHCenter
icon: gcd.assetPath + "core/search-24px.webp"
onTextChanged: {
listView.filter = text
if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) {
listView.currentIndex = -1
}
}
}
onTextChanged: {
listView.filter = text
if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) {
listView.currentIndex = -1
}
}
}
Opaque.Icon {
visible:!listpanel.online
source: gcd.assetPath + "core/negative_heart_24px.webp"
iconColor: Theme.mainTextColor
backgroundColor: Theme.backgroundPaneColor
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
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")
// }
Opaque.Icon {
visible:!listpanel.online
source: gcd.assetPath + "core/negative_heart_24px.webp"
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
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
height: 150
width: 150
}
Opaque.Label {
visible:!listpanel.online
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
elide: Text.ElideRight
size: Theme.textMediumPt
text: qsTr("peer-not-online")
}
Flickable { // THE MESSAGE LIST ITSELF
id: sv
clip: true
visible:listpanel.online
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
contentWidth: parent.width
contentHeight: parent.height
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: 800
Flickable { // THE MESSAGE LIST ITSELF
id: sv
clip: true
visible:listpanel.online
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
contentWidth: parent.width
contentHeight: parent.height
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: 800
Connections {
@ -87,143 +94,138 @@ ColumnLayout {
}
}
Connections {
id: cnxns2
target: gcd
Connections {
id: cnxns2
target: gcd
onClearMessages: function() {
jsonModel4.clear()
}
onClearMessages: function() {
jsonModel4.clear()
}
onAppendMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) {
handler(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)
}
onPrependMessage: function(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) {
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
try {
msg = JSON.parse(message)
} catch (e) {
return
}
if (msg.o != 4) return
function handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) {
var msg
try {
msg = JSON.parse(message)
} catch (e) {
return
}
if (msg.o != 4) return
if (msg.t != undefined) {
jsonModel4.insert(0,{
"title":msg.t,
"selected":false,
"from": from,
"displayName": displayName,
"timestamp": ts,
"complete": false
})
}
if (msg.t != undefined) {
jsonModel4.insert(0,{
"title":msg.t,
"selected":false,
"from": from,
"displayName": displayName,
"timestamp": ts,
"complete": false
})
}
if(msg.c != undefined) {
jsonModel4.get(msg.c).complete = true
}
}
if(msg.c != undefined) {
jsonModel4.get(msg.c).complete = true
}
}
onUpdateContactStatus: function(_handle, _status, _loading) {
if (gcd.selectedConversation == _handle) {
onUpdateContactStatus: function(_handle, _status, _loading) {
if (gcd.selectedConversation == _handle) {
// Group is Synced OR p2p is Authenticated
if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) {
newlistitem.readOnly = false
listpanel.online = true
} else {
newlistitem.readOnly = true
listpanel.online= false
}
}
}
}
// Group is Synced OR p2p is Authenticated
if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) {
newlistitem.readOnly = false
listpanel.online = true
} else {
newlistitem.readOnly = true
listpanel.online= false
}
}
}
}
ScrollBar.vertical: ScrollBar{
policy: ScrollBar.AlwaysOn
}
ScrollBar.vertical: ScrollBar{
policy: ScrollBar.AlwaysOn
}
ListView {
id: listView
anchors.left: parent.left
anchors.leftMargin: 10
anchors.topMargin: 10
ListView {
id: listView
anchors.left: parent.left
anchors.leftMargin: 10
anchors.topMargin: 10
width: parent.width - 50
height: parent.height - 20
orientation: Qt.Vertical
spacing: 10
model: jsonModel4
property string filter: ""
delegate:
width: parent.width - 50
height: parent.height - 20
orientation: Qt.Vertical
spacing: 10
model: jsonModel4
property string filter: ""
delegate:
Item {
width: parent.width
height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0
visible: title.indexOf(listView.filter) >= 0
Item {
width: Listview.view.width
height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0
visible: title.indexOf(listView.filter) >= 0
Column {
width: parent.width
Column {
width: parent.width
RowLayout {
CheckBox {
checked: complete
onClicked: {
var msg = JSON.stringify({"o":4, "c":index})
gcd.sendMessage(msg, newlistitem.nextMessageID++)
}
}
RowLayout {
CheckBox {
checked: complete
onClicked: {
var msg = JSON.stringify({"o":4, "c":index})
gcd.sendMessage(msg, newlistitem.nextMessageID++)
}
}
RowLayout {
Text {
id: texttitle
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap")
leftPadding: 10
topPadding: 5
bottomPadding:5
color: Theme.mainTextColor
}
}
}
RowLayout {
Text {
id: texttitle
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap")
leftPadding: 10
topPadding: 5
bottomPadding:5
color: Theme.mainTextColor
}
}
}
Opaque.HLine{}
}
Opaque.HLine{}
}
}
}
focus: true
ListModel {
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{}
focus: true
ListModel {
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
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 {
property color backgroundColor: "red"//parent.color
inline: true
erinn marked this conversation as resolved Outdated
Outdated
Review

undebug :)

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

View File

@ -45,23 +45,15 @@ ColumnLayout {
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
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
}
BulletinOverlay{ //2
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
}
MembershipOverlay { //3
// Layout.maximumHeight: overlayStack.height
// Layout.maximumWidth: overlayStack.width
}
}

View File

@ -365,7 +365,6 @@ Opaque.Flickable {
Opaque.Button { // ADD or SAVE button
//height: Theme.primaryTextSize * 1.5
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 {
//width: 700 * gcd.themeScale
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 {
id: txtPassword
//anchors.horizontalCenter: parent.horizontalCenter
//Layout.fillWidth: true
//Layout.maximumWidth: 450 * gcd.themeScale
//Layout.minimumWidth: 450 * gcd.themeScale
Layout.rightMargin: 40
Layout.leftMargin: 40
placeholderText: qsTr("password")

View File

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

View File

@ -65,11 +65,6 @@ 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<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
elide: Text.ElideRight
multiline: false
width: parent.width - leftPadding - rightPadding // padding
size: Theme.chatSize
bold: true
@ -134,14 +134,12 @@ Rectangle {
width: Math.max(lbl.width, ts.width + ack.width + 10)
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
id: dummy
visible: false
padding: 6 * gcd.themeScale
leftPadding: 10 * gcd.themeScale
font.pixelSize: gcd.themeScale * Theme.chatSize
padding: Theme.paddingSmall
font.pointSize: lbl.font.pointSize
wrapMode: TextEdit.NoWrap
text: lbl.text
textFormat: Text.RichText
@ -152,7 +150,6 @@ Rectangle {
text: parse(message, Theme.uiEmojiSize, true)
color: fromMe ? Theme.messageFromMeTextColor : Theme.messageFromOtherTextColor
padding: Theme.paddingSmall
leftPadding: Theme.paddingStandard
font.pointSize: Theme.textSmallPt
selectByMouse: gcd.os != "android"
readOnly: true

View File

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

View File

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

delete?

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

View File

@ -63,10 +63,6 @@ ColumnLayout {
_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 ...