From 7fbc91551653b4959398d71aed9c5255554c7c9b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 26 Nov 2000 05:08:11 +0000 Subject: [PATCH] theme fixes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@880 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- colorless.theme | 81 ++++++++++++++++++++++++++++++ default.theme | 10 ++-- src/fe-common/core/themes.c | 14 ++++++ src/fe-common/irc/module-formats.c | 2 +- 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 colorless.theme diff --git a/colorless.theme b/colorless.theme new file mode 100644 index 00000000..056cdf5d --- /dev/null +++ b/colorless.theme @@ -0,0 +1,81 @@ +abstracts = { +# generic + line_start = "-!- "; + hilight = "%_$0-%_"; + error = "$0-"; + + channel = "%_$0-%_"; + nick = "%_$0-%_"; + nickhost = "[$0-]"; + server = "%_$0-%_"; + reason = "[$0-]"; + +# channel specific messages + channick_hilight = "$0-"; + chanhost_hilight = "{nickhost $0-}"; + channick = "$0-"; + chanhost = "{nickhost $0-}"; + channelhilight = "$0-"; + ban = "$0-"; + +# messages + msgnick = "<$0-> %|"; + msgownnick = "$0-"; + msgchannel = ":$0-"; + msgme = "%_$0-%_"; + privmsg = "[$0-] " + privmsgnick = "$0-" + privmsghost = "($0-)"; + ownprivmsg = "[$0-] "; + ownprivmsgdest = "($0-)"; + +# actions + action = " * $0- "; + ownaction = "{action $0-}"; + pvtaction = " (*) $0- "; + pvtaction_query = "{action $0-}"; + pubaction = "{action $0-}"; + +# notices + ownnotice = "[$0-] "; + ownnotice_target = "($0-)"; + notice = "-$0-- "; + pubnotice_channel = ":$0-"; + pvtnotice_nick = "($0-)"; + servernotice = "!$0- "; + +# ctcp + ownctcp = "[$0-] "; + ownctcp_target = "($0-)"; + ctcp = "$0-"; + +# wall + ownwall = "[$0-] "; + ownwall_channel = "/$0-"; + +# wallops + wallop = "$0-: "; + wallop_nick = "$0-"; + wallop_action = " * $0- "; + +# netsplits + netsplit = "$0-"; + netjoin = "$0-"; + +# /names list + names_nickstat = "%_$0-%_"; + names_users = "[$0-]"; + names_channel = "$0-"; + +# dcc + dcc = "$0-"; + dccfile = "%_$0-%_"; + + dccownmsg = "[$0-] "; + dccownnick = "($0)"; + dccownaction = "{action $0-}"; + dccmsg = "[$0-] " + dccmsghost = "($0-)"; + dccquerynick = "$0-"; + dccaction = " (*dcc*) $0- %|"; +}; diff --git a/default.theme b/default.theme index 3473bca1..f4078e6b 100644 --- a/default.theme +++ b/default.theme @@ -12,17 +12,19 @@ abstracts = { # generic line_start = "%B-%W!%B-%n "; hilight = "%_$0-%_"; + error = "%R$0-%n"; channel = "%_$0-%_"; nick = "%_$0-%_"; + nickhost = "[$0-]"; server = "%_$0-%_"; reason = "[$0-]"; # channel specific messages channick_hilight = "%C$0-%n"; - chanhost_hilight = "[%c$0-%n]"; + chanhost_hilight = "{nickhost %c$0-%n}"; channick = "%c$0-%n"; - chanhost = "[$0-]"; + chanhost = "{nickhost $0-}"; channelhilight = "%c$0-%n"; ban = "%c$0-%n"; @@ -48,7 +50,7 @@ abstracts = { ownnotice = "[%r$0-]%n "; ownnotice_target = "%K(%R$0-%K)"; notice = "%K-%M$0-%K-%n "; - pubnotice_channel = "%K:%m$0"; + pubnotice_channel = "%K:%m$0-"; pvtnotice_nick = "%K(%m$0-%K)"; servernotice = "%g!$0-%n "; @@ -80,7 +82,7 @@ abstracts = { dccfile = "%_$0-%_"; dccownmsg = "[%r$0-%n] "; - dccownnick = "%K(%R$1%K)%n"; + dccownnick = "%K(%R$0-%K)%n"; dccownaction = "{action $0-}"; dccmsg = "[%G$0-%n] " dccmsghost = "%K(%g$0-%K)%n"; diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index a8e7c3b0..66c023c9 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -274,6 +274,20 @@ static char *theme_format_expand_abstract(THEME_REC *theme, data = theme_format_expand_data(theme, formatp, default_color, NULL, 0); + len = strlen(data); + if (len > 1 && isdigit(data[len-1]) && data[len-2] == '$') { + /* ends with $ .. this breaks things if next + character is digit or '-' */ + char digit, *tmp; + + tmp = data; + digit = tmp[len-1]; + tmp[len-1] = '\0'; + + data = g_strdup_printf("%s{%c}", tmp, digit); + g_free(tmp); + } + ret = parse_special_string(abstract, NULL, NULL, data, NULL); g_free(abstract); g_free(data); diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index 578cea16..d0f1a3a5 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -118,7 +118,7 @@ FORMAT_REC fecommon_irc_formats[] = { { "own_notice", "{ownnotice notice{ownnotice_target $0}}$1", 2, { 0, 0 } }, { "own_action", "{ownaction $0}$1", 2, { 0, 0 } }, { "own_ctcp", "{ownctcp ctcp{ownctcp_target $0}}$1 $2", 3, { 0, 0, 0 } }, - { "own_wall", "{ownwall Wall{ownwall_channel}}$1", 2, { 0, 0 } }, + { "own_wall", "{ownwall Wall{ownwall_channel $0}}$1", 2, { 0, 0 } }, /* ---- */ { NULL, "Received messages", 0 },