forked from cwtch.im/ui
fix ui scaler. fix font colours on kde. fix p2p settings crash.
This commit is contained in:
parent
ae7e3e5c4e
commit
f5c8a44423
|
@ -3,3 +3,4 @@ deploy
|
||||||
moc*
|
moc*
|
||||||
rcc*
|
rcc*
|
||||||
*.qmlc
|
*.qmlc
|
||||||
|
*.jsc
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"encoding/base32"
|
"encoding/base32"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
"log"
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -110,9 +110,9 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) {
|
||||||
this.UIState.UpdateContact(handle)
|
this.UIState.UpdateContact(handle)
|
||||||
|
|
||||||
if len(handle) == 32 { // LOAD GROUP
|
if len(handle) == 32 { // LOAD GROUP
|
||||||
log.Printf("LOADING GROUP %s", handle)
|
log.Debugf("LOADING GROUP %s", handle)
|
||||||
tl := the.Peer.GetGroup(handle).GetTimeline()
|
tl := the.Peer.GetGroup(handle).GetTimeline()
|
||||||
log.Printf("messages: %d", len(tl))
|
log.Debugf("messages: %d", len(tl))
|
||||||
for i := range tl {
|
for i := range tl {
|
||||||
if tl[i].PeerID == the.Peer.GetProfile().Onion {
|
if tl[i].PeerID == the.Peer.GetProfile().Onion {
|
||||||
handle = "me"
|
handle = "me"
|
||||||
|
@ -159,8 +159,14 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) requestGroupSettings() {
|
func (this *GrandCentralDispatcher) requestGroupSettings() {
|
||||||
log.Printf("requestGroupSettings()")
|
log.Debugf("requestGroupSettings()")
|
||||||
group := the.Peer.GetGroup(this.CurrentOpenConversation())
|
group := the.Peer.GetGroup(this.CurrentOpenConversation())
|
||||||
|
|
||||||
|
if group == nil {
|
||||||
|
log.Errorf("requested group settings for a p2p contact")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
nick, _ := group.GetAttribute("nick")
|
nick, _ := group.GetAttribute("nick")
|
||||||
invite, _ := the.Peer.ExportGroup(this.CurrentOpenConversation())
|
invite, _ := the.Peer.ExportGroup(this.CurrentOpenConversation())
|
||||||
this.SupplyGroupSettings(nick, group.GroupServer, invite)
|
this.SupplyGroupSettings(nick, group.GroupServer, invite)
|
||||||
|
@ -169,7 +175,7 @@ func (this *GrandCentralDispatcher) requestGroupSettings() {
|
||||||
func (this *GrandCentralDispatcher) broadcast(signal string) {
|
func (this *GrandCentralDispatcher) broadcast(signal string) {
|
||||||
switch signal {
|
switch signal {
|
||||||
default:
|
default:
|
||||||
log.Printf("unhandled broadcast signal: %v", signal)
|
log.Debugf("unhandled broadcast signal: %v", signal)
|
||||||
case "ResetMessagePane":
|
case "ResetMessagePane":
|
||||||
this.ResetMessagePane()
|
this.ResetMessagePane()
|
||||||
}
|
}
|
||||||
|
@ -177,11 +183,11 @@ func (this *GrandCentralDispatcher) broadcast(signal string) {
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) importString(str string) {
|
func (this *GrandCentralDispatcher) importString(str string) {
|
||||||
if len(str) < 5 {
|
if len(str) < 5 {
|
||||||
log.Printf("ignoring short string")
|
log.Debugf("ignoring short string")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("importing: %s\n", str)
|
log.Debugf("importing: %s\n", str)
|
||||||
onion := str
|
onion := str
|
||||||
name := onion
|
name := onion
|
||||||
str = strings.TrimSpace(str)
|
str = strings.TrimSpace(str)
|
||||||
|
@ -239,7 +245,7 @@ func (this *GrandCentralDispatcher) importString(str string) {
|
||||||
|
|
||||||
_, err := base32.StdEncoding.DecodeString(strings.ToUpper(onion[:56]))
|
_, err := base32.StdEncoding.DecodeString(strings.ToUpper(onion[:56]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%v", err)
|
log.Errorf("%v", err)
|
||||||
this.InvokePopup("bad format. missing characters?")
|
this.InvokePopup("bad format. missing characters?")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -25,6 +25,9 @@ ColumnLayout { // settingsPane
|
||||||
id: zoomSlider
|
id: zoomSlider
|
||||||
from: 0.5
|
from: 0.5
|
||||||
to: 2.4
|
to: 2.4
|
||||||
|
onValueChanged: {
|
||||||
|
gcd.themeScale = zoomSlider.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScalingLabel {
|
ScalingLabel {
|
||||||
|
|
|
@ -52,6 +52,7 @@ RowLayout { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
//fontSizeMode: Text.HorizontalFit
|
//fontSizeMode: Text.HorizontalFit
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
color: "#000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle { // UNREAD MESSAGES?
|
Rectangle { // UNREAD MESSAGES?
|
||||||
|
|
|
@ -138,9 +138,9 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { // ONION ADDRESS
|
ScalingLabel { // ONION ADDRESS
|
||||||
id: lblOnion
|
id: lblOnion
|
||||||
font.pixelSize: 6
|
//font.pixelSize: 6
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
padding: 3
|
padding: 3
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
Binary file not shown.
|
@ -9,6 +9,7 @@ import QtQuick.Window 2.11
|
||||||
Label {
|
Label {
|
||||||
font.pixelSize: gcd.themeScale * size
|
font.pixelSize: gcd.themeScale * size
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
color: "#000000"
|
||||||
|
|
||||||
property real size: 12
|
property real size: 12
|
||||||
}
|
}
|
Binary file not shown.
Loading…
Reference in New Issue