mirror of
https://github.com/muesli/telephant
synced 2024-11-25 21:00:17 +00:00
Clean up QML
This commit is contained in:
parent
e4e44d0dba
commit
d4b0e90a87
3 changed files with 8 additions and 5 deletions
|
@ -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())
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue