Add optional bigclock digit outline (closes #1030) (#1031)

## What are the changes about?

Add optional `bigclock_outline_fg`. When set, each big-clock digit gets a 1-cell outline drawn under the glyph so it stays readable over busy animations. Default is `null` (previous behavior).

When the outline is enabled, the gap under the clock is slightly larger so the stroke is not glued to the login box.

## What existing issue(s) does this resolve?

Fixes #1030

## Pre-requisites

- [x] I have tested & confirmed the changes work locally
- [x] I have read and fully adhere to the rules set in the contributing guidelines found in `CONTRIBUTING.md`

### Testing

- `zig build -Doptimize=ReleaseSafe` (zig 0.16.0)
- Greeter with `bigclock = en` and `bigclock_outline_fg = 0x20000000` over a `dur_file` animation
- Default `null` leaves stock look unchanged

### AI usage (per contributing.md)

Assisted by an LLM (xAI Grok) for exploration and drafting. I directed the design (optional outline only, no panel/box, stock layout otherwise), reviewed the Zig, fixed an `i2` overflow in the outline loop, verified the build/local greeter, and wrote this PR text.

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/1031
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
jR4dh3y 2026-08-24 15:31:52 +02:00 committed by AnErrupTion
commit bd28c0e679
4 changed files with 73 additions and 10 deletions

View file

@ -21,6 +21,7 @@ bg: u32 = 0x00000000,
bigclock: Bigclock = .none,
bigclock_12hr: bool = false,
bigclock_seconds: bool = false,
bigclock_outline_fg: ?u32 = null,
blank_box: bool = true,
border_fg: u32 = 0x00FFFFFF,
box_position_h: f32 = 0.5,

View file

@ -559,6 +559,7 @@ pub fn main(init: std.process.Init) !void {
null,
state.buffer.fg,
state.buffer.bg,
state.config.bigclock_outline_fg,
switch (state.config.bigclock) {
.none, .en => .en,
.fa => .fa,
@ -2258,7 +2259,8 @@ fn positionWidgets(ptr: *anyopaque) !void {
const clock_text_len = TerminalBuffer.strWidth(state.bigclock_label.text) * (BigLabel.CHAR_WIDTH + 1);
if (state.config.bigclock != .none) {
bb_height += BigLabel.CHAR_HEIGHT + 2;
const gap: usize = if (state.config.bigclock_outline_fg != null) 3 else 2;
bb_height += BigLabel.CHAR_HEIGHT + gap;
bb_width = @max(bb_width, clock_text_len);
}