1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Handle all the widgets that use GetRect

This commit is contained in:
Sean Smith
2019-08-24 23:19:46 -04:00
parent 264f49fd2c
commit 51e4325f0b
7 changed files with 42 additions and 19 deletions

View File

@@ -71,6 +71,10 @@ func (widget *Widget) HelpText() string {
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) display() {
widget.RedrawFunc(widget.content)
}
func (widget *Widget) content() (string, string, bool) {
title := fmt.Sprintf("[green]%s[white]", widget.CurrentSource())
_, _, width, _ := widget.View.GetRect()
@@ -82,7 +86,7 @@ func (widget *Widget) display() {
text += widget.plainText()
}
widget.Redraw(title, text, widget.settings.wrapText)
return title, text, widget.settings.wrapText
}
func (widget *Widget) fileName() string {