vcl/inc/jsdialog/jsdialogbuilder.hxx |    2 ++
 vcl/jsdialog/jsdialogbuilder.cxx     |    6 ++++++
 vcl/source/control/button.cxx        |    4 ++++
 3 files changed, 12 insertions(+)

New commits:
commit 9192f764006d3fdae49bb0b4cab216483ae55fb4
Author:     Szymon Kłos <[email protected]>
AuthorDate: Mon Aug 4 13:47:36 2025 +0000
Commit:     Szymon Kłos <[email protected]>
CommitDate: Mon Nov 17 11:15:41 2025 +0100

    jsdialog: toggle button state
    
    Change-Id: I2d3d3123719767f18b845d821b9b78a3f577388e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188922
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194083
    Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index a0bdb99e46cf..d0809d44fff5 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -535,6 +535,8 @@ class JSToggleButton final : public 
JSWidget<SalInstanceToggleButton, ::PushButt
 public:
     JSToggleButton(JSDialogSender* pSender, ::PushButton* pButton, 
SalInstanceBuilder* pBuilder,
                    bool bTakeOwnership);
+
+    virtual void do_set_active(bool active) override;
 };
 
 class JSEntry final : public JSWidget<SalInstanceEntry, ::Edit>
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 8499f1697629..21f2c3f08785 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1213,6 +1213,12 @@ JSToggleButton::JSToggleButton(JSDialogSender* pSender, 
::PushButton* pButton,
 {
 }
 
+void JSToggleButton::do_set_active(bool active)
+{
+    SalInstanceToggleButton::do_set_active(active);
+    sendUpdate();
+}
+
 JSEntry::JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* 
pBuilder,
                  bool bTakeOwnership)
     : JSWidget<SalInstanceEntry, ::Edit>(pSender, pEntry, pBuilder, 
bTakeOwnership)
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d34e36591011..c3f4f123dbe5 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -636,7 +636,11 @@ void PushButton::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
     if (GetSymbol() != SymbolType::DONTKNOW)
         rJsonWriter.put("symbol", symbolTypeName(GetSymbol()));
     if (isToggleButton())
+    {
         rJsonWriter.put("isToggle", true);
+        if (IsChecked())
+            rJsonWriter.put("checked", true);
+    }
 }
 
 IMPL_STATIC_LINK( Button, dispatchCommandHandler, Button*, pButton, void )

Reply via email to