mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Re-add command line help
This commit is contained in:
@@ -112,6 +112,10 @@ func (widget *BarGraph) TextView() *tview.TextView {
|
||||
return widget.View
|
||||
}
|
||||
|
||||
func (widget *BarGraph) HelpText() string {
|
||||
return "No help available for this widget"
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *BarGraph) addView() *tview.TextView {
|
||||
|
||||
@@ -78,7 +78,7 @@ func (widget *KeyboardWidget) InputCapture(event *tcell.EventKey) *tcell.EventKe
|
||||
return event
|
||||
}
|
||||
|
||||
func (widget *KeyboardWidget) helpText() string {
|
||||
func (widget *KeyboardWidget) HelpText() string {
|
||||
|
||||
str := "Keyboard commands for " + widget.settings.Module.Type + "\n\n"
|
||||
|
||||
@@ -99,7 +99,7 @@ func (widget *KeyboardWidget) ShowHelp() {
|
||||
widget.app.SetFocus(widget.view)
|
||||
}
|
||||
|
||||
modal := NewBillboardModal(widget.helpText(), closeFunc)
|
||||
modal := NewBillboardModal(widget.HelpText(), closeFunc)
|
||||
|
||||
widget.pages.AddPage("help", modal, false, true)
|
||||
widget.app.SetFocus(modal)
|
||||
|
||||
@@ -119,6 +119,10 @@ func (widget *TextWidget) Redraw(title, text string, wrap bool) {
|
||||
})
|
||||
}
|
||||
|
||||
func (widget *TextWidget) HelpText() string {
|
||||
return fmt.Sprintf("\n There is no help available for this widget")
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *TextWidget) addView() *tview.TextView {
|
||||
|
||||
@@ -14,6 +14,7 @@ type Wtfable interface {
|
||||
Name() string
|
||||
SetFocusChar(string)
|
||||
TextView() *tview.TextView
|
||||
HelpText() string
|
||||
|
||||
Height() int
|
||||
Left() int
|
||||
|
||||
Reference in New Issue
Block a user