Fixed redraw issue on non-Windows platforms when ListWindow is blurred.

This commit is contained in:
Casey Langen 2016-05-28 10:42:52 -07:00
parent 7220617db0
commit 05c36ef76b
3 changed files with 18 additions and 7 deletions

View File

@ -36,11 +36,11 @@ void LogWindow::Update() {
return;
}
int64 attrs = COLOR_PAIR(BOX_COLOR_WHITE_ON_BLACK);
WINDOW* contents = this->GetContent();
for (size_t i = 0; i < pending.size(); i++) {
int64 attrs = COLOR_PAIR(BOX_COLOR_WHITE_ON_BLACK);
LogEntry* entry = pending[i];
switch (entry->level) {

View File

@ -8,6 +8,12 @@ typedef IScrollAdapter::ScrollPosition ScrollPos;
size_t ListWindow::NO_SELECTION = (size_t) -1;
#define REDRAW_VISIBLE_PAGE() \
GetScrollAdapter().DrawPage( \
this->GetContent(), \
this->scrollPosition.firstVisibleEntryIndex, \
&this->scrollPosition); \
ListWindow::ListWindow(IWindow *parent)
: ScrollableWindow(parent) {
this->selectedIndex = (size_t) -1;
@ -30,11 +36,14 @@ void ListWindow::ScrollToBottom() {
this->Repaint();
}
void ListWindow::Blur() {
ScrollableWindow::Blur();
REDRAW_VISIBLE_PAGE();
}
void ListWindow::Focus() {
GetScrollAdapter().DrawPage(
this->GetContent(),
this->scrollPosition.firstVisibleEntryIndex,
&this->scrollPosition);
ScrollableWindow::Focus();
REDRAW_VISIBLE_PAGE();
}
void ListWindow::ScrollUp(int delta) {

View File

@ -22,7 +22,9 @@ namespace cursespp {
virtual void ScrollDown(int delta = 1);
virtual void PageUp();
virtual void PageDown();
virtual void Focus();
virtual void Blur();
virtual size_t GetSelectedIndex();