[ekg2-commit] ekg2: main.c (HEAD) old.c (HEAD) old.h (HEAD) [peres]
CVS commit
cvs w toxygen.net
Czw, 17 Sty 2008, 17:35:39 CET
Module name: ekg2
Changes by: peres 2008-01-17 17:35:37
Modified files:
main.c old.c old.h
Log message:
Adding ncurses:text_bottomalign, idea by dmilith, solution by darkjames.
If set to 1, text is aligned to bottom in non-floating windows. If set to
2, then it's aligned in all windows (including contacts).
Index: main.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/ncurses/main.c,v
diff -d -u -r1.108 -r1.109
--- main.c 30 Dec 2007 16:50:30 -0000 1.108
+++ main.c 17 Jan 2008 16:35:36 -0000 1.109
@@ -54,6 +54,7 @@
int config_statusbar_size;
int config_lastlog_size;
int config_lastlog_lock;
+int config_text_bottomalign = 0;
int config_typing_interval = 1;
int config_typing_timeout = 10;
int config_typing_timeout_empty = 5;
@@ -675,6 +676,8 @@
variable_add(&ncurses_plugin, ("kill_irc_window"), VAR_BOOL, 1, &config_kill_irc_window, NULL, NULL, NULL);
variable_add(&ncurses_plugin, ("margin_size"), VAR_INT, 1, &config_margin_size, NULL, NULL, NULL);
variable_add(&ncurses_plugin, ("statusbar_size"), VAR_INT, 1, &config_statusbar_size, header_statusbar_resize, NULL, NULL);
+ variable_add(&ncurses_plugin, ("text_bottomalign"), VAR_INT, 1, &config_text_bottomalign, NULL,
+ variable_map(3, 0, 0, "off", 1, 2, "except-floating", 2, 1, "all"), NULL);
variable_add(&ncurses_plugin, ("typing_interval"), VAR_INT, 1, &config_typing_interval, ncurses_typing_retimer, NULL, NULL);
variable_add(&ncurses_plugin, ("typing_timeout"), VAR_INT, 1, &config_typing_timeout, NULL, NULL, NULL);
Index: old.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/ncurses/old.c,v
diff -d -u -r1.168 -r1.169
--- old.c 26 Dec 2007 20:30:11 -0000 1.168
+++ old.c 17 Jan 2008 16:35:36 -0000 1.169
@@ -965,6 +965,13 @@
if (n->start < 0)
n->start = 0;
+ if (config_text_bottomalign && (!w->floating || config_text_bottomalign == 2)
+ && n->start == 0 && n->lines_count < height) {
+ const int tmp = height - n->lines_count;
+
+ if (tmp > top)
+ top = tmp;
+ }
for (y = 0; y < height && n->start + y < n->lines_count; y++) {
struct screen_line *l = &n->lines[n->start + y];
unsigned int x_real = 0;
Index: old.h
===================================================================
RCS file: /home/cvs/ekg2/plugins/ncurses/old.h,v
diff -d -u -r1.38 -r1.39
--- old.h 8 Oct 2007 07:42:27 -0000 1.38
+++ old.h 17 Jan 2008 16:35:36 -0000 1.39
@@ -151,6 +151,7 @@
extern int config_statusbar_size;
extern int config_kill_irc_window;
+extern int config_text_bottomalign;
extern int config_typing_timeout;
extern int config_typing_timeout_empty;
Więcej informacji o liście dyskusyjnej ekg2-commit