Commit e7c1fe60 authored by Fabian Affolter's avatar Fabian Affolter Committed by Sören Tempel
Browse files

main/mcabber: fix colors

Fixes #8757
parent bf402a06
......@@ -2,7 +2,7 @@
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=mcabber
pkgver=1.1.0
pkgrel=1
pkgrel=2
pkgdesc="A small Jabber console client"
url="https://mcabber.com"
arch="all"
......@@ -12,7 +12,8 @@ options="libtool"
makedepends="loudmouth-dev glib-dev ncurses-dev gpgme-dev aspell-dev
libotr3-dev libidn-dev enchant-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://mcabber.com/files/$pkgname-$pkgver.tar.bz2"
source="https://mcabber.com/files/$pkgname-$pkgver.tar.bz2
fix-roster-colors-on-freebsd.patch"
builddir="$srcdir/$pkgname-$pkgver"
build() {
......@@ -41,4 +42,5 @@ package() {
|| return 1
}
sha512sums="d12546e9fe9da94b6107f4d38d4083bee74e2702f7f2225e26be291230c6fe1319f60a3204da669dc00b14d69822425bf8214ebb723c3c4a7a33b1247a03093f mcabber-1.1.0.tar.bz2"
sha512sums="d12546e9fe9da94b6107f4d38d4083bee74e2702f7f2225e26be291230c6fe1319f60a3204da669dc00b14d69822425bf8214ebb723c3c4a7a33b1247a03093f mcabber-1.1.0.tar.bz2
e8a1207eb04497b4e6ddfc5b6a55c9d6e07094504f472c4b643eeee1adfd81a1b38d64b82d8fec51d4bba757ca2e377f2e339a13f76c8ea0744a28ab3acc18a0 fix-roster-colors-on-freebsd.patch"
Without this patch colors in mcabber do not work on Alpine (and
apparently also on FreeBSD).
The patch was taken from: https://bitbucket.org/McKael/mcabber-crew/issues/60/
diff --git a/mcabber/mcabber/screen.c b/mcabber/mcabber/screen.c
--- a/mcabber/screen.c
+++ b/mcabber/screen.c
@@ -1159,7 +1159,7 @@ static void scr_update_window(winbuf *wi
color = COLOR_GENERAL;
if (color != COLOR_GENERAL)
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
// Generate the prefix area and display it
scr_line_prefix(line, pref, prefixwidth);
@@ -1215,12 +1215,12 @@ static void scr_update_window(winbuf *wi
if (actual && ((type == MC_ALL) || (actual->manual))
&& (line->flags & HBB_PREFIX_IN) &&
(!(line->flags & HBB_PREFIX_HLIGHT_OUT)))
- wattrset(win_entry->win, compose_color(actual->color));
+ wbkgdset(win_entry->win, compose_color(actual->color));
wprintw(win_entry->win, "%s", line->text);
// Return the char
line->text[line->mucnicklen] = tmp;
// Return the color back
- wattrset(win_entry->win, get_color(color));
+ wbkgdset(win_entry->win, get_color(color));
}
// Display text line
@@ -1229,7 +1229,7 @@ static void scr_update_window(winbuf *wi
// Return the color back
if (color != COLOR_GENERAL)
- wattrset(win_entry->win, get_color(COLOR_GENERAL));
+ wbkgdset(win_entry->win, get_color(COLOR_GENERAL));
g_free(line->text);
g_free(line);
@@ -1879,7 +1879,7 @@ void scr_draw_roster(void)
if (Roster_Width) {
int line_x_pos = roster_win_on_right ? 0 : Roster_Width-1;
// Redraw the vertical line (not very good...)
- wattrset(rosterWnd, get_color(COLOR_GENERAL));
+ wbkgdset(rosterWnd, get_color(COLOR_GENERAL));
for (i=0 ; i < CHAT_WIN_HEIGHT ; i++)
mvwaddch(rosterWnd, i, line_x_pos, ACS_VLINE);
}
@@ -1977,16 +1977,16 @@ void scr_draw_roster(void)
}
if (buddy == current_buddy) {
if (pending == '#')
- wattrset(rosterWnd, get_color(COLOR_ROSTERSELNMSG));
- else
- wattrset(rosterWnd, get_color(COLOR_ROSTERSEL));
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERSELNMSG));
+ else
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERSEL));
// The 3 following lines aim at coloring the whole line
wmove(rosterWnd, i, x_pos);
for (n = 0; n < maxx; n++)
waddch(rosterWnd, ' ');
} else {
if (pending == '#')
- wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG));
+ wbkgdset(rosterWnd, get_color(COLOR_ROSTERNMSG));
else {
int color = get_color(COLOR_ROSTER);
if ((!isspe) && (!isgrp)) { // Look for color rules
@@ -2001,7 +2001,7 @@ void scr_draw_roster(void)
}
}
}
- wattrset(rosterWnd, color);
+ wbkgdset(rosterWnd, color);
}
}
@@ -2055,6 +2055,8 @@ void scr_draw_roster(void)
i++;
}
+ wbkgdset(rosterWnd, get_color(COLOR_GENERAL));
+
g_free(rline);
g_free(name);
top_panel(inputPanel);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment