diff --git a/panemodel.go b/panemodel.go index c4838ab..e60ba96 100644 --- a/panemodel.go +++ b/panemodel.go @@ -7,6 +7,7 @@ import ( // Model Roles const ( PaneName = int(core.Qt__UserRole) + 1< width ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff + ScrollBar.vertical.policy: ScrollBar.AlwaysOff + contentWidth: Math.max(maingrid.implicitWidth, width) - Repeater { - model: accountBridge.panes - MessagePane { - Layout.row: 0 - Layout.column: index + GridLayout { + id: maingrid + // columns: accountBridge.panes.length + rows: 1 + anchors.fill: parent + anchors.margins: 0 + columnSpacing: 0 + rowSpacing: 0 - idx: index - name: model.panename - messageModel: model.msgmodel + Repeater { + model: accountBridge.panes + MessagePane { + Layout.row: 0 + Layout.column: index + + idx: index + name: model.panename + sticky: model.panesticky + messageModel: model.msgmodel + } } } } diff --git a/telephant.go b/telephant.go index ed4d89a..2d3f985 100644 --- a/telephant.go +++ b/telephant.go @@ -244,18 +244,21 @@ func runApp(config Config) { // setupMastodon starts a new Mastodon client and sets up event handling & models for it func setupMastodon(config Account) { tc = mastodon.NewAccount(config.Instance, config.Token, config.ClientID, config.ClientSecret) - postModel := NewMessageModel(nil) + + // Notifications model must the first model to be added + // It will always be displayed right-most { var pane = NewPane(nil) - pane.Name = "Messages" - pane.Model = postModel + pane.Name = "Notifications" + pane.Sticky = true + pane.Model = notificationModel paneModel.AddPane(pane) } { var pane = NewPane(nil) - pane.Name = "Notifications" - pane.Model = notificationModel + pane.Name = "Messages" + pane.Model = postModel paneModel.AddPane(pane) } accountBridge.SetPanes(paneModel)