change padding_left to padding for progressbar

This commit is contained in:
Julien Danjou 2008-01-29 08:44:16 +01:00
parent d9298f6edb
commit 42d4686282
3 changed files with 9 additions and 9 deletions

View File

@ -262,8 +262,8 @@ This widget shows one or more progress-bars.
Set width.
*height*::
Set height (i.e. 0.9 = 90%)
*padding_left*::
Empty space on the left.
*padding*::
Empty space on both sides.
*x*::
Horizontal offset (auto-alignment if not set).
*y*::
@ -471,7 +471,7 @@ screen <integer> [MULTI]
gap = <integer>
width = <integer>
height = <float>
padding_left = <integer>
padding = <integer>
x = <integer> y = <integer>
mouse [MULTI]
{

View File

@ -573,7 +573,7 @@ config_parse(const char *confpatharg)
CFG_SEC((char *) "bar", widget_progressbar_bar_opts, CFGF_MULTI),
CFG_INT((char *) "width", 100, CFGF_NONE),
CFG_INT((char *) "gap", 2, CFGF_NONE),
CFG_INT((char *) "padding_left", 0, CFGF_NONE),
CFG_INT((char *) "padding", 0, CFGF_NONE),
CFG_FLOAT((char *) "height", 0.67, CFGF_NONE),
CFG_END()
};

View File

@ -32,8 +32,8 @@ typedef struct
int *percent;
/** Width of the bars */
int width;
/** Left padding */
int padding_left;
/** Padding */
int padding;
/** Pixel between bars */
int gap;
/** Number of bars */
@ -60,7 +60,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset,
if (!(d->bars))
return 0;
width = d->width - d->padding_left;
width = d->width - 2 * d->padding;
if(!widget->user_supplied_x)
widget->area.x = widget_calculate_offset(widget->statusbar->width,
@ -73,7 +73,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset,
margin_top = (int) (widget->statusbar->height * (1 - d->height)) / 2 + 0.5 + widget->area.y;
pb_height = (int) ((widget->statusbar->height * d->height - (d->gap * (d->bars - 1))) / d->bars + 0.5);
left_offset = widget->area.x + d->padding_left;
left_offset = widget->area.x + d->padding;
for(i = 0; i < d->bars; i++)
{
@ -180,7 +180,7 @@ progressbar_new(Statusbar *statusbar, cfg_t *config)
d->height = cfg_getfloat(config, "height");
d->gap = cfg_getint(config, "gap");
d->padding_left = cfg_getint(config, "padding_left");
d->padding = cfg_getint(config, "padding");
return w;
}