mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Rename TextViewer to Wtfable
This commit is contained in:
parent
b4520f1410
commit
d246cb4c4a
8
wtf.go
8
wtf.go
@ -55,7 +55,7 @@ func displayVersionInfo() {
|
||||
|
||||
/* -------------------- Functions -------------------- */
|
||||
|
||||
func addToGrid(grid *tview.Grid, widget wtf.TextViewer) {
|
||||
func addToGrid(grid *tview.Grid, widget wtf.Wtfable) {
|
||||
if widget.Disabled() {
|
||||
return
|
||||
}
|
||||
@ -73,7 +73,7 @@ func addToGrid(grid *tview.Grid, widget wtf.TextViewer) {
|
||||
}
|
||||
|
||||
// Grid stores all the widgets onscreen (like an HTML table)
|
||||
func buildGrid(modules []wtf.TextViewer) *tview.Grid {
|
||||
func buildGrid(modules []wtf.Wtfable) *tview.Grid {
|
||||
grid := tview.NewGrid()
|
||||
grid.SetColumns(wtf.ToInts(Config.UList("wtf.grid.columns"))...)
|
||||
grid.SetRows(wtf.ToInts(Config.UList("wtf.grid.rows"))...)
|
||||
@ -133,7 +133,7 @@ func refreshAllModules() {
|
||||
|
||||
var Config *config.Config
|
||||
var FocusTracker wtf.FocusTracker
|
||||
var Widgets []wtf.TextViewer
|
||||
var Widgets []wtf.Wtfable
|
||||
|
||||
var result = wtf.CreateConfigDir()
|
||||
|
||||
@ -182,7 +182,7 @@ func main() {
|
||||
weather.Config = Config
|
||||
wtf.Config = Config
|
||||
|
||||
Widgets = []wtf.TextViewer{
|
||||
Widgets = []wtf.Wtfable{
|
||||
bamboohr.NewWidget(),
|
||||
clocks.NewWidget(),
|
||||
gcal.NewWidget(),
|
||||
|
@ -17,7 +17,7 @@ const (
|
||||
type FocusTracker struct {
|
||||
App *tview.Application
|
||||
Idx int
|
||||
Widgets []TextViewer
|
||||
Widgets []Wtfable
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
@ -89,8 +89,8 @@ func (tracker *FocusTracker) focus(idx int) {
|
||||
view.SetBorderColor(ColorFor(Config.UString("wtf.colors.border.focused", "gray")))
|
||||
}
|
||||
|
||||
func (tracker *FocusTracker) focusables() []TextViewer {
|
||||
focusable := []TextViewer{}
|
||||
func (tracker *FocusTracker) focusables() []Wtfable {
|
||||
focusable := []Wtfable{}
|
||||
|
||||
for _, widget := range tracker.Widgets {
|
||||
if widget.Focusable() {
|
||||
@ -101,7 +101,7 @@ func (tracker *FocusTracker) focusables() []TextViewer {
|
||||
return focusable
|
||||
}
|
||||
|
||||
func (tracker *FocusTracker) focusableAt(idx int) TextViewer {
|
||||
func (tracker *FocusTracker) focusableAt(idx int) Wtfable {
|
||||
if idx < 0 || idx >= len(tracker.focusables()) {
|
||||
return nil
|
||||
}
|
||||
|
@ -4,8 +4,7 @@ import (
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
// TODO: I really need to come up with a better name for this now
|
||||
type TextViewer interface {
|
||||
type Wtfable interface {
|
||||
Enabler
|
||||
Scheduler
|
||||
|
Loading…
x
Reference in New Issue
Block a user