Mercurial > pidgin.yaz
comparison finch/libgnt/gntws.c @ 21250:9187d331aebe
Add gnt_color_pair, which will replace color codes with 'appropriate' text
attributes if the terminal doesn't support color. Fixes #3560.
I have included the output of diffstat of the changeset. Do we like this in
our commit message? If we do, we can use the stuff rekkanoryo has for gf.
----------------------------------------------------------------------
ChangeLog.API | 7 +++++++
finch/libgnt/gntbox.c | 10 +++++-----
finch/libgnt/gntbutton.c | 3 ++-
finch/libgnt/gntcheckbox.c | 4 ++--
finch/libgnt/gntcolors.c | 11 +++++++++++
finch/libgnt/gntcolors.h | 13 +++++++++++++
finch/libgnt/gntcombobox.c | 8 ++++----
finch/libgnt/gntentry.c | 4 ++--
finch/libgnt/gntline.c | 4 ++--
finch/libgnt/gntmain.c | 4 ++--
finch/libgnt/gntmenu.c | 4 ++--
finch/libgnt/gntslider.c | 10 +++++-----
finch/libgnt/gnttextview.c | 14 +++++++-------
finch/libgnt/gnttree.c | 37 ++++++++++++++++++-------------------
finch/libgnt/gntwidget.c | 22 +++++++++++-----------
finch/libgnt/gntwm.c | 4 ++--
finch/libgnt/gntws.c | 10 +++++-----
17 files changed, 100 insertions(+), 69 deletions(-)
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 16 Oct 2007 09:51:12 +0000 |
parents | e16d097c5739 |
children | bec28e60aff6 |
comparison
equal
deleted
inserted
replaced
21249:930d0b49ebcf | 21250:9187d331aebe |
---|---|
43 } else if (reposition) { | 43 } else if (reposition) { |
44 int Y_MAX = getmaxy(stdscr) - 1; | 44 int Y_MAX = getmaxy(stdscr) - 1; |
45 mvwin(taskbar, Y_MAX, 0); | 45 mvwin(taskbar, Y_MAX, 0); |
46 } | 46 } |
47 | 47 |
48 wbkgdset(taskbar, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); | 48 wbkgdset(taskbar, '\0' | gnt_color_pair(GNT_COLOR_NORMAL)); |
49 werase(taskbar); | 49 werase(taskbar); |
50 | 50 |
51 n = g_list_length(ws->list); | 51 n = g_list_length(ws->list); |
52 if (n) | 52 if (n) |
53 width = getmaxx(stdscr) / n; | 53 width = getmaxx(stdscr) / n; |
64 /* This is a window with the URGENT hint set */ | 64 /* This is a window with the URGENT hint set */ |
65 color = GNT_COLOR_URGENT; | 65 color = GNT_COLOR_URGENT; |
66 } else { | 66 } else { |
67 color = GNT_COLOR_NORMAL; | 67 color = GNT_COLOR_NORMAL; |
68 } | 68 } |
69 wbkgdset(taskbar, '\0' | COLOR_PAIR(color)); | 69 wbkgdset(taskbar, '\0' | gnt_color_pair(color)); |
70 if (iter->next) | 70 if (iter->next) |
71 mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), width); | 71 mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), width); |
72 else | 72 else |
73 mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), getmaxx(stdscr) - width * i); | 73 mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), getmaxx(stdscr) - width * i); |
74 title = GNT_BOX(w)->title; | 74 title = GNT_BOX(w)->title; |
75 mvwprintw(taskbar, 0, width * i, "%s", title ? title : "<gnt>"); | 75 mvwprintw(taskbar, 0, width * i, "%s", title ? title : "<gnt>"); |
76 if (i) | 76 if (i) |
77 mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | COLOR_PAIR(GNT_COLOR_NORMAL)); | 77 mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | gnt_color_pair(GNT_COLOR_NORMAL)); |
78 } | 78 } |
79 wrefresh(taskbar); | 79 wrefresh(taskbar); |
80 } | 80 } |
81 | 81 |
82 static void | 82 static void |