Persisted panel and pane states

This commit is contained in:
Nav
2022-02-06 20:28:46 +00:00
parent 7e992f781e
commit 3dcdc4b90b
14 changed files with 434 additions and 253 deletions

View File

@@ -6,6 +6,8 @@
#include <QMouseEvent>
#include <QEnterEvent>
#include "PanelState.hpp"
namespace Bloom::Widgets
{
Q_NAMESPACE
@@ -37,6 +39,8 @@ namespace Bloom::Widgets
void setPanelType(PanelWidgetType panelType);
void setSize(int size);
[[nodiscard]] int getHandleSize() const {
return this->handleSize;
}
@@ -53,6 +57,13 @@ namespace Bloom::Widgets
return this->panelType;
}
PanelState getCurrentState() {
return PanelState(
this->panelType == PanelWidgetType::LEFT ? this->width() : this->height(),
this->isVisible()
);
}
protected:
int handleSize = 10;
int minimumResize = 10;