include/vcl/jsdialog/executor.hxx | 2 ++ include/vcl/toolkit/edit.hxx | 2 ++ include/vcl/weld.hxx | 2 ++ vcl/jsdialog/executor.cxx | 14 ++++++++++++++ vcl/source/control/edit.cxx | 10 ++++++++++ 5 files changed, 30 insertions(+)
New commits: commit 708a8b7f1d869580741787e71a9248757bb1541e Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Nov 2 12:24:49 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Nov 25 15:47:01 2020 +0100 jsdialog: execute checkbox action Change-Id: Ib19997f600404cc9555acbfaf87acac32f8aa5fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106562 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index e49190f31e5f..5dde733a3823 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -22,6 +22,8 @@ public: static void trigger_changed(weld::ComboBox& rComboBox) { rComboBox.signal_changed(); } + static void trigger_toggled(weld::ToggleButton& rButton) { rButton.signal_toggled(); } + static void trigger_row_activated(weld::TreeView& rTreeView) { rTreeView.signal_row_activated(); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 04285ee63778..a4c07aeebede 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1301,6 +1301,8 @@ public: class VCL_DLLPUBLIC ToggleButton : virtual public Button { + friend class ::LOKTrigger; + protected: Link<ToggleButton&, void> m_aToggleHdl; TriState m_eSavedValue = TRISTATE_FALSE; diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 9863d0c2edb9..93dae7db3a2d 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -97,6 +97,20 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat } } } + else if (sControlType == "checkbox") + { + auto pCheckButton = dynamic_cast<weld::CheckButton*>(pWidget); + if (pCheckButton) + { + if (sAction == "change") + { + bool bChecked = rData["data"] == "true"; + pCheckButton->set_state(bChecked ? TRISTATE_TRUE : TRISTATE_FALSE); + LOKTrigger::trigger_toggled(*static_cast<weld::ToggleButton*>(pCheckButton)); + return true; + } + } + } else if (sControlType == "drawingarea") { auto pArea = dynamic_cast<weld::DrawingArea*>(pWidget); commit 6581a8a322cc2b83385722ae3042a885a7423f19 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Nov 2 12:14:50 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Nov 25 15:46:49 2020 +0100 jsdialog: export placeholder text for edit fields Change-Id: I6031025a72cc72e8bc3834c256479ec1a07971b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106561 Tested-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/include/vcl/toolkit/edit.hxx b/include/vcl/toolkit/edit.hxx index 655171a98ea0..6cad804c208e 100644 --- a/include/vcl/toolkit/edit.hxx +++ b/include/vcl/toolkit/edit.hxx @@ -242,6 +242,8 @@ public: void SetForceControlBackground(bool b) { mbForceControlBackground = b; } bool IsPassword() const { return mbPassword; } + + virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0484797de298..5699124a9cde 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -62,6 +62,7 @@ #include <vcl/unohelp2.hxx> #include <o3tl/safeint.hxx> #include <officecfg/Office/Common.hxx> +#include <tools/json_writer.hxx> #include <algorithm> #include <memory> @@ -2924,4 +2925,13 @@ FactoryFunction Edit::GetUITestFactory() const return EditUIObject::create; } + +void Edit::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) +{ + Control::DumpAsPropertyTree(rJsonWriter); + + if (!maPlaceholderText.isEmpty()) + rJsonWriter.put("placeholder", maPlaceholderText); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits