Add transparent overlay window (#4746)

This commit is contained in:
nerix
2024-10-06 12:54:24 +02:00
committed by GitHub
parent 9ba7ef324d
commit afa8067a20
40 changed files with 1464 additions and 190 deletions
+32
View File
@@ -16,6 +16,7 @@
#include "widgets/FramelessEmbedWindow.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/OverlayWindow.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include "widgets/Window.hpp"
@@ -544,6 +545,37 @@ void WindowManager::queueSave()
this->saveTimer->start(10s);
}
void WindowManager::toggleAllOverlayInertia()
{
// check if any window is not inert
bool anyNonInert = false;
for (auto *window : this->windows_)
{
if (anyNonInert)
{
break;
}
window->getNotebook().forEachSplit([&](auto *split) {
auto *overlay = split->overlayWindow();
if (overlay)
{
anyNonInert = anyNonInert || !overlay->isInert();
}
});
}
for (auto *window : this->windows_)
{
window->getNotebook().forEachSplit([&](auto *split) {
auto *overlay = split->overlayWindow();
if (overlay)
{
overlay->setInert(anyNonInert);
}
});
}
}
void WindowManager::encodeTab(SplitContainer *tab, bool isSelected,
QJsonObject &obj)
{