summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-02-19 10:40:45 -0600
committerSean E. Russell <ser@ser1.net>2020-02-19 10:40:45 -0600
commit66ad0f878540dee82ae2c2b5c561754b6480a157 (patch)
treea0db34b627902bff0a9d0b80715694fa75dbabe4 /layout
parent5e779839015531bd723d962755e477e85e13d081 (diff)
parent3db7c7480aa0b35fef4a737b16bdde6fd95f9d64 (diff)
Merge branch 'gauge' into v3.4.x
Diffstat (limited to 'layout')
-rw-r--r--layout/layout.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/layout/layout.go b/layout/layout.go
index 3fc3bb5..359b47e 100644
--- a/layout/layout.go
+++ b/layout/layout.go
@@ -59,6 +59,7 @@ func Layout(wl layout, c gotop.Config) (*MyGrid, error) {
// rows as the largest row span object in the row, and produce an uber-row
// containing all that stuff. It returns a slice without the consumed elements.
func processRow(c gotop.Config, numRows int, rowDefs [][]widgetRule) (ui.GridItem, [][]widgetRule) {
+ // FIXME: 3\:A 2\:B\nC should stop consuming rows when all columns are full
// Recursive function #3. See the comment in deepFindProc.
if len(rowDefs) < 1 {
return ui.GridItem{}, [][]widgetRule{}
@@ -190,6 +191,10 @@ func makeWidget(c gotop.Config, widRule widgetRule) interface{} {
i++
}
w = b
+ case "power":
+ b := widgets.NewBatteryGauge()
+ b.BarColor = ui.Color(c.Colorscheme.ProcCursor)
+ w = b
default:
log.Printf("Invalid widget name %s. Must be one of %v", widRule.Widget, widgetNames)
return ui.NewBlock()