Merge branch 'ebf' of cwtch.im/ui into master
This commit is contained in:
commit
c7c464e21e
|
@ -179,7 +179,6 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
|
|||
|
||||
|
||||
if len(handle) == 32 { // LOAD GROUP
|
||||
log.Debugf("LOADING GROUP %s", handle)
|
||||
group := the.Peer.GetGroup(handle)
|
||||
tl := group.GetTimeline()
|
||||
nick, _ := group.GetAttribute("nick")
|
||||
|
@ -188,7 +187,7 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
|
|||
} else {
|
||||
this.SetToolbarTitle(nick)
|
||||
}
|
||||
log.Debugf("messages: %d", len(tl))
|
||||
|
||||
for i := len(tl) - 1; i >= 0; i-- {
|
||||
if tl[i].PeerID == the.Peer.GetProfile().Onion {
|
||||
handle = "me"
|
||||
|
|
10
qml/main.qml
10
qml/main.qml
|
@ -55,9 +55,13 @@ ApplicationWindow {
|
|||
return newtext
|
||||
}
|
||||
|
||||
function scale() {
|
||||
return 0.1 + 2 * zoomSlider.value
|
||||
}
|
||||
function ptToPx(pt) {
|
||||
return Screen.pixelDensity * 25.4 * pt / 72
|
||||
}
|
||||
|
||||
function pxToPt(px) {
|
||||
return px * 72 / (Screen.pixelDensity * 25.4)
|
||||
}
|
||||
|
||||
|
||||
/* Rectangle { // THE TOOLBAR
|
||||
|
|
|
@ -10,17 +10,32 @@ import "../widgets"
|
|||
import "../styles"
|
||||
|
||||
ColumnLayout { // settingsPane
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
StackToolbar {
|
||||
id: stb
|
||||
text: qsTr("create-group-title")
|
||||
aux.visible: false
|
||||
membership.visible: false
|
||||
}
|
||||
|
||||
Flickable {
|
||||
anchors.top: stb.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip:true
|
||||
contentWidth: tehcol.width
|
||||
contentHeight: tehcol.height
|
||||
|
||||
Column {
|
||||
id: tehcol
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
width: root.width
|
||||
|
||||
ScalingLabel {
|
||||
//: Server label
|
||||
|
@ -29,7 +44,7 @@ ColumnLayout { // settingsPane
|
|||
|
||||
TextField {
|
||||
id: txtServer
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
text: "2c3kmoobnyghj2zw6pwv7d57yzld753auo3ugauezzpvfak3ahc4bdyd"
|
||||
}
|
||||
|
||||
|
@ -40,7 +55,7 @@ ColumnLayout { // settingsPane
|
|||
|
||||
TextField {
|
||||
id: txtGroupName
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
//: default suggested group name
|
||||
text: qsTr("default-group-name")
|
||||
}
|
||||
|
@ -55,4 +70,5 @@ ColumnLayout { // settingsPane
|
|||
}
|
||||
|
||||
}//end of column with padding
|
||||
}//end of flickable
|
||||
}
|
|
@ -22,7 +22,19 @@ ColumnLayout { // groupSettingsPane
|
|||
back.onClicked: theStack.pane = theStack.messagePane
|
||||
}
|
||||
|
||||
Flickable {
|
||||
anchors.top: toolbar.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip:true
|
||||
contentWidth: tehcol.width
|
||||
contentHeight: tehcol.height
|
||||
|
||||
Column {
|
||||
id: tehcol
|
||||
width: gsp.width
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
|
||||
|
@ -32,7 +44,7 @@ ColumnLayout { // groupSettingsPane
|
|||
|
||||
TextField {
|
||||
id: txtServer
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
|
@ -53,7 +65,7 @@ ColumnLayout { // groupSettingsPane
|
|||
|
||||
TextField {
|
||||
id: txtInvitation
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
|
@ -74,7 +86,7 @@ ColumnLayout { // groupSettingsPane
|
|||
|
||||
TextField {
|
||||
id: txtGroupName
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
}
|
||||
|
||||
SimpleButton {
|
||||
|
@ -117,6 +129,7 @@ ColumnLayout { // groupSettingsPane
|
|||
}
|
||||
|
||||
}//end of column with padding
|
||||
}//end of flickable
|
||||
|
||||
Connections {
|
||||
target: gcd
|
||||
|
|
|
@ -10,6 +10,7 @@ import "../widgets"
|
|||
import "../styles"
|
||||
|
||||
ColumnLayout { // peerSettingsPane
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
|
@ -21,7 +22,19 @@ ColumnLayout { // peerSettingsPane
|
|||
back.onClicked: theStack.pane = theStack.messagePane
|
||||
}
|
||||
|
||||
Flickable {
|
||||
anchors.top: toolbar.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip:true
|
||||
contentWidth: tehcol.width
|
||||
contentHeight: tehcol.height
|
||||
|
||||
Column {
|
||||
id: tehcol
|
||||
width: root.width
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
|
||||
|
@ -31,7 +44,7 @@ ColumnLayout { // peerSettingsPane
|
|||
|
||||
TextField {
|
||||
id: txtOnion
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
|
@ -53,7 +66,7 @@ ColumnLayout { // peerSettingsPane
|
|||
|
||||
TextField {
|
||||
id: txtDisplayName
|
||||
style: CwtchTextFieldStyle{ width: 400 }
|
||||
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
||||
}
|
||||
|
||||
SimpleButton {
|
||||
|
@ -77,6 +90,7 @@ ColumnLayout { // peerSettingsPane
|
|||
}
|
||||
|
||||
}//end of column with padding
|
||||
}//end of flickable
|
||||
|
||||
|
||||
Connections {
|
||||
|
|
|
@ -10,26 +10,45 @@ import "../widgets"
|
|||
import "../widgets/controls"
|
||||
|
||||
ColumnLayout { // settingsPane
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
StackToolbar {
|
||||
id: stb
|
||||
//: Cwtch Settings title
|
||||
text: qsTr("cwtch-settings-title")
|
||||
aux.visible: false
|
||||
membership.visible: false
|
||||
}
|
||||
|
||||
Flickable {
|
||||
anchors.top: stb.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip:true
|
||||
contentWidth: tehcol.width
|
||||
contentHeight: tehcol.height
|
||||
|
||||
|
||||
Column {
|
||||
id: tehcol
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
width: root.width
|
||||
|
||||
ScalingLabel {
|
||||
width: parent.width
|
||||
wrapMode: TextEdit.Wrap
|
||||
//: Version: %1 Built on: %2
|
||||
text: qsTr("version %1 builddate %2").arg(gcd.version).arg(gcd.buildDate)
|
||||
}
|
||||
|
||||
ScalingLabel {
|
||||
Layout.maximumWidth: parent.width
|
||||
width: parent.width
|
||||
wrapMode: TextEdit.Wrap
|
||||
//: Interface zoom (mostly affects text and button sizes)
|
||||
text: qsTr("zoom-label") + ":"
|
||||
}
|
||||
|
@ -48,13 +67,16 @@ ColumnLayout { // settingsPane
|
|||
}
|
||||
|
||||
ScalingLabel {
|
||||
wrapMode: TextEdit.Wrap
|
||||
text: qsTr("large-text-label")
|
||||
size: 20
|
||||
}
|
||||
|
||||
ScalingLabel{
|
||||
width: parent.width
|
||||
wrapMode: TextEdit.Wrap
|
||||
//: "Default size text (scale factor: "
|
||||
text: qsTr("default-scaling-text") + zoomSlider.value + ")"
|
||||
text: qsTr("default-scaling-text") + " " + Math.round(zoomSlider.value * 100) / 100 + ")"
|
||||
}
|
||||
|
||||
ScalingLabel {
|
||||
|
@ -90,6 +112,7 @@ ColumnLayout { // settingsPane
|
|||
}
|
||||
|
||||
}//end of column with padding
|
||||
}//end of flickable
|
||||
|
||||
function saveSettings() {
|
||||
// language switcher saves itself because erinn is a bad (read: amazing) programmer
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick 2.7
|
||||
|
||||
|
||||
TextFieldStyle {
|
||||
id: root
|
||||
textColor: "black"
|
||||
font.pointSize: 10
|
||||
font.pointSize: 10 * gcd.themeScale
|
||||
property int width: 100
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
implicitWidth: root.width
|
||||
implicitHeight: 24
|
||||
implicitHeight: ptToPx(10 * gcd.themeScale)
|
||||
color: windowItem.cwtch_background_color
|
||||
border.color: windowItem.cwtch_color
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import CustomQmlTypes 1.0
|
|||
|
||||
Item {
|
||||
id: imgProfile
|
||||
implicitWidth: 48
|
||||
implicitHeight: 48
|
||||
implicitWidth: baseWidth
|
||||
implicitHeight: baseWidth
|
||||
anchors.margins: 5
|
||||
|
||||
property string handle
|
||||
|
@ -17,17 +17,18 @@ Item {
|
|||
property bool isGroup
|
||||
property bool showStatus
|
||||
property bool highlight
|
||||
property int baseWidth: 48 * gcd.themeScale
|
||||
|
||||
Rectangle {
|
||||
id: mainImage
|
||||
width: 48
|
||||
height: 48
|
||||
width: baseWidth
|
||||
height: baseWidth
|
||||
color: highlight ? windowItem.cwtch_dark_color: "#FFFFFF"
|
||||
radius: width / 2
|
||||
|
||||
Rectangle {
|
||||
width: highlight ? 44 : 48
|
||||
height: highlight ? 44 : 48
|
||||
width: highlight ? baseWidth - 4 : baseWidth
|
||||
height: highlight ? baseWidth - 4 : baseWidth
|
||||
color: "#FFFFFF"
|
||||
radius: width / 2
|
||||
anchors.centerIn:parent
|
||||
|
@ -58,22 +59,22 @@ Item {
|
|||
Rectangle { // PRESENCE INDICATOR
|
||||
visible: showStatus
|
||||
color: "#FFFFFF"
|
||||
width: 8
|
||||
height: 8
|
||||
radius: 2
|
||||
width: 8 * gcd.themeScale
|
||||
height: 8 * gcd.themeScale
|
||||
radius: 2 * gcd.themeScale
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: 4
|
||||
anchors.margins: 4 * gcd.themeScale
|
||||
|
||||
|
||||
Rectangle { //-2:WtfCodeError,-1:Untrusted,0:Disconnected,1:Connecting,2:Connected,3:Authenticated,4:Failed,5:Killed
|
||||
color: status == 3 ? "green" : status == -1 ? "blue" : status == 1 ? "orange" : status == 2 ? "orange" : "red"
|
||||
width: 5
|
||||
height: 5
|
||||
radius: 2
|
||||
width: 5 * gcd.themeScale
|
||||
height: 5 * gcd.themeScale
|
||||
radius: 2 * gcd.themeScale
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: 1.5
|
||||
anchors.margins: 1.5 * gcd.themeScale
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@ import QtQuick.Controls.Material 2.0
|
|||
import QtQuick.Layouts 1.3
|
||||
import CustomQmlTypes 1.0
|
||||
|
||||
RowLayout { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
|
||||
Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
visible: !deleted
|
||||
height: 48 * gcd.themeScale + 3
|
||||
implicitHeight: height
|
||||
|
||||
property alias displayName: cn.text
|
||||
property alias image: imgProfile.source
|
||||
|
@ -24,61 +26,60 @@ RowLayout { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
|
|||
|
||||
|
||||
Rectangle { // CONTACT ENTRY BACKGROUND COLOR
|
||||
id: root
|
||||
id: crRect
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: childrenRect.height + 3
|
||||
height: 48 * gcd.themeScale + 3
|
||||
width: parent.width
|
||||
color: background ? (isHover ? "#D2D2F3" : (isActive ? "#D2D2F3" : "#D2C0DD")) : windowItem.cwtch_background_color
|
||||
|
||||
ContactPicture {
|
||||
id: imgProfile
|
||||
showStatus: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Label { // CONTACT NAME
|
||||
id: cn
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
//wrapMode: Text.WordWrap
|
||||
anchors.left: imgProfile.right
|
||||
anchors.right: rectUnread.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 16 * gcd.themeScale
|
||||
font.italic: !trusted
|
||||
textFormat: Text.PlainText
|
||||
//fontSizeMode: Text.HorizontalFit
|
||||
elide: Text.ElideRight
|
||||
color: "#000000"
|
||||
}
|
||||
|
||||
Rectangle { // UNREAD MESSAGES?
|
||||
id: rectUnread
|
||||
height: txtmetric.tightBoundingRect.height + 8 * gcd.themeScale
|
||||
width: txtmetric.tightBoundingRect.width + 8 * gcd.themeScale
|
||||
radius: 8 * gcd.themeScale
|
||||
color: "#4B3557"
|
||||
visible: badge != 0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 9 * gcd.themeScale
|
||||
|
||||
ContactPicture {
|
||||
id: imgProfile
|
||||
showStatus: true
|
||||
}
|
||||
Label {
|
||||
id: lblUnread
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: "#FFFFFF"
|
||||
font.pixelSize: 12 * gcd.themeScale
|
||||
text: txtmetric.text
|
||||
}
|
||||
|
||||
Label { // CONTACT NAME
|
||||
id: cn
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
//wrapMode: Text.WordWrap
|
||||
anchors.left: imgProfile.right
|
||||
anchors.right: rectUnread.left
|
||||
font.pixelSize: 16
|
||||
font.italic: !trusted
|
||||
textFormat: Text.PlainText
|
||||
//fontSizeMode: Text.HorizontalFit
|
||||
elide: Text.ElideRight
|
||||
color: "#000000"
|
||||
}
|
||||
|
||||
Rectangle { // UNREAD MESSAGES?
|
||||
id: rectUnread
|
||||
anchors.right: parent.right
|
||||
height: 16
|
||||
width: lblUnread.width + 10
|
||||
radius: 8
|
||||
color: "#4B3557"
|
||||
visible: badge != 0
|
||||
anchors.rightMargin: 9
|
||||
|
||||
|
||||
Label {
|
||||
id: lblUnread
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: "#FFFFFF"
|
||||
font.pixelSize: 12
|
||||
text: badge
|
||||
}
|
||||
}
|
||||
}
|
||||
TextMetrics {
|
||||
id: txtmetric
|
||||
text: badge
|
||||
font: lblUnread.font
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea { // ONCLICK: LOAD CONVERSATION WITH THIS CONTACT
|
||||
|
|
|
@ -113,7 +113,7 @@ RowLayout {
|
|||
padding: 6
|
||||
leftPadding: 10
|
||||
font.pixelSize: gcd.themeScale * 12
|
||||
selectByMouse: false
|
||||
selectByMouse: gcd.os != "android"
|
||||
readOnly: true
|
||||
width: Math.min(dummy.width, root.parent.width - (imgProfile.visible ? imgProfile.width : 0) - 40)
|
||||
wrapMode: TextEdit.Wrap
|
||||
|
@ -169,7 +169,7 @@ RowLayout {
|
|||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.fill: gcd.os == "android" ? parent : null
|
||||
|
||||
|
||||
onPressAndHold: {
|
||||
|
|
|
@ -144,13 +144,13 @@ ColumnLayout {
|
|||
}
|
||||
*/
|
||||
|
||||
ScalingLabel { // ONION ADDRESS
|
||||
Text { // ONION ADDRESS
|
||||
id: lblOnion
|
||||
//font.pixelSize: 6
|
||||
fontSizeMode: Text.HorizontalFit
|
||||
minimumPointSize: 2
|
||||
Layout.fillWidth: true
|
||||
padding: 3
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text:onion
|
||||
text: onion
|
||||
}
|
||||
|
||||
Row { // TOOLS FOR EDITING PROFILE
|
||||
|
|
Reference in New Issue