Another potential fix for the BSD scrollbar issue.

This commit is contained in:
casey langen 2017-12-24 18:03:52 -08:00
parent 23eae5a765
commit 394eca93c8

View File

@ -36,11 +36,7 @@
#include <algorithm>
#include "ListWindow.h"
#ifdef WIN32
#define SCROLLER 0x258A
#else
#define SCROLLER (' ' | A_REVERSE)
#endif
#define WIN32_SCROLLER 0x258A
using namespace cursespp;
@ -95,16 +91,17 @@ void ListWindow::DecorateFrame() {
}
auto frame = this->GetFrame();
int x = getcurx(frame);
int y = getcury(frame);
for (int i = 1; i < height - 1; i++) {
chtype ch = (i == offset) ? SCROLLER : ACS_VLINE;
wmove(frame, i, this->GetWidth() - 1);
waddch(frame, ch);
#ifdef WIN32
waddch(frame, (i == offset) ? WIN32_SCROLLER : ACS_VLINE);
#else
if (i == offset) wattron(frame, A_REVERSE);
waddch(frame, (i == offset) ? ' ' : ACS_VLINE);
if (i == offset) wattroff(frame, A_REVERSE);
#endif
}
wmove(frame, y, x);
}
}
}