Skip to content

Commit ee7bcb7

Browse files
committed
Made MenuItemCheckbox get drawn with <> if highlighted
1 parent 3d7b5b4 commit ee7bcb7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/Interface/Menu/MenuItemCheckbox.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ MenuItemCheckbox::MenuItemCheckbox(std::string label, int id, bool initial):
1111

1212
void MenuItemCheckbox::draw(Window* window, int x, int y, int width, bool hilite)
1313
{
14+
// Will draw
15+
// label text
16+
// If not hilite.
17+
// If hilite:
18+
// label < text >
1419
MenuItem::draw(window, x, y, width - 9, hilite); // button width
1520

1621
int posx = x + width;
1722

18-
window->print("[", posx - 8, y, Globals::Theme::text);
23+
window->print(((hilite)?
24+
"<":
25+
"["),
26+
posx - 8, y,
27+
((hilite)?
28+
Globals::Theme::hilite_text:
29+
Globals::Theme::text));
1930

2031
window->print("ON", posx - 7, y, ((this->checked) ?
2132
Globals::Theme::hilite_text:
@@ -27,7 +38,13 @@ void MenuItemCheckbox::draw(Window* window, int x, int y, int width, bool hilite
2738
Globals::Theme::text :
2839
Globals::Theme::hilite_text));
2940

30-
window->print("]", posx - 1, y, Globals::Theme::text);
41+
window->print(((hilite)?
42+
">":
43+
"]"),
44+
posx - 1, y,
45+
((hilite)?
46+
Globals::Theme::hilite_text:
47+
Globals::Theme::text));
3148
}
3249
void MenuItemCheckbox::handleInput()
3350
{

0 commit comments

Comments
 (0)