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:
parent
e59679a0c1
commit
127ed29fb9
19
src/conky.cc
19
src/conky.cc
@ -430,12 +430,9 @@ static conky::simple_config_setting<int> gap_y("gap_y", 60, true);
|
|||||||
/* border */
|
/* border */
|
||||||
static conky::simple_config_setting<bool> draw_borders("draw_borders", false, false);
|
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 conky::simple_config_setting<bool> draw_graph_borders("draw_graph_borders", true, false);
|
||||||
static int stippled_borders;
|
|
||||||
|
|
||||||
int get_stippled_borders(void)
|
conky::range_config_setting<char> stippled_borders("stippled_borders", 0,
|
||||||
{
|
std::numeric_limits<char>::max(), 0, true);
|
||||||
return stippled_borders;
|
|
||||||
}
|
|
||||||
|
|
||||||
static conky::simple_config_setting<bool> draw_shades("draw_shades", true, false);
|
static conky::simple_config_setting<bool> draw_shades("draw_shades", true, false);
|
||||||
static conky::simple_config_setting<bool> draw_outline("draw_outline", false, false);
|
static conky::simple_config_setting<bool> draw_outline("draw_outline", false, false);
|
||||||
@ -1865,8 +1862,8 @@ static void draw_text(void)
|
|||||||
|
|
||||||
/* draw borders */
|
/* draw borders */
|
||||||
if (draw_borders.get(*state) && bw > 0) {
|
if (draw_borders.get(*state) && bw > 0) {
|
||||||
if (stippled_borders) {
|
if (stippled_borders.get(*state)) {
|
||||||
char ss[2] = { (char)stippled_borders, (char)stippled_borders };
|
char ss[2] = { stippled_borders.get(*state), stippled_borders.get(*state) };
|
||||||
XSetLineAttributes(display, window.gc, bw, LineOnOffDash,
|
XSetLineAttributes(display, window.gc, bw, LineOnOffDash,
|
||||||
CapButt, JoinMiter);
|
CapButt, JoinMiter);
|
||||||
XSetDashes(display, window.gc, 0, ss, 2);
|
XSetDashes(display, window.gc, 0, ss, 2);
|
||||||
@ -2631,7 +2628,6 @@ static void set_default_configurations(void)
|
|||||||
set_first_font("6x10");
|
set_first_font("6x10");
|
||||||
minimum_width = 5;
|
minimum_width = 5;
|
||||||
minimum_height = 5;
|
minimum_height = 5;
|
||||||
stippled_borders = 0;
|
|
||||||
#endif /* BUILD_X11 */
|
#endif /* BUILD_X11 */
|
||||||
|
|
||||||
free(current_mail_spool);
|
free(current_mail_spool);
|
||||||
@ -2917,13 +2913,6 @@ char load_config_file(const char *f)
|
|||||||
CONF_ERR;
|
CONF_ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CONF("stippled_borders") {
|
|
||||||
if (value) {
|
|
||||||
stippled_borders = strtol(value, 0, 0);
|
|
||||||
} else {
|
|
||||||
stippled_borders = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef BUILD_IMLIB2
|
#ifdef BUILD_IMLIB2
|
||||||
CONF("imlib_cache_size") {
|
CONF("imlib_cache_size") {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
@ -284,7 +284,7 @@ enum _ifup_strictness {
|
|||||||
};
|
};
|
||||||
extern int 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);
|
void set_current_text_color(long colour);
|
||||||
long get_current_text_color(void);
|
long get_current_text_color(void);
|
||||||
|
@ -446,7 +446,7 @@ void scan_stippled_hr(struct text_object *obj, const char *arg)
|
|||||||
sh = (struct stippled_hr *)malloc(sizeof(struct stippled_hr));
|
sh = (struct stippled_hr *)malloc(sizeof(struct stippled_hr));
|
||||||
memset(sh, 0, 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;
|
sh->height = 1;
|
||||||
|
|
||||||
if (arg) {
|
if (arg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user