2 Commits
Author SHA1 Message Date
Hadi a126d288ed change funding url
Signed-off-by: Hadi <[email protected]>
2026-08-28 14:55:05 +02:00
Hadi 625f494623 fix: Items take full width for bubblezone to work everywhere
Signed-off-by: Hadi <[email protected]>
2026-08-27 13:31:09 +02:00
3 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
ko_fi: anotherhadi
custom: ["https://hadi.icu/donate"]
+1 -1
View File
@@ -9,7 +9,7 @@
![GitHub Stars](https://www.shieldcn.dev/github/stars/anotherhadi/default-creds-tui.svg?variant=outline&theme=violet)
![Release](https://www.shieldcn.dev/github/release/anotherhadi/default-creds-tui.svg?variant=outline&theme=violet)
![CI](https://www.shieldcn.dev/github/ci/anotherhadi/default-creds-tui.svg?variant=outline&theme=violet)
[![Ko-fi](https://www.shieldcn.dev/badge/Ko--fi-sponsor-FF5E5B.svg?logo=kofi&variant=secondary&theme=violet)](https://ko-fi.com/anotherhadi)
[![Donate](https://www.shieldcn.dev/badge/Donate-sponsor-FF5E5B.svg?logo=heart&variant=secondary&theme=violet)](https://hadi.icu/donate)
# Default Creds TUI
+14 -4
View File
@@ -27,6 +27,16 @@ func clampToWidth(s string, width int) string {
return ansi.Truncate(s, width, "…")
}
func padToWidth(s string, width int) string {
if width <= 0 {
return s
}
if w := ansi.StringWidth(s); w < width {
s += strings.Repeat(" ", width-w)
}
return s
}
type entryDelegate struct{}
func (d entryDelegate) Height() int { return cardHeight }
@@ -76,10 +86,10 @@ func (d entryDelegate) Render(w io.Writer, m list.Model, index int, item list.It
}
lines := []string{
clampToWidth(side.Render(line1), width),
clampToWidth(side.Render(line2), width),
clampToWidth(side.Render(line3), width),
clampToWidth(side.Render(line4), width),
padToWidth(clampToWidth(side.Render(line1), width), width),
padToWidth(clampToWidth(side.Render(line2), width), width),
padToWidth(clampToWidth(side.Render(line3), width), width),
padToWidth(clampToWidth(side.Render(line4), width), width),
}
fmt.Fprint(w, zone.Mark(entryZoneID(index), strings.Join(lines, "\n")))
}