incremental search and filter reintegrated!

This commit is contained in:
Hisham Muhammad
2015-03-23 17:04:53 -03:00
parent d0c72c3fb2
commit ade7993fcb
10 changed files with 63 additions and 43 deletions

View File

@ -156,11 +156,16 @@ static void ScreenManager_drawPanels(ScreenManager* this, int focus) {
}
}
static Panel* setCurrentPanel(Panel* panel) {
FunctionBar_draw(panel->currentBar, NULL);
return panel;
}
void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
bool quit = false;
int focus = 0;
Panel* panelFocus = (Panel*) Vector_get(this->panels, focus);
Panel* panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
double oldTime = 0.0;
@ -180,7 +185,6 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
if (redraw) {
ScreenManager_drawPanels(this, focus);
FunctionBar_draw(panelFocus->currentBar, NULL);
}
int prevCh = ch;
@ -199,7 +203,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
mevent.y > panel->y && mevent.y <= panel->y+panel->h &&
(this->allowFocusChange || panelFocus == panel) ) {
focus = i;
panelFocus = panel;
panelFocus = setCurrentPanel(panel);
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
break;
}
@ -255,7 +259,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
tryLeft:
if (focus > 0)
focus--;
panelFocus = (Panel*) Vector_get(this->panels, focus);
panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
if (Panel_size(panelFocus) == 0 && focus > 0)
goto tryLeft;
break;
@ -267,7 +271,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
tryRight:
if (focus < this->panelCount - 1)
focus++;
panelFocus = (Panel*) Vector_get(this->panels, focus);
panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
if (Panel_size(panelFocus) == 0 && focus < this->panelCount - 1)
goto tryRight;
break;