diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2009-01-30 19:01:22 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2009-01-30 19:01:22 +0100 |
commit | 791daa1f7eee6ea51c500063e812ad5220753bbb (patch) | |
tree | 861e4272b9e003ae19dee9befb2fb463d42e409b /src | |
parent | 4ce83854a2a0f0a44b92408b96252bf90bd09920 (diff) |
clear window only if last element is deleted
Diffstat (limited to 'src')
-rw-r--r-- | src/menu.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |