From 64e44421dde008fe570e50269e2bc54feb18b04d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 30 Dec 2007 18:55:46 +0100 Subject: [PATCH] allow to set statusbar width --- config.c | 2 ++ statusbar.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 2efd37b2..5fd65f4b 100644 --- a/config.c +++ b/config.c @@ -376,6 +376,7 @@ config_parse_screen(cfg_t *cfg, int screen) statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position")); virtscreen->statusbar->height = cfg_getint(cfg_statusbar, "height"); + virtscreen->statusbar->width = cfg_getint(cfg_statusbar, "width"); create_widgets(cfg_statusbar, virtscreen->statusbar); @@ -538,6 +539,7 @@ config_parse(const char *confpatharg) { CFG_STR((char *) "position", (char *) "top", CFGF_NONE), CFG_INT((char *) "height", 0, CFGF_NONE), + CFG_INT((char *) "width", 0, CFGF_NONE), CFG_SEC((char *) "textbox", widget_textbox_focus_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), CFG_SEC((char *) "taglist", widget_taglist_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), CFG_SEC((char *) "focustitle", widget_textbox_focus_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), diff --git a/statusbar.c b/statusbar.c index c57d4998..1019ea9b 100644 --- a/statusbar.c +++ b/statusbar.c @@ -150,10 +150,13 @@ statusbar_init(int screen) statusbar->height = MAX(statusbar->height, widget->font->height * 1.5); } - if(statusbar->position == BarRight || statusbar->position == BarLeft) - statusbar->width = area.height; - else - statusbar->width = area.width; + if(statusbar->width <= 0) + { + if(statusbar->position == BarRight || statusbar->position == BarLeft) + statusbar->width = area.height; + else + statusbar->width = area.width; + } statusbar->screen = screen;