2022-06-24 13:46:25 -04:00
|
|
|
#include "panel.h"
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
Panel::Panel(QWidget *parent) :
|
|
|
|
QWidget{parent},
|
|
|
|
chunk_(nullptr)
|
2022-06-24 13:46:25 -04:00
|
|
|
{
|
2022-06-27 12:44:50 -04:00
|
|
|
outer_layout_ = new QVBoxLayout(this);
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
layout_ = new QGridLayout();
|
|
|
|
outer_layout_->addLayout(layout_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
void Panel::SetData(si::Chunk *chunk)
|
2022-06-24 13:46:25 -04:00
|
|
|
{
|
2022-06-27 12:44:50 -04:00
|
|
|
if (chunk_) {
|
|
|
|
OnClosingData(chunk_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
chunk_ = chunk;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
if (chunk_) {
|
|
|
|
OnOpeningData(chunk_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
}
|
2022-06-27 12:44:50 -04:00
|
|
|
|
|
|
|
void Panel::FinishLayout()
|
|
|
|
{
|
|
|
|
outer_layout_->addStretch();
|
|
|
|
}
|