allow negativ coords

This commit is contained in:
Julien Danjou 2008-01-05 13:01:40 +01:00
parent bfab98d1d4
commit 5770b56af0
2 changed files with 16 additions and 16 deletions

View File

@ -514,22 +514,22 @@ config_parse(const char *confpatharg)
}; };
static cfg_opt_t widget_opts[] = static cfg_opt_t widget_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
CFG_END() CFG_END()
}; };
static cfg_opt_t widget_taglist_opts[] = static cfg_opt_t widget_taglist_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_taglist_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_taglist_opts, CFGF_MULTI),
CFG_END() CFG_END()
}; };
static cfg_opt_t widget_iconbox_opts[] = static cfg_opt_t widget_iconbox_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
CFG_STR((char *) "image", (char *) NULL, CFGF_NONE), CFG_STR((char *) "image", (char *) NULL, CFGF_NONE),
CFG_BOOL((char *) "resize", cfg_true, CFGF_NONE), CFG_BOOL((char *) "resize", cfg_true, CFGF_NONE),
@ -537,8 +537,8 @@ config_parse(const char *confpatharg)
}; };
static cfg_opt_t widget_textbox_opts[] = static cfg_opt_t widget_textbox_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
CFG_INT((char *) "width", 0, CFGF_NONE), CFG_INT((char *) "width", 0, CFGF_NONE),
CFG_STR((char *) "text", (char *) NULL, CFGF_NONE), CFG_STR((char *) "text", (char *) NULL, CFGF_NONE),
@ -550,8 +550,8 @@ config_parse(const char *confpatharg)
}; };
static cfg_opt_t widget_focustitle_opts[] = static cfg_opt_t widget_focustitle_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE),
@ -561,8 +561,8 @@ config_parse(const char *confpatharg)
}; };
static cfg_opt_t widget_tasklist_opts[] = static cfg_opt_t widget_tasklist_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE),
@ -581,8 +581,8 @@ config_parse(const char *confpatharg)
}; };
static cfg_opt_t widget_progressbar_opts[] = static cfg_opt_t widget_progressbar_opts[] =
{ {
CFG_INT((char *) "x", -1, CFGF_NONE), CFG_INT((char *) "x", 0xffffffff, CFGF_NONE),
CFG_INT((char *) "y", -1, CFGF_NONE), CFG_INT((char *) "y", 0xffffffff, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
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),

View File

@ -117,8 +117,8 @@ widget_common_new(Widget *widget, Statusbar *statusbar, cfg_t* config)
widget->button_press = widget_common_button_press; widget->button_press = widget_common_button_press;
widget->area.x = cfg_getint(config, "x"); widget->area.x = cfg_getint(config, "x");
widget->area.y = cfg_getint(config, "y"); widget->area.y = cfg_getint(config, "y");
widget->user_supplied_x = (widget->area.x >= 0); widget->user_supplied_x = (widget->area.x != (int) 0xffffffff);
widget->user_supplied_y = (widget->area.y >= 0); widget->user_supplied_y = (widget->area.y != (int) 0xffffffff);
} }
/** Send command to widget /** Send command to widget