Skip to content

Commit

Permalink
Hacky fix to right-aligned lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Whales committed Aug 13, 2014
1 parent 11eb536 commit 8617249
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cuss.cpp
Expand Up @@ -274,7 +274,15 @@ void ele_list::draw(Window *win)
if (!selected)
hilite = bg;
if (align == ALIGN_RIGHT) {
win->putstr_r(posx, ypos, fg, hilite, sizex, (*list)[index]);
/* If it's selectable, we need an extra space at the end to compensate for the
* scroll bar; otherwise the scroll bar will cover up the last name in the list.
* This is hacky but it's good enough for now.
*/
if (selectable) {
win->putstr_r(posx, ypos, fg, hilite, sizex, (*list)[index] + " ");
} else {
win->putstr_r(posx, ypos, fg, hilite, sizex, (*list)[index]);
}
} else if (align == ALIGN_CENTER) {
win->putstr_c(posx, ypos, fg, hilite, sizex, (*list)[index]);
} else {
Expand Down

0 comments on commit 8617249

Please sign in to comment.