#include #include #include #include #include #include #include "Decorations.hpp" #include "widgets/EdgeDecoration.hpp" Decorations::Decorations(QWidget *content_widget, QWebEngineProfile *profile, QWidget *parent) : QWidget(parent) { decoration_top = new EdgeDecoration(false, profile, this); decoration_bottom = new EdgeDecoration(false, profile, this); decoration_left = new EdgeDecoration(true, profile, this); decoration_right = new EdgeDecoration(true, profile, this); QString content = R"HTML(
Hello world testing testing
)HTML"; decoration_bottom->set_html(content); // decoration_bottom->set_enabled(true); auto *vbox = new QVBoxLayout(); vbox->setContentsMargins(0, 0, 0, 0); vbox->setSpacing(0); setLayout(vbox); auto *container = new QWidget(this); auto *hbox = new QHBoxLayout(); hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(0); container->setLayout(hbox); vbox->addWidget(decoration_top); vbox->addWidget(container); vbox->addWidget(decoration_bottom); hbox->addWidget(decoration_left); hbox->addWidget(content_widget); hbox->addWidget(decoration_right); } void Decorations::set_enabled(DecorationType type, bool enabled) { std::optional decoration = get_decoration_widget(type); if (decoration.has_value()) decoration.value()->set_enabled(enabled); } std::optional Decorations::get_decoration_widget(DecorationType type) { switch (type) { case DecorationType::DecorationTop: return decoration_top; case DecorationType::DecorationBottom: return decoration_bottom; case DecorationType::DecorationLeft: return decoration_left; case DecorationType::DecorationRight: return decoration_right; } return nullptr; }