PicoCalc: title bar rule reads like a real frame's border
The borderless title bar's rule (leading dashes, title, trailing
fill) was styled hint.accent — the muted style theme.py reserves for
text riding alongside a border (a footer hint, a subtitle's "more"
label), not the border's own glyphs. A bordered Panel's border draws
in border_style directly ("accent", already bold in both themes), so
the rule read dimmer than the frame it's standing in for.
The rule now takes "accent" directly, matching a real top border's
weight; the title was already title_style("accent") (matching a
Panel's title) and needed no change. The trailing ↑↓ clip arrows keep
hint_style — they play the same role as a bordered panel's own muted
"more" subtitle, not the border. No corner-glow analogue: that pass
needs a truecolor blend PICOCALC's 16-slot palette can't render
(effects=False), so the rule is uniformly bold rather than fading
from a lit corner the way a real frame's top-left does.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
53e52db94a
commit
5a81b15ab5
1 file changed
+16
-5
@@ -165,26 +165,37 @@ def _panel(screen: Screen, inner_w: int, viewport: int, active: bool) -> Panel:
|
||||
|
||||
|
||||
def _title_bar(screen: Screen, cols: int, more_above: bool, more_below: bool) -> Text:
|
||||
"""The borderless frame's one-row title bar: title, a muted rule, clip arrows.
|
||||
"""The borderless frame's one-row title bar: title, a bold rule, clip arrows.
|
||||
|
||||
The Panel border's whole vocabulary — where you are (title) and whether the list
|
||||
continues (the ``↑↓ more`` subtitle) — compressed into a single row so the body wins
|
||||
back three rows and four columns on the PicoCalc. Shape: ``─ Title ───────── ↑↓``,
|
||||
echoing :func:`~meshterm.ui.menus.section_heading`'s heading language.
|
||||
|
||||
The rule itself stands in for the Panel border this frame has none of, so it takes
|
||||
``border_style`` (``"accent"``) directly — the same bold weight a real border draws
|
||||
in — rather than :func:`~meshterm.ui.theme.hint_style`'s muted variant, which is for
|
||||
auxiliary text riding *alongside* a border (a footer hint, the subtitle's own
|
||||
"more" label below), not the border's own glyphs. The ``↑↓`` clip arrows keep that
|
||||
muted hint style, matching a bordered panel's own subtitle. There is no corner to
|
||||
light the way :func:`~meshterm.ui.tui.glow.apply_corner_glow` lights a real frame's
|
||||
top-left — that pass needs a truecolor blend this platform's 16-slot palette can't
|
||||
render, so the rule is uniformly bold rather than fading from one.
|
||||
"""
|
||||
border = "accent"
|
||||
bar = Text()
|
||||
bar.append("─ ", style="hint.accent")
|
||||
bar.append("─ ", style=border)
|
||||
if screen.title:
|
||||
bar.append(screen.title, style=title_style("accent"))
|
||||
bar.append(screen.title, style=title_style(border))
|
||||
bar.append(" ", style=None)
|
||||
tail = ""
|
||||
if more_above or more_below:
|
||||
tail = ("↑" if more_above else " ") + ("↓" if more_below else " ")
|
||||
fill = cols - bar.cell_len - (len(tail) + 1 if tail else 0)
|
||||
if fill > 0:
|
||||
bar.append("─" * fill, style="hint.accent")
|
||||
bar.append("─" * fill, style=border)
|
||||
if tail:
|
||||
bar.append(" " + tail, style="hint.accent")
|
||||
bar.append(" " + tail, style=hint_style(border))
|
||||
bar.truncate(cols)
|
||||
return bar
|
||||
|
||||
|
||||
Reference in new issue
Block a user