[GH-ISSUE #239] Widget: Colored panel with text label #128

Closed
opened 2026-03-03 16:22:37 +03:00 by kerem · 3 comments
Owner

Originally created by @flaviostutz on GitHub (Jul 27, 2020).
Original GitHub issue: https://github.com/mum4k/termdash/issues/239

Originally assigned to: @mum4k on GitHub.

I wish I could create a panel with a colored background and a centered text.

Something like:
image

Originally created by @flaviostutz on GitHub (Jul 27, 2020). Original GitHub issue: https://github.com/mum4k/termdash/issues/239 Originally assigned to: @mum4k on GitHub. I wish I could create a panel with a colored background and a centered text. Something like: ![image](https://user-images.githubusercontent.com/7790172/88596962-9a167680-d03c-11ea-8a8e-5cc5ce26a13c.png)
kerem 2026-03-03 16:22:37 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@flaviostutz commented on GitHub (Jul 27, 2020):

In the example, the bar on the left of the square is a measurement bar that shows the CPU load percent.

<!-- gh-comment-id:664663916 --> @flaviostutz commented on GitHub (Jul 27, 2020): In the example, the bar on the left of the square is a measurement bar that shows the CPU load percent.
Author
Owner

@mum4k commented on GitHub (Jul 29, 2020):

Hi @flaviostutz, did you try to achieve this behavior with the Gauge widget?

https://godoc.org/github.com/mum4k/termdash/widgets/gauge

The Gauge widget allows text alignment with these two options, so one can center the text:
https://godoc.org/github.com/mum4k/termdash/widgets/gauge#HorizontalTextAlign
https://godoc.org/github.com/mum4k/termdash/widgets/gauge#VerticalTextAlign

Additionally one can choose both the colors of the "filled" and the "empty" portions of the gauge:
https://godoc.org/github.com/mum4k/termdash/widgets/gauge#EmptyTextColor
https://godoc.org/github.com/mum4k/termdash/widgets/gauge#FilledTextColor

Can you try to see how far you can get with these? Once we identify the missing feature, we can add it of course.

<!-- gh-comment-id:665389241 --> @mum4k commented on GitHub (Jul 29, 2020): Hi @flaviostutz, did you try to achieve this behavior with the Gauge widget? https://godoc.org/github.com/mum4k/termdash/widgets/gauge The Gauge widget allows text alignment with these two options, so one can center the text: https://godoc.org/github.com/mum4k/termdash/widgets/gauge#HorizontalTextAlign https://godoc.org/github.com/mum4k/termdash/widgets/gauge#VerticalTextAlign Additionally one can choose both the colors of the "filled" and the "empty" portions of the gauge: https://godoc.org/github.com/mum4k/termdash/widgets/gauge#EmptyTextColor https://godoc.org/github.com/mum4k/termdash/widgets/gauge#FilledTextColor Can you try to see how far you can get with these? Once we identify the missing feature, we can add it of course.
Author
Owner

@flaviostutz commented on GitHub (Jul 29, 2020):

Great! I tried with Gauge using 100% as its value and it worked. In the meantime I was using Button with shadow black ;)

Thanks again!

<!-- gh-comment-id:665416143 --> @flaviostutz commented on GitHub (Jul 29, 2020): Great! I tried with Gauge using 100% as its value and it worked. In the meantime I was using Button with shadow black ;) Thanks again!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#128
No description provided.