diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-25 20:27:44 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-25 20:28:05 +0530 |
| commit | 81dcf7de91c1866d565f7aa9eb38f7fbd1cd7ad7 (patch) | |
| tree | aa24bcea93d19ce6298ad6aed499d324fac2ceae /src/widgets/Decorations.cpp | |
| parent | 2c7d36b4aa53ffa638a7aa7046767f10e7a152bf (diff) | |
| download | null-browser-81dcf7de91c1866d565f7aa9eb38f7fbd1cd7ad7.tar.gz null-browser-81dcf7de91c1866d565f7aa9eb38f7fbd1cd7ad7.zip | |
Add decoration is_enabled api + allowed specifying win_id for enabled
Diffstat (limited to 'src/widgets/Decorations.cpp')
| -rw-r--r-- | src/widgets/Decorations.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/Decorations.cpp b/src/widgets/Decorations.cpp index d559776..82c1a65 100644 --- a/src/widgets/Decorations.cpp +++ b/src/widgets/Decorations.cpp @@ -45,12 +45,16 @@ Decorations::Decorations(QWidget *content_widget, QWebEngineProfile *profile, QW } void Decorations::set_enabled(DecorationType type, bool enabled) { - std::optional<EdgeDecoration *> decoration = get_decoration_widget(type); - + auto decoration = get_decoration_widget(type); if (decoration.has_value()) decoration.value()->set_enabled(enabled); } +bool Decorations::get_enabled(DecorationType type) { + auto decoration = get_decoration_widget(type); + return decoration.has_value() && decoration.value()->is_enabled(); +} + std::optional<EdgeDecoration *> Decorations::get_decoration_widget(DecorationType type) { switch (type) { case DecorationType::DecorationTop: |
