From 8e2828efc6d9c88f39592f4ae1c709937b8b9f46 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 5 Sep 2020 10:11:10 +0300 Subject: Refactor: ListWidget for a general purpose list The sidebar uses a ListWidget now, but the layout needs fixing. --- src/ui/widget.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ui/widget.c') diff --git a/src/ui/widget.c b/src/ui/widget.c index b5ea3b0f..cd02d5e4 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -207,6 +207,12 @@ iLocalDef iRect innerRect_Widget_(const iWidget *d) { height_Rect(d->rect) - d->padding[1] - d->padding[3]); } +iRect innerBounds_Widget(const iWidget *d) { + return adjusted_Rect(bounds_Widget(d), + init_I2(d->padding[0], d->padding[1]), + init_I2(-d->padding[2], -d->padding[3])); +} + void arrange_Widget(iWidget *d) { if (isCollapsed_Widget_(d)) { setFlags_Widget(d, wasCollapsed_WidgetFlag, iTrue); -- cgit v1.2.3