forked from PsychoticNinja/irssi
Fixed window specific themes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1575 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
75543048b5
commit
0db8e96019
@ -430,10 +430,8 @@ char *format_get_text_theme(THEME_REC *theme, const char *module,
|
|||||||
va_list va;
|
va_list va;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
if (theme == NULL) {
|
if (theme == NULL)
|
||||||
theme = dest->window->theme == NULL ? current_theme :
|
theme = window_get_theme(dest->window);
|
||||||
dest->window->theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
va_start(va, formatnum);
|
va_start(va, formatnum);
|
||||||
str = format_get_text_theme_args(theme, module, dest, formatnum, va);
|
str = format_get_text_theme_args(theme, module, dest, formatnum, va);
|
||||||
@ -484,8 +482,7 @@ char *format_get_text(const char *module, WINDOW_REC *window,
|
|||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
format_create_dest(&dest, server, target, 0, window);
|
format_create_dest(&dest, server, target, 0, window);
|
||||||
theme = dest.window->theme == NULL ? current_theme :
|
theme = window_get_theme(dest.window);
|
||||||
dest.window->theme;
|
|
||||||
|
|
||||||
va_start(va, formatnum);
|
va_start(va, formatnum);
|
||||||
str = format_get_text_theme_args(theme, module, &dest, formatnum, va);
|
str = format_get_text_theme_args(theme, module, &dest, formatnum, va);
|
||||||
|
@ -51,6 +51,9 @@ typedef struct {
|
|||||||
int flags;
|
int flags;
|
||||||
} TEXT_DEST_REC;
|
} TEXT_DEST_REC;
|
||||||
|
|
||||||
|
#define window_get_theme(window) \
|
||||||
|
((window)->theme != NULL ? (window)->theme : current_theme)
|
||||||
|
|
||||||
int format_find_tag(const char *module, const char *tag);
|
int format_find_tag(const char *module, const char *tag);
|
||||||
|
|
||||||
/* Return length of text part in string (ie. without % codes) */
|
/* Return length of text part in string (ie. without % codes) */
|
||||||
|
@ -52,8 +52,7 @@ static void printformat_module_dest(const char *module, TEXT_DEST_REC *dest,
|
|||||||
THEME_REC *theme;
|
THEME_REC *theme;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
theme = dest->window->theme == NULL ? current_theme :
|
theme = window_get_theme(dest->window);
|
||||||
dest->window->theme;
|
|
||||||
|
|
||||||
formats = g_hash_table_lookup(default_formats, module);
|
formats = g_hash_table_lookup(default_formats, module);
|
||||||
format_read_arglist(va, &formats[formatnum],
|
format_read_arglist(va, &formats[formatnum],
|
||||||
@ -131,7 +130,8 @@ void printformat_module_gui_args(const char *module, int formatnum, va_list va)
|
|||||||
arglist, sizeof(arglist)/sizeof(char *),
|
arglist, sizeof(arglist)/sizeof(char *),
|
||||||
buffer, sizeof(buffer));
|
buffer, sizeof(buffer));
|
||||||
|
|
||||||
str = format_get_text_theme_charargs(current_theme, module, &dest,
|
str = format_get_text_theme_charargs(window_get_theme(dest.window),
|
||||||
|
module, &dest,
|
||||||
formatnum, arglist);
|
formatnum, arglist);
|
||||||
if (*str != '\0') format_send_to_gui(&dest, str);
|
if (*str != '\0') format_send_to_gui(&dest, str);
|
||||||
g_free(str);
|
g_free(str);
|
||||||
@ -153,7 +153,7 @@ static void print_line(TEXT_DEST_REC *dest, const char *text)
|
|||||||
g_return_if_fail(dest != NULL);
|
g_return_if_fail(dest != NULL);
|
||||||
g_return_if_fail(text != NULL);
|
g_return_if_fail(text != NULL);
|
||||||
|
|
||||||
tmp = format_get_level_tag(current_theme, dest);
|
tmp = format_get_level_tag(window_get_theme(dest->window), dest);
|
||||||
str = format_add_linestart(text, tmp);
|
str = format_add_linestart(text, tmp);
|
||||||
g_free_not_null(tmp);
|
g_free_not_null(tmp);
|
||||||
|
|
||||||
@ -377,7 +377,8 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text)
|
|||||||
|
|
||||||
/* add timestamp/server tag here - if it's done in print_line()
|
/* add timestamp/server tag here - if it's done in print_line()
|
||||||
it would be written to log files too */
|
it would be written to log files too */
|
||||||
tmp = format_get_line_start(current_theme, dest, time(NULL));
|
tmp = format_get_line_start(window_get_theme(dest->window),
|
||||||
|
dest, time(NULL));
|
||||||
str = format_add_linestart(text, tmp);
|
str = format_add_linestart(text, tmp);
|
||||||
g_free_not_null(tmp);
|
g_free_not_null(tmp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user