diff options
Diffstat (limited to 'toolkit/gocui/structs.go')
| -rw-r--r-- | toolkit/gocui/structs.go | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/toolkit/gocui/structs.go b/toolkit/gocui/structs.go index a772d8a..7972cfd 100644 --- a/toolkit/gocui/structs.go +++ b/toolkit/gocui/structs.go @@ -55,8 +55,8 @@ type config struct { TabPadW int `default:"4" dense:"0"` // how far down to start Window or Tab headings - WindowW int `default:"20" dense:"0"` - WindowH int `default:"0" dense:"0"` + WindowW int `default:"8" dense:"0"` + WindowH int `default:"-1"` TabW int `default:"2" dense:"0"` TabH int `default:"2" dense:"0"` @@ -118,10 +118,12 @@ type cuiWidget struct { vals []string // dropdown menu options - // visable bool // track if it's currently supposed to be shown + isCurrent bool // is this the currently displayed Window or Tab? + hasTabs bool // does the window have tabs? isFake bool // widget types like 'box' are 'false' // where the widget's real corner is + // should we always compute this? startW int startH int @@ -168,6 +170,25 @@ type cuiWidget struct { children []*cuiWidget } +func (w *cuiWidget) IsCurrent() bool { + if (w.widgetType == toolkit.Tab) { + return w.isCurrent + } + if (w.widgetType == toolkit.Window) { + return w.isCurrent + } + if (w.widgetType == toolkit.Root) { + return false + } + return w.parent.IsCurrent() +} + +func (w *cuiWidget) StartW() { +} + +func (w *cuiWidget) StartH() { +} + // from the gocui devs: // Write appends a byte slice into the view's internal buffer. Because // View implements the io.Writer interface, it can be passed as parameter |
