Compare commits
No commits in common. "ba378b2a43ecf7bece799ed155f30b0844769d59" and "f48641bb58bc6f8c349ba71bd3ede701af8e5b66" have entirely different histories.
ba378b2a43
...
f48641bb58
|
@ -130,10 +130,6 @@ 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;
|
||||||
|
|
|
@ -27,11 +27,6 @@ namespace krikkel::NCurses
|
||||||
visibleStack.push_back(stackElement);
|
visibleStack.push_back(stackElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::recursive_mutex *TilingWindowManager::getNCursesMutex()
|
|
||||||
{
|
|
||||||
return ncursesMutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TilingWindowManager::hideWindow(Window *window)
|
void TilingWindowManager::hideWindow(Window *window)
|
||||||
{
|
{
|
||||||
if(window->hidden)
|
if(window->hidden)
|
||||||
|
@ -65,27 +60,6 @@ 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);
|
||||||
|
|
|
@ -36,19 +36,15 @@ namespace krikkel::NCurses
|
||||||
typedef std::pair<Window *, windowDimension> WindowStackElement;
|
typedef std::pair<Window *, windowDimension> WindowStackElement;
|
||||||
|
|
||||||
TilingWindowManager(NCursesWindow *rootWindow, std::recursive_mutex *ncursesMutex);
|
TilingWindowManager(NCursesWindow *rootWindow, std::recursive_mutex *ncursesMutex);
|
||||||
std::recursive_mutex *getNCursesMutex();
|
|
||||||
void addWindow(Window *window, windowDimension size = -1);
|
void addWindow(Window *window, windowDimension size = -1);
|
||||||
|
|
||||||
int resize(int rows, int cols) override;
|
int resize(int rows, int cols) override;
|
||||||
int refresh() override;
|
int refresh() override;
|
||||||
void updateLayout();
|
void updateLayout();
|
||||||
|
|
||||||
void hideWindow(Window *window);
|
void hideWindow(Window *window);
|
||||||
void showWindow(Window *window);
|
void showWindow(Window *window);
|
||||||
void invertWindowsVisibility();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// @todo rename to `nCursesMutex`?
|
|
||||||
std::recursive_mutex *ncursesMutex;
|
std::recursive_mutex *ncursesMutex;
|
||||||
std::list<WindowStackElement> stack, visibleStack;
|
std::list<WindowStackElement> stack, visibleStack;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue