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