summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 601ad84)
raw | patch | inline | side by side (parent: 601ad84)
author | Kalle Wallin <kaw@linux.se> | |
Mon, 7 Jun 2004 21:42:49 +0000 (21:42 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Mon, 7 Jun 2004 21:42:49 +0000 (21:42 +0000) |
ChangeLog | patch | blob | history | |
src/screen_clock.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index f97ef56c8ab859c99df9bfa1234dff04ccfc8d85..5b42582434148b7c36e10d2f1c37ed2125b8510c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2004-06-07 Kalle Wallin <kaw@linux.se>
- * configure.ac: disable nls if glib is pre 2.4
- * mpc.c: added support for the PLCHANGES command
+ * configure.ac: disable nls if glib is pre 2.4
+ * mpc.c: added support for the PLCHANGES command
+ * screen_clock.c: fixed resize handling
2004-06-06 Kalle Wallin <kaw@linux.se>
* i18n: ncmpc is now bilingual (sv)
diff --git a/src/screen_clock.c b/src/screen_clock.c
index 57dcac058c297b18daedb787d8e1b9f5e80e2e8c..459d9e4b9a5e5d29528c4dfcca710faac31022ec 100644 (file)
--- a/src/screen_clock.c
+++ b/src/screen_clock.c
XBASE = (cols-XLENGTH)/2;
- YBASE = (rows-YDEPTH)/2-(YDEPTH/2);
+ YBASE = (rows-YDEPTH)/2-(YDEPTH/2)+2;
}
static void
long t, a;
int i, j, s, k;
char buf[BUFSIZE];
-
+
time(&now);
tm = localtime(&now);
+
+ if( win.rows<=YDEPTH+1 || win.cols<=XLENGTH+1 )
+ {
+ strftime(buf, BUFSIZE, "%X ",tm);
+ mvwaddstr(win.w, win.rows ? win.rows/2:0, (win.cols-strlen(buf))/2, buf);
+ wrefresh(win.w);
+ return;
+ }
+
+
mask = 0;
set(tm->tm_sec % 10, 0);