mirror of
https://git.planet-casio.com/Lephenixnoir/JustUI.git
synced 2024-12-28 04:23:40 +01:00
jwidget: add a jwidget_set_borders() function
This commit is contained in:
parent
ee98be1cc1
commit
699576eb33
2 changed files with 17 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue