labnag: remove doubled border between scroll buttons and adjust text position
Some checks failed
labwc.github.io / notify (push) Has been cancelled

Each scroll button draws its own full border, so placing the up and down
buttons flush produced a divider twice the intended thickness. Shift
button_down up by one border width and extend its height accordingly so
its top border overlaps button_up's bottom border.
Also drop a stray \`+ border\` offset from the scroll button text Y-position
that was pushing the label below the button's center.
This commit is contained in:
stormshadow 2026-04-28 02:09:44 +05:30 committed by Johan Malm
parent ccdef5e854
commit 7ec7a322d2

View file

@ -318,7 +318,7 @@ render_details_scroll_button(cairo_t *cairo, struct nag *nag,
cairo_set_source_u32(cairo, nag->conf->button_text);
cairo_move_to(cairo, button->x + border + padding,
button->y + border + (button->height - text_height) / 2);
button->y + (button->height - text_height) / 2);
render_text(cairo, nag->conf->font_description, 1, true,
"%s", button->text);
}
@ -415,10 +415,10 @@ render_detailed(cairo_t *cairo, struct nag *nag, uint32_t y)
nag->details.button_down.x = nag->details.x + nag->details.width;
nag->details.button_down.y =
nag->details.button_up.y + nag->details.button_up.height;
nag->details.button_up.y + nag->details.button_up.height - border;
nag->details.button_down.width = button_width;
nag->details.button_down.height =
border_rect_height - nag->details.button_up.height;
border_rect_height - nag->details.button_up.height + border;
render_details_scroll_button(cairo, nag, &nag->details.button_down);
}