From 791daa1f7eee6ea51c500063e812ad5220753bbb Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 30 Jan 2009 19:01:22 +0100 Subject: clear window only if last element is deleted --- src/menu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 void Menu::DeleteOption(size_t pos) return; delete itsOptions.at(pos).Item; itsOptions.erase(itsOptions.begin()+pos); + if (itsOptions.empty()) + Window::Clear(); } template void Menu::IntoSeparator(size_t pos) @@ -262,7 +264,7 @@ template void Menu::Refresh() { if (itsOptions.empty()) { - Window::Clear(); + Window::Refresh(); return; } int MaxBeginning = itsOptions.size() < itsHeight ? 0 : itsOptions.size()-itsHeight; -- cgit v1.2.3