Theme fixes: /RELOAD reloads them, /SET current_theme changes the default

theme, you can have window specific themes with /WINDOW THEME.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@561 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-31 21:16:09 +00:00 committed by cras
commit b82d10ca57
8 changed files with 231 additions and 118 deletions

View file

@ -27,6 +27,7 @@
#include "levels.h"
#include "themes.h"
#include "windows.h"
#include "window-items.h"
@ -355,6 +356,19 @@ static void cmd_window_list(void)
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_WINDOWLIST_FOOTER);
}
/* SYNTAX: WINDOW THEME <name> */
static void cmd_window_theme(const char *data)
{
active_win->theme = theme_load(data);
if (active_win->theme != NULL) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_WINDOW_THEME_CHANGED, data);
} else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_THEME_NOT_FOUND, data);
}
}
void window_commands_init(void)
{
command_bind("window", NULL, (SIGNAL_FUNC) cmd_window);
@ -377,6 +391,7 @@ void window_commands_init(void)
command_bind("window move left", NULL, (SIGNAL_FUNC) cmd_window_move_left);
command_bind("window move right", NULL, (SIGNAL_FUNC) cmd_window_move_right);
command_bind("window list", NULL, (SIGNAL_FUNC) cmd_window_list);
command_bind("window theme", NULL, (SIGNAL_FUNC) cmd_window_theme);
}
void window_commands_deinit(void)
@ -401,4 +416,5 @@ void window_commands_deinit(void)
command_unbind("window move left", (SIGNAL_FUNC) cmd_window_move_left);
command_unbind("window move right", (SIGNAL_FUNC) cmd_window_move_right);
command_unbind("window list", (SIGNAL_FUNC) cmd_window_list);
command_unbind("window theme", (SIGNAL_FUNC) cmd_window_theme);
}