notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit c3b8823f722989059798f887f7022e4c3db1fc08
parent 41c2c048a85c0f740906119c619f8a9a66e28c26
Author: kernelkind <kernelkind@gmail.com>
Date:   Tue, 17 Jun 2025 16:58:33 -0400

ui: add `hline_with_width`

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck_ui/src/lib.rs | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck_ui/src/lib.rs b/crates/notedeck_ui/src/lib.rs @@ -46,12 +46,16 @@ pub fn padding<R>( } pub fn hline(ui: &egui::Ui) { + hline_with_width(ui, ui.available_rect_before_wrap().x_range()); +} + +pub fn hline_with_width(ui: &egui::Ui, range: egui::Rangef) { // pixel perfect horizontal line let rect = ui.available_rect_before_wrap(); #[allow(deprecated)] let resize_y = ui.painter().round_to_pixel(rect.top()) - 0.5; let stroke = ui.style().visuals.widgets.noninteractive.bg_stroke; - ui.painter().hline(rect.x_range(), resize_y, stroke); + ui.painter().hline(range, resize_y, stroke); } pub fn show_pointer(ui: &egui::Ui) {