- commit
- 68508d4c74141033a1a5d2035451c99190c65fd3
- parent
- c09a61f96a7ceeba310278a6d1311a50dc2a5e24
- author
- Dami <dami.etoile@gmail.com>
| M | internal/ | 4 | ++-- |
| M | internal/ | 8 | ++++---- |
@@ -92,14 +92,14 @@ type Theme struct {
9292 // ImageID is the style of an image's Unicode placeholders: the9393 // foreground color is not a color but the image's id, in the 256-color9494 // palette, which is how the terminal knows which image to draw there.95-func (t Theme) ImageID(id int) lipgloss.Style {95+func (t *Theme) ImageID(id int) lipgloss.Style {9696 return lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(id))9797 }9898 9999 // Text adds a cell's bold, italic, underline and strikethrough to base,100100 // one of the cell roles (cell, pointer, selection, errorCell), so text101101 // styles show through the pointer and selection colors.102-func (t Theme) Text(base lipgloss.Style, st sheet.Style) lipgloss.Style {102+func (t *Theme) Text(base lipgloss.Style, st sheet.Style) lipgloss.Style {103103 if st.Bold {104104 base = base.Bold(true)105105 }@@ -17,7 +17,7 @@ const SepRow = "\x00"
1717 1818 // Frame draws a border around rows. A title sits in the top border and a1919 // footer at the right of the bottom border.20-func (t Theme) Frame(inner int, title, footer string, rows []string) []string {20+func (t *Theme) Frame(inner int, title, footer string, rows []string) []string {2121 inner = max(inner, 2) // screens smaller than the box get a clipped box2222 b := t.Border2323 top := "┌" + strings.Repeat("─", inner) + "┐"@@ -45,12 +45,12 @@ func (t Theme) Frame(inner int, title, footer string, rows []string) []string {
4545 }4646 4747 // Chip draws a key name as a key cap, e.g. "Ctrl+S".48-func (t Theme) Chip(label string) string {48+func (t *Theme) Chip(label string) string {4949 return t.KeyChip.Render(" " + label + " ")5050 }5151 5252 // Chips renders keys as key chips, e.g. [Ctrl+/] [F1].53-func (t Theme) Chips(keys []string) string {53+func (t *Theme) Chips(keys []string) string {5454 parts := make([]string, len(keys))5555 for i, k := range keys {5656 parts[i] = t.Chip(k)@@ -60,7 +60,7 @@ func (t Theme) Chips(keys []string) string {
6060 6161 // KeyHints renders key and description pairs, e.g. "Enter accept", each6262 // key as a chip.63-func (t Theme) KeyHints(pairs ...string) string {63+func (t *Theme) KeyHints(pairs ...string) string {6464 parts := make([]string, 0, len(pairs)/2)6565 for i := 0; i+1 < len(pairs); i += 2 {6666 parts = append(parts, t.Chip(pairs[i])+" "+t.Muted.Render(pairs[i+1]))