Clean up QML

This commit is contained in:
Christian Muehlhaeuser 2020-02-28 03:01:06 +01:00
parent e4e44d0dba
commit d4b0e90a87
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E
3 changed files with 8 additions and 5 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"fmt"
"time"
humanize "github.com/dustin/go-humanize"
@ -9,7 +10,7 @@ import (
// maxMessageCount defines the max amount of messages stored in a model
const (
maxMessageCount = 150
maxMessageCount = 80
)
// Model Roles
@ -314,6 +315,7 @@ func (m *MessageModel) removeMessageID(id string) {
}
func (m *MessageModel) updateMessageTime() {
fmt.Println("Updating timelines...")
if len(m.Messages()) > 0 {
var fIndex = m.Index(0, 0, core.NewQModelIndex())
var lIndex = m.Index(len(m.Messages())-1, 0, core.NewQModelIndex())

View file

@ -4,10 +4,10 @@ import QtQuick.Controls.Material 2.1
import QtQuick.Layouts 1.3
Popup {
property var message
id: popup
property var message
modal: true
focus: true
height: Math.min(mainWindow.height * 0.8, layout.implicitHeight + 32)
@ -134,11 +134,13 @@ Popup {
onClicked: {
popup.close()
var msg = messageArea.text
var msgid = "";
var msgid = ""
if (message != null) {
msgid = message.messageid
msg = "@" + message.author + " " + msg
}
uiBridge.postButton(msgid, msg)
messageArea.clear()
}

View file

@ -13,7 +13,6 @@ TextEdit
selectionColor: Material.accent
MouseArea {
id: ma1
anchors.fill: parent
// we don't want to eat clicks on the Label
acceptedButtons: Qt.RightButton