diff --git a/include/justui/jwidget.h b/include/justui/jwidget.h index c7f259b..3cdc7ef 100644 --- a/include/justui/jwidget.h +++ b/include/justui/jwidget.h @@ -272,6 +272,10 @@ jwidget_geometry *jwidget_geometry_rw(void *w); border width on a widget's geometry. */ void jwidget_set_border(void *w, jwidget_border_style s, int width, int color); +/* jwidget_set_borders(): Set all four borders */ +void jwidget_set_borders(void *w, jwidget_border_style s, int color, + int top, int right, int bottom, int left); + /* jwidget_set_padding(): Set all padding distances around a widget */ void jwidget_set_padding(void *w, int top, int right, int bottom, int left); diff --git a/src/jwidget.c b/src/jwidget.c index e39e4a8..0f7772f 100644 --- a/src/jwidget.c +++ b/src/jwidget.c @@ -377,6 +377,19 @@ void jwidget_set_border(void *w, jwidget_border_style s, int width, int color) for(int i = 0; i < 4; i++) g->borders[i] = width; } +void jwidget_set_borders(void *w, jwidget_border_style s, int color, + int top, int right, int bottom, int left) +{ + jwidget_geometry *g = jwidget_geometry_rw(w); + + g->border_style = s; + g->border_color = color; + g->border.top = top; + g->border.right = right; + g->border.bottom = bottom; + g->border.left = left; +} + void jwidget_set_padding(void *w, int top, int right, int bottom, int left) { jwidget_geometry *g = jwidget_geometry_rw(w);