summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2009-01-30 19:01:22 +0100
committerAndrzej Rybczak <electricityispower@gmail.com>2009-01-30 19:01:22 +0100
commit791daa1f7eee6ea51c500063e812ad5220753bbb (patch)
tree861e4272b9e003ae19dee9befb2fb463d42e409b /src
parent4ce83854a2a0f0a44b92408b96252bf90bd09920 (diff)
clear window only if last element is deleted
Diffstat (limited to 'src')
-rw-r--r--src/menu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/menu.h b/src/menu.h
index 862205e8..b5b78c74 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -234,6 +234,8 @@ template <class T> void Menu<T>::DeleteOption(size_t pos)
return;
delete itsOptions.at(pos).Item;
itsOptions.erase(itsOptions.begin()+pos);
+ if (itsOptions.empty())
+ Window::Clear();
}
template <class T> void Menu<T>::IntoSeparator(size_t pos)
@@ -262,7 +264,7 @@ template <class T> void Menu<T>::Refresh()
{
if (itsOptions.empty())
{
- Window::Clear();
+ Window::Refresh();
return;
}
int MaxBeginning = itsOptions.size() < itsHeight ? 0 : itsOptions.size()-itsHeight;