mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
/SCROLLBACK REDRAW - redraw the contents of current window according to
active formats, ie. changing theme changes scrollback. It's still a bit buggy (can crash) with multiline formats, need to fix it as soon as I figure out where the problem is.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@852 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
e3084d3ffa
commit
e923b1651a
12 changed files with 442 additions and 131 deletions
|
|
@ -459,25 +459,20 @@ static void theme_read_abstracts(CONFIG_REC *config, THEME_REC *theme)
|
|||
}
|
||||
|
||||
static void theme_set_format(THEME_REC *theme, MODULE_THEME_REC *rec,
|
||||
FORMAT_REC *formats,
|
||||
const char *module,
|
||||
const char *key, const char *value)
|
||||
{
|
||||
int n;
|
||||
int num;
|
||||
|
||||
for (n = 0; formats[n].def != NULL; n++) {
|
||||
if (formats[n].tag != NULL &&
|
||||
g_strcasecmp(formats[n].tag, key) == 0) {
|
||||
rec->formats[n] = g_strdup(value);
|
||||
rec->expanded_formats[n] =
|
||||
theme_format_expand(theme, value);
|
||||
break;
|
||||
}
|
||||
num = format_find_tag(module, key);
|
||||
if (num != -1) {
|
||||
rec->formats[num] = g_strdup(value);
|
||||
rec->expanded_formats[num] = theme_format_expand(theme, value);
|
||||
}
|
||||
}
|
||||
|
||||
static void theme_read_formats(THEME_REC *theme, const char *module,
|
||||
CONFIG_REC *config, FORMAT_REC *formats,
|
||||
MODULE_THEME_REC *rec)
|
||||
CONFIG_REC *config, MODULE_THEME_REC *rec)
|
||||
{
|
||||
CONFIG_NODE *node;
|
||||
GSList *tmp;
|
||||
|
|
@ -491,7 +486,7 @@ static void theme_read_formats(THEME_REC *theme, const char *module,
|
|||
node = tmp->data;
|
||||
|
||||
if (node->key != NULL && node->value != NULL) {
|
||||
theme_set_format(theme, rec, formats,
|
||||
theme_set_format(theme, rec, module,
|
||||
node->key, node->value);
|
||||
}
|
||||
}
|
||||
|
|
@ -510,7 +505,7 @@ static void theme_init_module(THEME_REC *theme, const char *module,
|
|||
rec = theme_module_create(theme, module);
|
||||
|
||||
if (config != NULL)
|
||||
theme_read_formats(theme, module, config, formats, rec);
|
||||
theme_read_formats(theme, module, config, rec);
|
||||
|
||||
/* expand the remaining formats */
|
||||
for (n = 0; n < rec->count; n++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue