mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Fixed redraw issue on non-Windows platforms when ListWindow is blurred.
This commit is contained in:
parent
7220617db0
commit
05c36ef76b
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user