From 42d468628290226f014b27242a2657e104aac9b8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 29 Jan 2008 08:44:16 +0100 Subject: [PATCH] change padding_left to padding for progressbar --- awesomerc.1.txt | 6 +++--- config.c | 2 +- widgets/progressbar.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/awesomerc.1.txt b/awesomerc.1.txt index 16d8a809..472a2351 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -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 [MULTI] gap = width = height = - padding_left = + padding = x = y = mouse [MULTI] { diff --git a/config.c b/config.c index 223815d7..dc5d3738 100644 --- a/config.c +++ b/config.c @@ -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() }; diff --git a/widgets/progressbar.c b/widgets/progressbar.c index f35b0d0f..f4ec1f45 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -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; } -- 2.11.4.GIT