unused defines cleaning / a few fixes for clock

This commit is contained in:
Andrzej Rybczak
2009-02-19 00:59:02 +01:00
parent 7246b57d48
commit 164dec3eed
6 changed files with 14 additions and 11 deletions

View File

@@ -24,6 +24,8 @@
#ifdef ENABLE_CLOCK
#include <cstring>
#include "global.h"
#include "playlist.h"
#include "settings.h"
@@ -42,12 +44,14 @@ short Clock::disp[11] =
long Clock::older[6], Clock::next[6], Clock::newer[6], Clock::mask;
const size_t Clock::Width = Config.clock_display_seconds ? 60 : 40;
size_t Clock::Width;
const size_t Clock::Height = 8;
void Clock::Init()
{
w = new Scrollpad((COLS-Width)/2, (LINES-Height)/2, Width, Height-1, "", Config.main_color, Border(Config.main_color));
Width = Config.clock_display_seconds ? 60 : 40;
w = new Window((COLS-Width)/2, (LINES-Height)/2, Width, Height-1, "", Config.main_color, Border(Config.main_color));
w->SetTimeout(ncmpcpp_window_timeout);
}
@@ -111,7 +115,7 @@ void Clock::Update()
Set(10, 7);
Set(10, 17);
char buf[54];
char buf[64];
strftime(buf, 64, "%x", time);
attron(COLOR_PAIR(Config.main_color));
mvprintw(w->GetStartY()+w->GetHeight(), w->GetStartX()+(w->GetWidth()-strlen(buf))/2, "%s", buf);