#define VP_WIDGET_OVERRIDE_FONT gtk_widget_modify_font
#endif
-#define HEX_COLOR_LEN 8
-
/* enums */
typedef enum _vp_mode {
VP_MODE_NORMAL = 1<<0,
VpColor comp_bg[VP_COMP_LAST];
PangoFontDescription* comp_font[VP_COMP_LAST];
/* hint style */
- gchar hint_bg[HEX_COLOR_LEN];
- gchar hint_bg_focus[HEX_COLOR_LEN];
- gchar hint_fg[HEX_COLOR_LEN];
+ gchar* hint_bg;
+ gchar* hint_bg_focus;
+ gchar* hint_fg;
gchar* hint_style;
/* status bar */
VpColor status_bg[VP_STATUS_LAST];
{NULL, "cookie-timeout", TYPE_INTEGER, setting_cookie_timeout, {.i = 4800}},
{NULL, "scrollstep", TYPE_INTEGER, setting_scrollstep, {.i = 40}},
- /* TODO set type to color */
{NULL, "status-color-bg", TYPE_CHAR, setting_status_color_bg, {.s = "#000"}},
{NULL, "status-color-fg", TYPE_CHAR, setting_status_color_fg, {.s = "#fff"}},
{NULL, "status-font", TYPE_FONT, setting_status_font, {.s = "monospace bold 8"}},
if (get) {
setting_print_value(s, style->hint_bg);
} else {
- strncpy(style->hint_bg, s->arg.s, HEX_COLOR_LEN - 1);
- style->hint_bg[HEX_COLOR_LEN - 1] = '\0';
+ OVERWRITE_STRING(style->hint_bg, s->arg.s)
}
} else if (!g_strcmp0(s->name, "hint-bg-focus")) {
if (get) {
setting_print_value(s, style->hint_bg_focus);
} else {
- strncpy(style->hint_bg_focus, s->arg.s, HEX_COLOR_LEN - 1);
- style->hint_bg_focus[HEX_COLOR_LEN - 1] = '\0';
+ OVERWRITE_STRING(style->hint_bg_focus, s->arg.s)
}
} else if (!g_strcmp0(s->name, "hint-fg")) {
if (get) {
- setting_print_value(s, style->hint_bg_focus);
+ setting_print_value(s, style->hint_fg);
} else {
- strncpy(style->hint_fg, s->arg.s, HEX_COLOR_LEN - 1);
- style->hint_fg[HEX_COLOR_LEN - 1] = '\0';
+ OVERWRITE_STRING(style->hint_fg, s->arg.s)
}
- } else if (!g_strcmp0(s->name, "hint-style")) {
+ } else {
if (get) {
setting_print_value(s, style->hint_style);
} else {