1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Make stippled_borders a lua setting

This commit is contained in:
Pavel Labath 2010-08-25 19:26:15 +02:00
parent e59679a0c1
commit 127ed29fb9
3 changed files with 6 additions and 17 deletions

View File

@ -430,12 +430,9 @@ static conky::simple_config_setting<int> gap_y("gap_y", 60, true);
/* border */
static conky::simple_config_setting<bool> draw_borders("draw_borders", false, false);
static conky::simple_config_setting<bool> draw_graph_borders("draw_graph_borders", true, false);
static int stippled_borders;
int get_stippled_borders(void)
{
return stippled_borders;
}
conky::range_config_setting<char> stippled_borders("stippled_borders", 0,
std::numeric_limits<char>::max(), 0, true);
static conky::simple_config_setting<bool> draw_shades("draw_shades", true, false);
static conky::simple_config_setting<bool> draw_outline("draw_outline", false, false);
@ -1865,8 +1862,8 @@ static void draw_text(void)
/* draw borders */
if (draw_borders.get(*state) && bw > 0) {
if (stippled_borders) {
char ss[2] = { (char)stippled_borders, (char)stippled_borders };
if (stippled_borders.get(*state)) {
char ss[2] = { stippled_borders.get(*state), stippled_borders.get(*state) };
XSetLineAttributes(display, window.gc, bw, LineOnOffDash,
CapButt, JoinMiter);
XSetDashes(display, window.gc, 0, ss, 2);
@ -2631,7 +2628,6 @@ static void set_default_configurations(void)
set_first_font("6x10");
minimum_width = 5;
minimum_height = 5;
stippled_borders = 0;
#endif /* BUILD_X11 */
free(current_mail_spool);
@ -2917,13 +2913,6 @@ char load_config_file(const char *f)
CONF_ERR;
}
}
CONF("stippled_borders") {
if (value) {
stippled_borders = strtol(value, 0, 0);
} else {
stippled_borders = 4;
}
}
#ifdef BUILD_IMLIB2
CONF("imlib_cache_size") {
if (value) {

View File

@ -284,7 +284,7 @@ enum _ifup_strictness {
};
extern int ifup_strictness;
int get_stippled_borders(void);
extern conky::range_config_setting<char> stippled_borders;
void set_current_text_color(long colour);
long get_current_text_color(void);

View File

@ -446,7 +446,7 @@ void scan_stippled_hr(struct text_object *obj, const char *arg)
sh = (struct stippled_hr *)malloc(sizeof(struct stippled_hr));
memset(sh, 0, sizeof(struct stippled_hr));
sh->arg = get_stippled_borders();
sh->arg = stippled_borders.get(*state);
sh->height = 1;
if (arg) {