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

Make every widget a keyboard widget

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2020-11-26 02:10:21 -08:00
parent 2430fe9f56
commit 4a820dd0e5
112 changed files with 225 additions and 401 deletions

View File

@@ -9,7 +9,6 @@ import (
)
type Widget struct {
view.KeyboardWidget
view.MultiSourceWidget
view.TextWidget
@@ -20,15 +19,13 @@ type Widget struct {
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
widget := Widget{
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "applicationID", "applicationIDs"),
TextWidget: view.NewTextWidget(app, settings.common),
TextWidget: view.NewTextWidget(app, pages, settings.common),
settings: settings,
}
widget.initializeKeyboardControls()
widget.View.SetInputCapture(widget.InputCapture)
for _, id := range utils.ToInts(widget.settings.applicationIDs) {
widget.Clients = append(widget.Clients, NewClient(widget.settings.apiKey, id))
@@ -53,10 +50,6 @@ func (widget *Widget) Refresh() {
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) HelpText() string {
return widget.KeyboardWidget.HelpText()
}
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) currentData() *Client2 {