change padding_left to padding for progressbar
This commit is contained in:
parent
d9298f6edb
commit
42d4686282
|
@ -262,8 +262,8 @@ This widget shows one or more progress-bars.
|
||||||
Set width.
|
Set width.
|
||||||
*height*::
|
*height*::
|
||||||
Set height (i.e. 0.9 = 90%)
|
Set height (i.e. 0.9 = 90%)
|
||||||
*padding_left*::
|
*padding*::
|
||||||
Empty space on the left.
|
Empty space on both sides.
|
||||||
*x*::
|
*x*::
|
||||||
Horizontal offset (auto-alignment if not set).
|
Horizontal offset (auto-alignment if not set).
|
||||||
*y*::
|
*y*::
|
||||||
|
@ -471,7 +471,7 @@ screen <integer> [MULTI]
|
||||||
gap = <integer>
|
gap = <integer>
|
||||||
width = <integer>
|
width = <integer>
|
||||||
height = <float>
|
height = <float>
|
||||||
padding_left = <integer>
|
padding = <integer>
|
||||||
x = <integer> y = <integer>
|
x = <integer> y = <integer>
|
||||||
mouse [MULTI]
|
mouse [MULTI]
|
||||||
{
|
{
|
||||||
|
|
2
config.c
2
config.c
|
@ -573,7 +573,7 @@ config_parse(const char *confpatharg)
|
||||||
CFG_SEC((char *) "bar", widget_progressbar_bar_opts, CFGF_MULTI),
|
CFG_SEC((char *) "bar", widget_progressbar_bar_opts, CFGF_MULTI),
|
||||||
CFG_INT((char *) "width", 100, CFGF_NONE),
|
CFG_INT((char *) "width", 100, CFGF_NONE),
|
||||||
CFG_INT((char *) "gap", 2, 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_FLOAT((char *) "height", 0.67, CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,8 +32,8 @@ typedef struct
|
||||||
int *percent;
|
int *percent;
|
||||||
/** Width of the bars */
|
/** Width of the bars */
|
||||||
int width;
|
int width;
|
||||||
/** Left padding */
|
/** Padding */
|
||||||
int padding_left;
|
int padding;
|
||||||
/** Pixel between bars */
|
/** Pixel between bars */
|
||||||
int gap;
|
int gap;
|
||||||
/** Number of bars */
|
/** Number of bars */
|
||||||
|
@ -60,7 +60,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
if (!(d->bars))
|
if (!(d->bars))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
width = d->width - d->padding_left;
|
width = d->width - 2 * d->padding;
|
||||||
|
|
||||||
if(!widget->user_supplied_x)
|
if(!widget->user_supplied_x)
|
||||||
widget->area.x = widget_calculate_offset(widget->statusbar->width,
|
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;
|
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);
|
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++)
|
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->height = cfg_getfloat(config, "height");
|
||||||
d->gap = cfg_getint(config, "gap");
|
d->gap = cfg_getint(config, "gap");
|
||||||
d->padding_left = cfg_getint(config, "padding_left");
|
d->padding = cfg_getint(config, "padding");
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue