Tidied PanelWidget::setSize()
This commit is contained in:
@@ -56,16 +56,16 @@ namespace Bloom::Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PanelWidget::setSize(int size) {
|
void PanelWidget::setSize(int size) {
|
||||||
|
size = std::min(std::max(size, this->minimumResize), this->maximumResize);
|
||||||
|
|
||||||
if (this->panelType == PanelWidgetType::LEFT) {
|
if (this->panelType == PanelWidgetType::LEFT) {
|
||||||
const auto width = std::min(std::max(size, this->minimumResize), this->maximumResize);
|
this->setFixedWidth(size);
|
||||||
this->setFixedWidth(width);
|
|
||||||
this->state.size = width;
|
|
||||||
|
|
||||||
} else if (this->panelType == PanelWidgetType::BOTTOM) {
|
} else if (this->panelType == PanelWidgetType::BOTTOM) {
|
||||||
const auto height = std::min(std::max(size, this->minimumResize), this->maximumResize);
|
this->setFixedHeight(size);
|
||||||
this->setFixedHeight(height);
|
|
||||||
this->state.size = height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->state.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelWidget::updateVisibility() {
|
void PanelWidget::updateVisibility() {
|
||||||
|
|||||||
Reference in New Issue
Block a user