Refactored Insight GUI to accommodate the many changes made to Bloom's internals

Also lots of tidying.
This commit is contained in:
Nav
2024-12-24 18:27:59 +00:00
parent 28e0a6d9e4
commit 7fe5b88dd8
195 changed files with 3449 additions and 3171 deletions

View File

@@ -6,12 +6,12 @@
namespace Widgets
{
SvgWidget::SvgWidget(QWidget* parent): QFrame(parent) {
this->renderer.setAspectRatioMode(Qt::AspectRatioMode::KeepAspectRatioByExpanding);
this->renderer->setAspectRatioMode(Qt::AspectRatioMode::KeepAspectRatioByExpanding);
}
void SvgWidget::startSpin() {
if (this->spinningAnimation == nullptr) {
this->spinningAnimation = new QPropertyAnimation(this, "angle", this);
this->spinningAnimation = new QPropertyAnimation{this, "angle", this};
this->spinningAnimation->setDuration(2000);
this->spinningAnimation->setStartValue(0);
this->spinningAnimation->setEndValue(360);
@@ -33,7 +33,7 @@ namespace Widgets
void SvgWidget::paintEvent(QPaintEvent* paintEvent) {
auto painter = QPainter(this);
auto svgSize = this->renderer.defaultSize();
auto svgSize = this->renderer->defaultSize();
auto margins = this->contentsMargins();
const auto containerSize = this->frameSize();
@@ -51,7 +51,7 @@ namespace Widgets
);
}
this->renderer.render(&painter, QRectF(
this->renderer->render(&painter, QRectF(
std::ceil(
static_cast<float>(containerSize.width() - svgSize.width()) / 2 + static_cast<float>(margins.left())
),
@@ -66,10 +66,10 @@ namespace Widgets
void SvgWidget::changeEvent(QEvent* event) {
if (event->type() == QEvent::EnabledChange && !this->disabledSvgFilePath.isEmpty()) {
if (!this->isEnabled()) {
this->renderer.load(this->disabledSvgFilePath);
this->renderer->load(this->disabledSvgFilePath);
} else {
this->renderer.load(this->svgFilePath);
this->renderer->load(this->svgFilePath);
}
this->repaint();