aboutsummaryrefslogtreecommitdiff
path: root/ui/messages/tstring
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-03-26 00:37:35 +0200
committerTulir Asokan <tulir@maunium.net>2019-03-26 00:37:35 +0200
commit8aa134b8b23cf945f5a18e21e5fa4855e188d3c0 (patch)
tree008f0f5e48688e752e1cb6279c4fa43bcfcc05cd /ui/messages/tstring
parentae36b9cddd1332fbf3ec3160ef4ad269619e445b (diff)
Start moving to mauview
Diffstat (limited to 'ui/messages/tstring')
-rw-r--r--ui/messages/tstring/cell.go3
-rw-r--r--ui/messages/tstring/string.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/ui/messages/tstring/cell.go b/ui/messages/tstring/cell.go
index aee1716..3ea7b5a 100644
--- a/ui/messages/tstring/cell.go
+++ b/ui/messages/tstring/cell.go
@@ -18,6 +18,7 @@ package tstring
import (
"github.com/mattn/go-runewidth"
+ "maunium.net/go/mauview"
"maunium.net/go/tcell"
)
@@ -43,7 +44,7 @@ func (cell Cell) RuneWidth() int {
return runewidth.RuneWidth(cell.Char)
}
-func (cell Cell) Draw(screen tcell.Screen, x, y int) (chWidth int) {
+func (cell Cell) Draw(screen mauview.Screen, x, y int) (chWidth int) {
chWidth = cell.RuneWidth()
for runeWidthOffset := 0; runeWidthOffset < chWidth; runeWidthOffset++ {
screen.SetContent(x+runeWidthOffset, y, cell.Char, nil, cell.Style)
diff --git a/ui/messages/tstring/string.go b/ui/messages/tstring/string.go
index 7feeda0..b14dc8e 100644
--- a/ui/messages/tstring/string.go
+++ b/ui/messages/tstring/string.go
@@ -21,6 +21,7 @@ import (
"unicode"
"github.com/mattn/go-runewidth"
+ "maunium.net/go/mauview"
"maunium.net/go/tcell"
)
@@ -181,7 +182,7 @@ func (str TString) AdjustStyleFull(fn func(tcell.Style) tcell.Style) {
str.AdjustStyle(0, len(str), fn)
}
-func (str TString) Draw(screen tcell.Screen, x, y int) {
+func (str TString) Draw(screen mauview.Screen, x, y int) {
offsetX := 0
for _, cell := range str {
offsetX += cell.Draw(screen, x+offsetX, y)