Storing and restoring DetachedWindowState

This commit is contained in:
Nav
2022-07-19 22:31:36 +01:00
parent 5b53040190
commit f43c88f61a
5 changed files with 155 additions and 22 deletions

View File

@@ -1,11 +1,39 @@
#pragma once
#include <QSize>
#include <QPoint>
#include <optional>
namespace Bloom::Widgets
{
struct DetachedWindowState
{
QSize size;
QPoint position;
DetachedWindowState() = default;
DetachedWindowState(QSize size, QPoint position)
: size(size)
, position(position)
{}
};
struct PaneState
{
bool activated = false;
bool attached = true;
explicit PaneState(bool activated): activated(activated) {};
std::optional<DetachedWindowState> detachedWindowState;
PaneState(
bool activated,
bool attached,
std::optional<DetachedWindowState> detachedWindowState
)
: activated(activated)
, attached(attached)
, detachedWindowState(detachedWindowState)
{};
};
}