From f77e9d78746b8674a9a35abe6edf9746975dd5b6 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 17 Aug 2022 19:32:47 +0100 Subject: [PATCH] Tidied PanelWidget::setSize() --- .../InsightWindow/Widgets/PanelWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp index 1586a447..f6e6e9c5 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp @@ -56,16 +56,16 @@ namespace Bloom::Widgets } void PanelWidget::setSize(int size) { + size = std::min(std::max(size, this->minimumResize), this->maximumResize); + if (this->panelType == PanelWidgetType::LEFT) { - const auto width = std::min(std::max(size, this->minimumResize), this->maximumResize); - this->setFixedWidth(width); - this->state.size = width; + this->setFixedWidth(size); } else if (this->panelType == PanelWidgetType::BOTTOM) { - const auto height = std::min(std::max(size, this->minimumResize), this->maximumResize); - this->setFixedHeight(height); - this->state.size = height; + this->setFixedHeight(size); } + + this->state.size = size; } void PanelWidget::updateVisibility() {