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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64 attrs = COLOR_PAIR(BOX_COLOR_WHITE_ON_BLACK);
|
|
||||||
|
|
||||||
WINDOW* contents = this->GetContent();
|
WINDOW* contents = this->GetContent();
|
||||||
|
|
||||||
for (size_t i = 0; i < pending.size(); i++) {
|
for (size_t i = 0; i < pending.size(); i++) {
|
||||||
|
int64 attrs = COLOR_PAIR(BOX_COLOR_WHITE_ON_BLACK);
|
||||||
|
|
||||||
LogEntry* entry = pending[i];
|
LogEntry* entry = pending[i];
|
||||||
|
|
||||||
switch (entry->level) {
|
switch (entry->level) {
|
||||||
|
@ -8,6 +8,12 @@ typedef IScrollAdapter::ScrollPosition ScrollPos;
|
|||||||
|
|
||||||
size_t ListWindow::NO_SELECTION = (size_t) -1;
|
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)
|
ListWindow::ListWindow(IWindow *parent)
|
||||||
: ScrollableWindow(parent) {
|
: ScrollableWindow(parent) {
|
||||||
this->selectedIndex = (size_t) -1;
|
this->selectedIndex = (size_t) -1;
|
||||||
@ -30,11 +36,14 @@ void ListWindow::ScrollToBottom() {
|
|||||||
this->Repaint();
|
this->Repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ListWindow::Blur() {
|
||||||
|
ScrollableWindow::Blur();
|
||||||
|
REDRAW_VISIBLE_PAGE();
|
||||||
|
}
|
||||||
|
|
||||||
void ListWindow::Focus() {
|
void ListWindow::Focus() {
|
||||||
GetScrollAdapter().DrawPage(
|
ScrollableWindow::Focus();
|
||||||
this->GetContent(),
|
REDRAW_VISIBLE_PAGE();
|
||||||
this->scrollPosition.firstVisibleEntryIndex,
|
|
||||||
&this->scrollPosition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListWindow::ScrollUp(int delta) {
|
void ListWindow::ScrollUp(int delta) {
|
||||||
|
@ -22,7 +22,9 @@ namespace cursespp {
|
|||||||
virtual void ScrollDown(int delta = 1);
|
virtual void ScrollDown(int delta = 1);
|
||||||
virtual void PageUp();
|
virtual void PageUp();
|
||||||
virtual void PageDown();
|
virtual void PageDown();
|
||||||
|
|
||||||
virtual void Focus();
|
virtual void Focus();
|
||||||
|
virtual void Blur();
|
||||||
|
|
||||||
virtual size_t GetSelectedIndex();
|
virtual size_t GetSelectedIndex();
|
||||||
|
|
||||||
@ -38,4 +40,4 @@ namespace cursespp {
|
|||||||
IScrollAdapter::ScrollPosition scrollPosition;
|
IScrollAdapter::ScrollPosition scrollPosition;
|
||||||
size_t selectedIndex;
|
size_t selectedIndex;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user