window manager: inverting all windows' visibility
Introducing a method that makes all visible windows invisible and vice- versa.
This commit is contained in:
parent
870fa80fc7
commit
ba378b2a43
|
@ -130,6 +130,10 @@ namespace krikkel::NCurses
|
||||||
windowManager->updateLayout();
|
windowManager->updateLayout();
|
||||||
windowManager->refresh();
|
windowManager->refresh();
|
||||||
break;
|
break;
|
||||||
|
case KEY_F(4):
|
||||||
|
windowManager->invertWindowsVisibility();
|
||||||
|
windowManager->updateLayout();
|
||||||
|
windowManager->refresh();
|
||||||
case KEY_F(5):
|
case KEY_F(5):
|
||||||
windowManager->refresh();
|
windowManager->refresh();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -65,6 +65,27 @@ namespace krikkel::NCurses
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TilingWindowManager::invertWindowsVisibility()
|
||||||
|
{
|
||||||
|
list<WindowStackElement> originallyVisibleStack(visibleStack);
|
||||||
|
list<WindowStackElement>::iterator originallyVisibleStackIterator = originallyVisibleStack.begin();
|
||||||
|
visibleStack.clear();
|
||||||
|
|
||||||
|
for(WindowStackElement currentWindowElement : stack)
|
||||||
|
if(originallyVisibleStackIterator != originallyVisibleStack.end()
|
||||||
|
&& currentWindowElement == *originallyVisibleStackIterator)
|
||||||
|
{
|
||||||
|
currentWindowElement.first->hidden = true;
|
||||||
|
++originallyVisibleStackIterator;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentWindowElement.first->hidden = false;
|
||||||
|
visibleStack.push_back(currentWindowElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int TilingWindowManager::resize(int rows, int cols)
|
int TilingWindowManager::resize(int rows, int cols)
|
||||||
{
|
{
|
||||||
int result = Window::resize(rows, cols);
|
int result = Window::resize(rows, cols);
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace krikkel::NCurses
|
||||||
|
|
||||||
void hideWindow(Window *window);
|
void hideWindow(Window *window);
|
||||||
void showWindow(Window *window);
|
void showWindow(Window *window);
|
||||||
|
void invertWindowsVisibility();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// @todo rename to `nCursesMutex`?
|
/// @todo rename to `nCursesMutex`?
|
||||||
|
|
Loading…
Reference in a new issue