diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-15 00:43:53 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-15 00:43:53 +0200 |
commit | f7dba0a578d32677eebdeec76fa5c3204a933d20 (patch) | |
tree | aab8c3cd01bb09e660f5b7a6ef283a8c2431dfe8 /src/clock.cpp | |
parent | 5d535e920306f3e603473ed8cca94c146dd86084 (diff) |
make remaining single-windowed screens' main windows non-pointer
Diffstat (limited to 'src/clock.cpp')
-rw-r--r-- | src/clock.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/clock.cpp b/src/clock.cpp index aaf39860..2ff31a0c 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -56,8 +56,8 @@ Clock::Clock() { Width = Config.clock_display_seconds ? 60 : 40; - itsPane = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone); - w = new NC::Window((COLS-Width)/2, (MainHeight-Height)/2+MainStartY, Width, Height-1, "", Config.main_color, NC::Border(Config.main_color)); + m_pane = NC::Window(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone); + w = NC::Window((COLS-Width)/2, (MainHeight-Height)/2+MainStartY, Width, Height-1, "", Config.main_color, NC::Border(Config.main_color)); } void Clock::resize() @@ -66,12 +66,12 @@ void Clock::resize() getWindowResizeParams(x_offset, width); // used for clearing area out of clock window while resizing terminal - itsPane->resize(width, MainHeight); - itsPane->moveTo(x_offset, MainStartY); - itsPane->refresh(); + m_pane.resize(width, MainHeight); + m_pane.moveTo(x_offset, MainStartY); + m_pane.refresh(); if (Width <= width && Height <= MainHeight) - w->moveTo(x_offset+(width-Width)/2, MainStartY+(MainHeight-Height)/2); + w.moveTo(x_offset+(width-Width)/2, MainStartY+(MainHeight-Height)/2); } void Clock::switchTo() @@ -102,10 +102,10 @@ void Clock::switchTo() myScreen = this; drawHeader(); Prepare(); - itsPane->refresh(); + m_pane.refresh(); // clearing screen apparently fixes the problem with last digits being misrendered - w->clear(); - w->display(); + w.clear(); + w.display(); } std::wstring Clock::title() @@ -115,7 +115,7 @@ std::wstring Clock::title() void Clock::update() { - if (Width > itsPane->getWidth() || Height > MainHeight) + if (Width > m_pane.getWidth() || Height > MainHeight) { using Global::myLockedScreen; using Global::myInactiveScreen; @@ -145,7 +145,7 @@ void Clock::update() 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); + mvprintw(w.getStarty()+w.getHeight(), w.getStartX()+(w.getWidth()-strlen(buf))/2, "%s", buf); attroff(COLOR_PAIR(Config.main_color)); refresh(); @@ -155,7 +155,7 @@ void Clock::update() next[k] = 0; for (int s = 1; s >= 0; --s) { - *w << (s ? NC::fmtReverse : NC::fmtReverseEnd); + w << (s ? NC::fmtReverse : NC::fmtReverseEnd); for (int i = 0; i < 6; ++i) { long a = (newer[i] ^ older[i]) & (s ? newer : older)[i]; @@ -168,10 +168,10 @@ void Clock::update() { if (!(a & (t << 1))) { - w->goToXY(2*j+2, i); + w.goToXY(2*j+2, i); } if (Config.clock_display_seconds || j < 18) - *w << " "; + w << " "; } } } @@ -182,7 +182,7 @@ void Clock::update() } } } - w->refresh(); + w.refresh(); } void Clock::Prepare() |