diff --git a/modules/digitalclock/display.go b/modules/digitalclock/display.go index 9db6ba3f..cbf7879d 100644 --- a/modules/digitalclock/display.go +++ b/modules/digitalclock/display.go @@ -20,7 +20,7 @@ func renderWidget(widgetSettings Settings) string { return mergeLines(outputStrings) } -func (widget *Widget) display(dateFormat string, timeFormat string) { +func (widget *Widget) display() { widget.Redraw(func() (string, string, bool) { return widget.CommonSettings().Title, renderWidget(*widget.settings), false }) diff --git a/modules/digitalclock/fonts.go b/modules/digitalclock/fonts.go index 52fa37b3..5aaf5e02 100644 --- a/modules/digitalclock/fonts.go +++ b/modules/digitalclock/fonts.go @@ -48,8 +48,6 @@ func getDigitalFont() ClockFont { "9": {"▄▀▀▄", "▀▄▄█", " ▄▄▀"}, "0": {"█▀▀█", "█ █", "█▄▄█"}, ":": {"█", " ", "█"}, - // "A": {" ", " ", "█▀█ █▀█▀█"}, - // "P": {" ", " ", "█▀ █▀█▀█"}, " ": {" ", " ", " "}, "A": {"", "", "AM"}, "P": {"", "", "PM"}, @@ -72,8 +70,6 @@ func getBigFont() ClockFont { "9": {"┏━━━┓", "┃┏━┓┃", "┃┗━┛┃", "┗━━┓┃", "┏━━┛┃", "┗━━━┛"}, "0": {"┏━━━┓", "┃┏━┓┃", "┃┃ ┃┃", "┃┃ ┃┃", "┃┗━┛┃", "┗━━━┛"}, ":": {" ", "┏━┓", "┗━┛", "┏━┓", "┗━┛", " "}, - // "A": {" ", " ", " ", "┏━━┓ ┏┓┏┓", "┃┏━┛ ┃┗┛┃", "┗┛ ┗┻┻┛"}, - // "P": {" ", " ", " ", "┏━━┓ ┏┓┏┓", "┃┏┓┃ ┃┗┛┃", "┗┛┗┛ ┗┻┻┛"}, " ": {" ", " ", " ", " ", " ", " "}, "A": {"", "", "", "", "", "AM"}, "P": {"", "", "", "", "", "PM"}, diff --git a/modules/digitalclock/widget.go b/modules/digitalclock/widget.go index c0974f62..49a50bad 100644 --- a/modules/digitalclock/widget.go +++ b/modules/digitalclock/widget.go @@ -5,15 +5,15 @@ import ( "github.com/wtfutil/wtf/view" ) +// Widget a text widget struct to hold info about the current widget type Widget struct { view.TextWidget - app *tview.Application - dateFormat string - timeFormat string - settings *Settings + app *tview.Application + settings *Settings } +// NewWidget creates a new widget using settings func NewWidget(app *tview.Application, settings *Settings) *Widget { widget := Widget{ @@ -31,7 +31,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget { // Refresh updates the onscreen contents of the widget func (widget *Widget) Refresh() { widget.app.QueueUpdateDraw(func() { - widget.display(widget.dateFormat, widget.timeFormat) + widget.display() }) }