aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-07 21:42:49 +0000
committerKalle Wallin <kaw@linux.se>2004-06-07 21:42:49 +0000
commit6a71f6f90e558829598a874aa94eed14ce196a5f (patch)
tree6e5ead62c9d7e9bfd8db9f7afcf5b199aa31c07e
parent601ad84555b402329b9385292e2da3f6ead03973 (diff)
downloadmpd-6a71f6f90e558829598a874aa94eed14ce196a5f.tar.gz
mpd-6a71f6f90e558829598a874aa94eed14ce196a5f.tar.xz
mpd-6a71f6f90e558829598a874aa94eed14ce196a5f.zip
Fixed resize handling
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1381 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--ChangeLog5
-rw-r--r--src/screen_clock.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f97ef56c8..5b4258243 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
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 57dcac058..459d9e4b9 100644
--- a/src/screen_clock.c
+++ b/src/screen_clock.c
@@ -117,7 +117,7 @@ clock_resize(int cols, int rows)
XBASE = (cols-XLENGTH)/2;
- YBASE = (rows-YDEPTH)/2-(YDEPTH/2);
+ YBASE = (rows-YDEPTH)/2-(YDEPTH/2)+2;
}
static void
@@ -161,9 +161,19 @@ clock_update(screen_t *screen, mpd_client_t *c)
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);