mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Nowrap text on widget that don't need to wrap text
This commit is contained in:
parent
2f63a56eae
commit
da8220ff0d
@ -46,6 +46,7 @@ func (widget *Widget) addView() {
|
|||||||
view.SetBorder(true)
|
view.SetBorder(true)
|
||||||
view.SetDynamicColors(true)
|
view.SetDynamicColors(true)
|
||||||
view.SetTitle(widget.Name)
|
view.SetTitle(widget.Name)
|
||||||
|
view.SetWrap(false)
|
||||||
|
|
||||||
widget.View = view
|
widget.View = view
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ func NewWidget() *Widget {
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
Name: "Calendar",
|
Name: "Calendar",
|
||||||
RefreshedAt: time.Now(),
|
RefreshedAt: time.Now(),
|
||||||
RefreshInterval: 1800,
|
RefreshInterval: 60,
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.addView()
|
widget.addView()
|
||||||
@ -48,6 +48,7 @@ func (widget *Widget) addView() {
|
|||||||
view.SetBorder(true)
|
view.SetBorder(true)
|
||||||
view.SetDynamicColors(true)
|
view.SetDynamicColors(true)
|
||||||
view.SetTitle(widget.Name)
|
view.SetTitle(widget.Name)
|
||||||
|
view.SetWrap(false)
|
||||||
|
|
||||||
widget.View = view
|
widget.View = view
|
||||||
}
|
}
|
||||||
|
@ -6,20 +6,21 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
|
"github.com/senorprogrammer/wtf/wtf"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
Name string
|
wtf.BaseWidget
|
||||||
RefreshedAt time.Time
|
|
||||||
RefreshInterval int
|
|
||||||
View *tview.TextView
|
View *tview.TextView
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWidget() *Widget {
|
func NewWidget() *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
|
BaseWidget: wtf.BaseWidget{
|
||||||
Name: "Status",
|
Name: "Status",
|
||||||
RefreshedAt: time.Now(),
|
RefreshedAt: time.Now(),
|
||||||
RefreshInterval: 1,
|
RefreshInterval: 1,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.addView()
|
widget.addView()
|
||||||
|
2
wtf.go
2
wtf.go
@ -39,7 +39,7 @@ func main() {
|
|||||||
weather.Refresh()
|
weather.Refresh()
|
||||||
|
|
||||||
grid := tview.NewGrid()
|
grid := tview.NewGrid()
|
||||||
grid.SetRows(14, 36, 4) // How _high_ the row is, in terminal rows
|
grid.SetRows(18, 32, 4) // How _high_ the row is, in terminal rows
|
||||||
grid.SetColumns(40, 40) // How _wide_ the column is, in terminal columns
|
grid.SetColumns(40, 40) // How _wide_ the column is, in terminal columns
|
||||||
grid.SetBorder(false)
|
grid.SetBorder(false)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user