diff options
Diffstat (limited to 'src/widgets/Decorations.cpp')
| -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); +} |
