From 81dcf7de91c1866d565f7aa9eb38f7fbd1cd7ad7 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 25 Jul 2025 20:27:44 +0530 Subject: Add decoration is_enabled api + allowed specifying win_id for enabled --- src/widgets/Decorations.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/widgets/Decorations.cpp') 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 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 Decorations::get_decoration_widget(DecorationType type) { switch (type) { case DecorationType::DecorationTop: -- cgit v1.3.1