summaryrefslogtreecommitdiff
path: root/src/menu.cpp
diff options
context:
space:
mode:
authorunknown <unknown@localhost.(none)>2008-08-19 17:14:11 +0200
committerunknown <unknown@localhost.(none)>2008-08-19 17:14:11 +0200
commit9f12f997064502dc71d3ee987c16e07c7908b576 (patch)
tree23be2ed253336214c7ca02fbbdaa8b33f192f27c /src/menu.cpp
parentb43e3577f21a1540d71bc1c779c782330264cf58 (diff)
more fixes, config options, keybindings, case insensitive sorting in browser
Diffstat (limited to 'src/menu.cpp')
-rw-r--r--src/menu.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 9bb5000d..c719643b 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -278,10 +278,12 @@ void Menu::Refresh(bool redraw_whole_window)
}
int line = *it-itsBeginning;
+ COLOR old_basecolor = itsBaseColor;
if (*it == itsHighlight && itsHighlightEnabled)
{
Reverse(1);
+ SetBaseColor(itsHighlightColor);
SetColor(itsHighlightColor);
}
if (itsOptions[*it]->is_bold)
@@ -320,12 +322,9 @@ void Menu::Refresh(bool redraw_whole_window)
}
# ifdef UTF8_ENABLED
- wstring option = ToWString(itsOptions[*it]->content);
- int bbcodes_length = CountBBCodes(option);
- WriteXY(x, line, option.substr(0, itsWidth+bbcodes_length), 0);
+ WriteXY(x, line, itsWidth, ToWString(itsOptions[*it]->content), 0);
# else
- int bbcodes_length = CountBBCodes(itsOptions[*it]->content);
- WriteXY(x, line, itsOptions[*it]->content.substr(0, itsWidth+bbcodes_length), 0);
+ WriteXY(x, line, itsWidth, itsOptions[*it]->content, 0);
# endif
if (!ch && (itsOptions[*it]->location == lCenter || itsOptions[*it]->location == lLeft))
@@ -339,11 +338,13 @@ void Menu::Refresh(bool redraw_whole_window)
line++;
if (*it == itsHighlight && itsHighlightEnabled)
+ {
Reverse(0);
+ SetBaseColor(old_basecolor);
+ SetColor(old_basecolor);
+ }
if (itsOptions[*it]->is_bold)
Bold(0);
-
- SetColor(itsBaseColor);
}
NeedsRedraw.clear();
wrefresh(itsWindow);
@@ -488,11 +489,13 @@ void Menu::Highlight(int which)
else
return;
- if (which >= itsHeight)
+ if (which >= itsHeight/2)
{
itsBeginning = itsHighlight-itsHeight/2;
if (itsBeginning > itsOptions.size()-itsHeight)
itsBeginning = itsOptions.size()-itsHeight;
+ if (itsBeginning < 0)
+ itsBeginning = 0;
}
else
itsBeginning = 0;
@@ -522,6 +525,7 @@ void Menu::Highlight(int which)
void Menu::Reset()
{
+ NeedsRedraw.clear();
itsHighlight = 0;
itsBeginning = 0;
}