diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-25 17:03:32 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-25 17:03:32 +0530 |
| commit | 51be15cd7c9f39276f27d416356744041e62c22c (patch) | |
| tree | 0ba09371265f4b3d9923b60308d9aecce8c37e20 /src/widgets/Decorations.cpp | |
| parent | 7e3b6182c4581fcb39ab1d0ef2eb07fe9fa1d8b6 (diff) | |
| download | null-browser-51be15cd7c9f39276f27d416356744041e62c22c.tar.gz null-browser-51be15cd7c9f39276f27d416356744041e62c22c.zip | |
Add edge decoration widgets
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/Decorations.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
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 <QWidget> +#include <QtCore> +#include <qboxlayout.h> +#include <qlabel.h> +#include <qwidget.h> + +#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( + <div> + Hello world testing testing + <button>Btn 1</button><button>Btn 2</button> + </div> + )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); +} |
