Conversation and Author screens styled to match; glyph policy chosen from measurement
This commit is contained in:
40
tui/theme.go
40
tui/theme.go
@@ -80,3 +80,43 @@ func choosePalette(force string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Icons. Nerd Font glyphs, with an ASCII fallback so the interface still reads
|
||||
// when the font is not installed or the terminal cannot show it: -ascii, or a
|
||||
// TERM that says it cannot, chooses the fallback.
|
||||
type glyphSet struct {
|
||||
Todo, Running, Blocked, Review, Done, Cancelled string
|
||||
Folder, Branch, Commit, Cost, Person, Agent string
|
||||
Arrow, Dot, Rule string
|
||||
}
|
||||
|
||||
var nerdGlyphs = glyphSet{
|
||||
Todo: "\uf10c", Running: "\uf04b", Blocked: "\uf05e", Review: "\uf06e",
|
||||
Done: "\uf00c", Cancelled: "\uf00d",
|
||||
Folder: "\uf07b", Branch: "\uf126", Commit: "\uf1d3", Cost: "\uf155",
|
||||
Person: "\uf007", Agent: "\uf085",
|
||||
Arrow: "\uf105", Dot: "\uf111", Rule: "─",
|
||||
}
|
||||
|
||||
var plainGlyphs = glyphSet{
|
||||
Todo: "·", Running: "▶", Blocked: "■", Review: "◆",
|
||||
Done: "✓", Cancelled: "✕",
|
||||
Folder: "/", Branch: "branch", Commit: "commit", Cost: "cents",
|
||||
Person: "you", Agent: "agent",
|
||||
Arrow: "›", Dot: "·", Rule: "─",
|
||||
}
|
||||
|
||||
// icons starts as plain Unicode on purpose. The Nerd Font is installed, but a
|
||||
// private-use glyph does not survive TUIOS's own screen capture, so whether it
|
||||
// draws cannot be checked from here. The words next to every icon carry the
|
||||
// meaning either way, and -nerd opts into the richer set once it has been seen
|
||||
// on the terminal that matters.
|
||||
var icons = plainGlyphs
|
||||
|
||||
func chooseGlyphs(useNerd bool) {
|
||||
if useNerd {
|
||||
icons = nerdGlyphs
|
||||
return
|
||||
}
|
||||
icons = plainGlyphs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user