From 51be15cd7c9f39276f27d416356744041e62c22c Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 25 Jul 2025 17:03:32 +0530 Subject: Add edge decoration widgets --- src/widgets/Decorations.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/widgets/Decorations.cpp (limited to 'src/widgets/Decorations.cpp') diff --git a/src/widgets/Decorations.cpp b/src/widgets/Decorations.cpp new file mode 100644 index 0000000..659f972 --- /dev/null +++ b/src/widgets/Decorations.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include + +#include "Decorations.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); +} -- cgit v1.3.1