new feature: support for merging screens together

This commit is contained in:
Andrzej Rybczak
2011-11-12 19:47:47 +01:00
parent e31dec7005
commit 56467eaac6
44 changed files with 633 additions and 218 deletions

View File

@@ -78,15 +78,18 @@ void SearchEngine::Init()
void SearchEngine::Resize()
{
w->Resize(COLS, MainHeight);
w->MoveTo(0, MainStartY);
w->SetTitle(Config.columns_in_search_engine && Config.titles_visibility ? Display::Columns() : "");
size_t x_offset, width;
GetWindowResizeParams(x_offset, width);
w->Resize(width, MainHeight);
w->MoveTo(x_offset, MainStartY);
w->SetTitle(Config.columns_in_search_engine && Config.titles_visibility ? Display::Columns(w->GetWidth()) : "");
hasToBeResized = 0;
}
void SearchEngine::SwitchTo()
{
using Global::myScreen;
using Global::myLockedScreen;
if (myScreen == this)
{
@@ -97,7 +100,10 @@ void SearchEngine::SwitchTo()
if (!isInitialized)
Init();
if (hasToBeResized)
if (myLockedScreen)
UpdateInactiveScreen(this);
if (hasToBeResized || myLockedScreen)
Resize();
if (w->Empty())
@@ -156,7 +162,7 @@ void SearchEngine::EnterPressed()
if (!w->Back().first)
{
if (Config.columns_in_search_engine)
w->SetTitle(Config.titles_visibility ? Display::Columns() : "");
w->SetTitle(Config.titles_visibility ? Display::Columns(w->GetWidth()) : "");
size_t found = w->Size()-SearchEngine::StaticOptions;
found += 3; // don't count options inserted below
w->InsertSeparator(ResetButton+1);