diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-26 00:39:23 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-26 00:39:23 +0530 |
| commit | 3f56d76a2b0d528c05ab8d0a38059ca82ba90952 (patch) | |
| tree | daae7849815c122803f8ddd08cbfcb87552eab8a /src/widgets/EdgeDecoration.cpp | |
| parent | 031b22e0bb0f1d132731aea3776917731a8ab4ce (diff) | |
| download | null-browser-3f56d76a2b0d528c05ab8d0a38059ca82ba90952.tar.gz null-browser-3f56d76a2b0d528c05ab8d0a38059ca82ba90952.zip | |
Add set_html for views + example use with decorations
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/EdgeDecoration.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/EdgeDecoration.cpp b/src/widgets/EdgeDecoration.cpp index 4cbb004..8880294 100644 --- a/src/widgets/EdgeDecoration.cpp +++ b/src/widgets/EdgeDecoration.cpp @@ -15,7 +15,7 @@ QString default_html_layout = R"HTML( :where(html, body) { margin: 0; padding: 0; - background: black; + background: #333; color: white; overflow: hidden; } @@ -30,8 +30,8 @@ EdgeDecoration::EdgeDecoration(bool vertical, QWebEngineProfile *profile, QWidge setLayout(vbox); } -void EdgeDecoration::set_html(const QString &content) { - html_content = content; +void EdgeDecoration::set_enabled(bool enabled_value) { + enabled = enabled_value; setup_webview(); } @@ -40,8 +40,8 @@ void EdgeDecoration::set_size(u_int16_t size_value) { setup_webview(); } -void EdgeDecoration::set_enabled(bool enabled_value) { - enabled = enabled_value; +void EdgeDecoration::set_html(const QString &content) { + html_content = content; setup_webview(); } @@ -52,7 +52,7 @@ void EdgeDecoration::setup_webview() { layout()->addWidget(webview.value()); } - webview.value()->setHtml(default_html_layout.replace("{{body}}", html_content)); + webview.value()->setHtml(QString(default_html_layout).replace("{{body}}", html_content)); if (vertical) webview.value()->setFixedWidth(size); else |
