From 125ca2f0d2e0513ed8b47ba05a193fccbcb9d79d Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 23 Apr 2019 16:54:40 +0200 Subject: Add occupants wrap option Wrapping for the occupants panel like already exists for the roster panel. See `/occupants wrap on`. Regards https://github.com/boothj5/profanity/issues/690 --- src/ui/console.c | 5 +++++ src/ui/occupantswin.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/console.c b/src/ui/console.c index cdf602b2..f1fa3231 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1232,6 +1232,11 @@ cons_occupants_setting(void) else cons_show("Occupant jids (/occupants) : hide"); + if (prefs_get_boolean(PREF_OCCUPANTS_WRAP)) + cons_show("Occupants wrap (/occupants) : ON"); + else + cons_show("Occupants wrap (/occupants) : OFF"); + gint occupant_indent = prefs_get_occupants_indent(); cons_show("Occupant indent (/occupants) : %d", occupant_indent); diff --git a/src/ui/occupantswin.c b/src/ui/occupantswin.c index 2566f57f..e05a26ce 100644 --- a/src/ui/occupantswin.c +++ b/src/ui/occupantswin.c @@ -49,7 +49,9 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh GString *spaces = g_string_new(" "); int indent = prefs_get_occupants_indent(); + int current_indent = 0; if (indent > 0) { + current_indent += indent; while (indent > 0) { g_string_append(spaces, " "); indent--; @@ -59,8 +61,10 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh GString *msg = g_string_new(""); g_string_append(msg, spaces->str); + gboolean wrap = prefs_get_boolean(PREF_OCCUPANTS_WRAP); + g_string_append(msg, occupant->nick); - win_sub_print(layout->subwin, msg->str, TRUE, FALSE, 0); + win_sub_print(layout->subwin, msg->str, TRUE, wrap, current_indent); g_string_free(msg, TRUE); if (showjid && occupant->jid) { @@ -69,7 +73,7 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh g_string_append(msg, " "); g_string_append(msg, occupant->jid); - win_sub_print(layout->subwin, msg->str, TRUE, FALSE, 0); + win_sub_print(layout->subwin, msg->str, TRUE, wrap, current_indent); g_string_free(msg, TRUE); } -- cgit 1.4.1-2-gfad0 e65ddca37186c943abf49a03cf8c30'>themes/boothj5
blob: f148be6a89c8bf41c60e4b3fcdac496c840c9a00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[colours]
bkgnd=default
titlebar=blue
statusbar=blue
titlebar.text=white
titlebar.brackets=white
statusbar.text=white
statusbar.brackets=white
statusbar.active=black
statusbar.new=white
main.text=white
input.text=white
main.time=yellow
main.splash=red
online=green
away=cyan
chat=green
dnd=red
xa=cyan
offline=red
typing=yellow
gone=red
error=red
incoming=yellow
roominfo=blue
me=blue
them=green