desktop/source/lib/init.cxx | 4 +++ include/sfx2/quickfind.hxx | 32 ++++++++++++++++++++++++ include/sfx2/sfxsids.hrc | 1 include/sfx2/strings.hrc | 1 include/vcl/jsdialog/executor.hxx | 1 sfx2/Library_sfx.mk | 1 sfx2/UIConfig_sfx.mk | 1 sfx2/sdi/frmslots.sdi | 5 +++ sfx2/sdi/sfx.sdi | 16 ++++++++++++ sfx2/source/dialog/quickfind.cxx | 36 +++++++++++++++++++++++++++ sfx2/source/inc/helpids.h | 1 sfx2/source/view/viewfrm.cxx | 4 +++ sfx2/uiconfig/ui/quickfind.ui | 14 ++++++++++ static/CustomTarget_emscripten_fs_image.mk | 2 + sw/source/uibase/app/swmodule.cxx | 2 + sw/source/uibase/inc/QuickFindPanel.hxx | 22 +++++++++++++++- sw/source/uibase/sidebar/QuickFindPanel.cxx | 37 +++++++++++++++++++++++++++- sw/source/uibase/sidebar/SwPanelFactory.cxx | 2 - sw/source/uibase/uiview/view0.cxx | 1 vcl/inc/jsdialog/enabled.hxx | 1 vcl/inc/jsdialog/jsdialogbuilder.hxx | 2 + vcl/jsdialog/enabled.cxx | 13 +++++++++ vcl/jsdialog/executor.cxx | 5 +++ vcl/jsdialog/jsdialogbuilder.cxx | 13 +++++++-- vcl/jsdialog/jsdialogregister.cxx | 2 - vcl/source/control/button.cxx | 4 +++ vcl/source/window/builder.cxx | 2 + 27 files changed, 218 insertions(+), 7 deletions(-)
New commits: commit 9ab49c088b2ee59fc4aaeddea8a1e61af04f99ae Author: Szymon Kłos <[email protected]> AuthorDate: Mon Aug 4 13:47:36 2025 +0000 Commit: Szymon Kłos <[email protected]> CommitDate: Tue Aug 5 06:23:38 2025 +0200 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]> diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index a97a48917bd1..962b806f6bae 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -537,6 +537,8 @@ class JSToggleButton final : public JSWidget<SalInstanceToggleButton, ::PushButt public: JSToggleButton(JSDialogSender* pSender, ::PushButton* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void 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 453ced8a1459..29c5bff12161 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1214,6 +1214,12 @@ JSToggleButton::JSToggleButton(JSDialogSender* pSender, ::PushButton* pButton, { } +void JSToggleButton::set_active(bool active) +{ + SalInstanceToggleButton::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 4f8eafa7a144..e18fc33ab796 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -644,7 +644,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 ) commit bcd1f7cc10b262e373a01fdcd87fa86c002d5829 Author: NickWingate <[email protected]> AuthorDate: Mon Jul 14 09:07:19 2025 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Tue Aug 5 06:23:27 2025 +0200 Detach QuickFindPanel Main changes are: 1) new jsontype: `quickfind` 2) send the full json when constructed 3) create new .uno:QuickFind 4) create wrapper and window to register QuickFindPanel as a DockingWindow so that we can create it from CreateChildWinow without going through sidebar 5) Register SID_QUICKFIND as a ChildWindow in the SwView interface Signed-off-by: NickWingate <[email protected]> Change-Id: I2086316b932c1495b0adee7a062bdbbcb104f1ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188667 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 26ff38ee063c..4ed458a5533c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5152,6 +5152,8 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA sWindowId = sCurrentShellId + "formulabar"; if (nWindowId == static_cast<unsigned long long int>(-4)) sWindowId = sCurrentShellId + "addressinputfield"; + if (nWindowId == static_cast<unsigned long long int>(-5)) + sWindowId = sCurrentShellId + "quickfind"; // dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id if (jsdialog::ExecuteAction(sWindowId, sControlId, aMap)) @@ -5161,6 +5163,8 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA return; if (jsdialog::ExecuteAction(sCurrentShellId + "navigator", sControlId, aMap)) return; + if (jsdialog::ExecuteAction(sCurrentShellId + "quickfind", sControlId, aMap)) + return; if (jsdialog::ExecuteAction(sCurrentShellId + "notebookbar", sControlId, aMap)) return; if (jsdialog::ExecuteAction(sCurrentShellId + "formulabar", sControlId, aMap)) diff --git a/include/sfx2/quickfind.hxx b/include/sfx2/quickfind.hxx new file mode 100644 index 000000000000..914606eeb05e --- /dev/null +++ b/include/sfx2/quickfind.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include <sfx2/childwin.hxx> +#include <sfx2/dockwin.hxx> + +class SFX2_DLLPUBLIC SfxQuickFindWrapper : public SfxChildWindow +{ +protected: + void Initialize(); + +public: + SfxQuickFindWrapper(vcl::Window* pParent, sal_uInt16 nId); +}; + +class SFX2_DLLPUBLIC SfxQuickFind : public SfxDockingWindow +{ +public: + SfxQuickFind(SfxBindings* pBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, + SfxChildWinInfo* pInfo); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index c71ddca61559..10400ccf6365 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -594,6 +594,7 @@ class SvxZoomItem; #define SID_HYPERLINK_SETLINK TypedWhichId<SvxHyperlinkItem>(SID_SVX_START + 362) #define SID_INFOBAR (SID_SVX_START + 365) #define SID_NAVIGATOR (SID_SVX_START + 366) +#define SID_QUICKFIND (SID_SVX_START + 367) #define SID_ZOOM_NEXT (SID_SVX_START + 402) #define SID_ZOOM_PREV (SID_SVX_START + 403) #define SID_INET_DLG (SID_SVX_START + 416) diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index dac3a61d6bb9..16be8d7f46d5 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -224,6 +224,7 @@ #define STR_DELETE_STYLE_USED NC_("STR_DELETE_STYLE_USED", "One or more of the selected styles is in use in this document. If you will delete it, text or objects using these styles will revert to the parent style. Do you still wish to delete these styles? ") #define STR_DELETE_STYLE NC_("STR_DELETE_STYLE", "Styles in use: ") #define STR_SID_NAVIGATOR NC_("STR_SID_NAVIGATOR", "Navigator") +#define STR_SID_QUICKFIND NC_("STR_SID_QUICKFIND", "Quick Find") #define STR_ERROR_WRONG_CONFIRM NC_("STR_ERROR_WRONG_CONFIRM", "Faulty password confirmation") #define STR_PDF_EXPORT_SEND NC_("STR_PDF_EXPORT_SEND", "Send") #define STR_FONT_TABPAGE NC_("STR_FONT_TABPAGE", "Font") diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 28f87f8d958d..b08e16c0bf07 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -163,6 +163,7 @@ typedef std::unordered_map<OString, OUString> ActionDataMap; VCL_DLLPUBLIC void SendNavigatorForView(const sal_uInt64 nShellId); VCL_DLLPUBLIC void SendSidebarForView(const sal_uInt64 nShellId); +VCL_DLLPUBLIC void SendQuickFindForView(const sal_uInt64 nShellId); /// execute action on a widget VCL_DLLPUBLIC bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index db88eaa72b40..8b41777f18b2 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -188,6 +188,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/dialog/bluthsnd \ sfx2/source/dialog/mgetempl \ sfx2/source/dialog/navigat \ + sfx2/source/dialog/quickfind \ sfx2/source/dialog/newstyle \ sfx2/source/dialog/partwnd \ sfx2/source/dialog/passwd \ diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk index 21410bc709c0..47825369392b 100644 --- a/sfx2/UIConfig_sfx.mk +++ b/sfx2/UIConfig_sfx.mk @@ -58,6 +58,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\ sfx2/uiconfig/ui/notebookbarpopup \ sfx2/uiconfig/ui/printeroptionsdialog \ sfx2/uiconfig/ui/querysavedialog \ + sfx2/uiconfig/ui/quickfind \ sfx2/uiconfig/ui/saveastemplatedlg \ sfx2/uiconfig/ui/safemodequerydialog \ sfx2/uiconfig/ui/searchdialog \ diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index b10f05a4ffbd..fb9e65b6dcc2 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -33,6 +33,11 @@ interface Window ExecMethod = ChildWindowExecute ; StateMethod = ChildWindowState ; ] + SID_QUICKFIND + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] SID_INFOBAR // status(final|play) [ ExecMethod = ChildWindowExecute ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index c07d4bbf7a83..72447ad71b62 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -2634,6 +2634,22 @@ SfxBoolItem Navigator SID_NAVIGATOR GroupId = SfxGroupId::Navigator; ] +SfxBoolItem QuickFind SID_QUICKFIND +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = ; +] + SfxBoolItem InfoBar SID_INFOBAR [ AutoUpdate = FALSE, diff --git a/sfx2/source/dialog/quickfind.cxx b/sfx2/source/dialog/quickfind.cxx new file mode 100644 index 000000000000..8f126e69fbc6 --- /dev/null +++ b/sfx2/source/dialog/quickfind.cxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include <sal/config.h> + +#include <sfx2/bindings.hxx> +#include <sfx2/quickfind.hxx> +#include <sfx2/strings.hrc> +#include <sfx2/sfxresid.hxx> +#include <helpids.h> + +SfxQuickFindWrapper::SfxQuickFindWrapper(vcl::Window* pParentWnd, sal_uInt16 nId) + : SfxChildWindow(pParentWnd, nId) +{ +} + +void SfxQuickFindWrapper::Initialize() { SetHideNotDelete(true); } + +SfxQuickFind::SfxQuickFind(SfxBindings* pBind, SfxChildWindow* pChildWin, vcl::Window* pParent, + SfxChildWinInfo* pInfo) + : SfxDockingWindow(pBind, pChildWin, pParent, u"QuickFind"_ustr, u"sfx/ui/quickfind.ui"_ustr) +{ + SetText(SfxResId(STR_SID_QUICKFIND)); + SetHelpId(HID_QUICKFIND_WINDOW); + SetOutputSizePixel(Size(270, 240)); + Initialize(pInfo); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/helpids.h b/sfx2/source/inc/helpids.h index 33d165828368..0ee1b89b9a64 100644 --- a/sfx2/source/inc/helpids.h +++ b/sfx2/source/inc/helpids.h @@ -27,6 +27,7 @@ inline constexpr OUString HID_TEMPLDLG_NEWBYEXAMPLE = u"SFX2_HID_TEMPLDLG_NEWBYE inline constexpr OUString HID_TEMPLDLG_UPDATEBYEXAMPLE = u"SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE"_ustr; inline constexpr OUString HID_TEMPLDLG_WATERCAN = u"SFX2_HID_TEMPLDLG_WATERCAN"_ustr; inline constexpr OUString HID_NAVIGATOR_WINDOW = u"SFX2_HID_NAVIGATOR_WINDOW"_ustr; +inline constexpr OUString HID_QUICKFIND_WINDOW = u"SFX2_HID_QUICKFIND_WINDOW"_ustr; inline constexpr OUString HID_TABDLG_RESET_BTN = u"SFX2_HID_TABDLG_RESET_BTN"_ustr; inline constexpr OUString HID_TABDLG_STANDARD_BTN = u"SFX2_HID_TABDLG_STANDARD_BTN"_ustr; inline constexpr OUString HID_TEMPLDLG_TOOLBOX_LEFT = u"SFX2_HID_TEMPLDLG_TOOLBOX_LEFT"_ustr; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 57d591252b39..0ffdfe9a954d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3648,6 +3648,10 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) rState.Put( SfxBoolItem( nSID, HasChildWindow( nSID ) ) ); } } + else if ( nSID == SID_QUICKFIND ) + { + rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) ); + } else if ( KnowsChildWindow(nSID) ) rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) ); else diff --git a/sfx2/uiconfig/ui/quickfind.ui b/sfx2/uiconfig/ui/quickfind.ui new file mode 100644 index 000000000000..4dc345d46c6b --- /dev/null +++ b/sfx2/uiconfig/ui/quickfind.ui @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 --> +<interface domain="sfx"> + <requires lib="gtk+" version="3.20"/> + <object class="GtkBox" id="QuickFind"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + </object> +</interface> diff --git a/static/CustomTarget_emscripten_fs_image.mk b/static/CustomTarget_emscripten_fs_image.mk index 8b854a3f06e5..3588a9532664 100644 --- a/static/CustomTarget_emscripten_fs_image.mk +++ b/static/CustomTarget_emscripten_fs_image.mk @@ -751,6 +751,7 @@ gb_emscripten_fs_image_files += \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/selectblockdialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/selectindexdialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/selecttabledialog.ui \ + $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/sidebarquickfind.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/sidebarstylepresets.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/sidebartableedit.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/swriter/ui/sidebartheme.ui \ @@ -1148,6 +1149,7 @@ gb_emscripten_fs_image_files += \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/password.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/printeroptionsdialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/querysavedialog.ui \ + $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/quickfind.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/safemodequerydialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/saveastemplatedlg.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/sfx/ui/searchdialog.ui \ diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 43d2b02bd991..130d9ba9e78c 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -72,6 +72,7 @@ #include <wlistsh.hxx> #include <wtabsh.hxx> #include <navipi.hxx> +#include <QuickFindPanel.hxx> #include <inputwin.hxx> #include <usrpref.hxx> #include <uinums.hxx> @@ -333,6 +334,7 @@ void SwDLL::RegisterControls() ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod); SwNavigatorWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::NEVERHIDE); + ::sw::sidebar::QuickFindPanelWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::FORCEDOCK); SwJumpToSpecificPageControl::RegisterControl(SID_JUMP_TO_SPECIFIC_PAGE, pMod); } diff --git a/sw/source/uibase/sidebar/QuickFindPanel.hxx b/sw/source/uibase/inc/QuickFindPanel.hxx similarity index 83% rename from sw/source/uibase/sidebar/QuickFindPanel.hxx rename to sw/source/uibase/inc/QuickFindPanel.hxx index 2875229bb9c2..fbf100991f8b 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.hxx +++ b/sw/source/uibase/inc/QuickFindPanel.hxx @@ -10,8 +10,9 @@ #pragma once #include <sfx2/sidebar/PanelLayout.hxx> +#include <sfx2/quickfind.hxx> #include <svx/svxdlg.hxx> -#include <wrtsh.hxx> +#include "wrtsh.hxx" #include <sfx2/weldutils.hxx> namespace sw::sidebar @@ -51,6 +52,7 @@ public: virtual ~QuickFindPanel() override; private: + friend class QuickFindPanelWindow; std::vector<std::unique_ptr<SwPaM>> m_vPaMs; std::unique_ptr<weld::Entry> m_xSearchFindEntry; @@ -84,5 +86,23 @@ private: void FillSearchFindsList(); }; + +class QuickFindPanelWrapper : public SfxQuickFindWrapper +{ +public: + QuickFindPanelWrapper(vcl::Window* pParent, sal_uInt16 nId, SfxBindings* pBindings, + SfxChildWinInfo* pInfo); + SFX_DECL_CHILDWINDOW(QuickFindPanelWrapper); +}; + +class QuickFindPanelWindow : public SfxQuickFind +{ +private: + std::unique_ptr<QuickFindPanel> m_xQuickFindPanel; + +public: + QuickFindPanelWindow(SfxBindings* _pBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, + SfxChildWinInfo* pInfo); +}; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index 6cbaa4fe1f55..bd476712e694 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -8,7 +8,7 @@ * */ -#include "QuickFindPanel.hxx" +#include <QuickFindPanel.hxx> #include <svtools/colorcfg.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <comphelper/scopeguard.hxx> @@ -27,6 +27,14 @@ #include <vcl/sysdata.hxx> #include <swwait.hxx> +#include <sfx2/strings.hrc> +#include <sfx2/sfxresid.hxx> +#include <sfx2/childwin.hxx> +#include <sfx2/bindings.hxx> + +#include <vcl/jsdialog/executor.hxx> +#include <comphelper/lok.hxx> + const int CharactersBeforeAndAfter = 40; namespace @@ -95,6 +103,25 @@ IMPL_LINK_NOARG(QuickFindPanel::SearchOptionsDialog, SimilaritySettingsDialogBut } } +QuickFindPanelWindow::QuickFindPanelWindow(SfxBindings* _pBindings, SfxChildWindow* pChildWin, + vcl::Window* pParent, SfxChildWinInfo* pInfo) + : SfxQuickFind(_pBindings, pChildWin, pParent, pInfo) + , m_xQuickFindPanel( + std::make_unique<QuickFindPanel>(m_xContainer.get(), _pBindings->GetActiveFrame())) +{ + _pBindings->Invalidate(SID_QUICKFIND); +} + +QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window* pParent, sal_uInt16 nId, + SfxBindings* pBindings, SfxChildWinInfo* pInfo) + : SfxQuickFindWrapper(pParent, nId) +{ + SetWindow(VclPtr<QuickFindPanelWindow>::Create(pBindings, this, pParent, pInfo)); + Initialize(); +} + +SFX_IMPL_DOCKINGWINDOW(QuickFindPanelWrapper, SID_QUICKFIND); + std::unique_ptr<PanelLayout> QuickFindPanel::Create(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame) @@ -119,6 +146,14 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent, const uno::Reference<frame , m_xSearchFindFoundTimesLabel(m_xBuilder->weld_label("numberofsearchfinds")) , m_pWrtShell(::GetActiveWrtShell()) { + if (comphelper::LibreOfficeKit::isActive()) + { + sal_uInt64 nShellId = reinterpret_cast<sal_uInt64>(SfxViewShell::Current()); + jsdialog::SendQuickFindForView(nShellId); + + // disable search options for online as still tunnled dialog + m_xSearchOptionsToolbar->set_visible(false); + } m_nMinimumPanelWidth = m_xBuilder->weld_widget(u"box"_ustr)->get_preferred_size().getWidth() + (6 * 2) + 6; m_xContainer->set_size_request(m_nMinimumPanelWidth, 1); diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index 31f2a3f60ee2..31df85ef7f6b 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -27,7 +27,7 @@ #include "PageFormatPanel.hxx" #include "PageHeaderPanel.hxx" #include "PageFooterPanel.hxx" -#include "QuickFindPanel.hxx" +#include <QuickFindPanel.hxx> #include "WrapPropertyPanel.hxx" #include "WriterInspectorTextPanel.hxx" #include "TableEditPanel.hxx" diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 0a9ad80195b6..a2f4fa8c4b64 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -88,6 +88,7 @@ SFX_IMPL_INTERFACE(SwView, SfxViewShell) void SwView::InitInterface_Impl() { GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true); + GetStaticInterface()->RegisterChildWindow(SID_QUICKFIND, false); GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx index eedf83f69a21..31dad161b48f 100644 --- a/vcl/inc/jsdialog/enabled.hxx +++ b/vcl/inc/jsdialog/enabled.hxx @@ -22,6 +22,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile); bool isBuilderEnabledForAddressInput(std::u16string_view rUIFile); bool isBuilderEnabledForFormulabar(std::u16string_view rUIFile); bool isBuilderEnabledForNavigator(std::u16string_view rUIFile); +bool isBuilderEnabledForQuickFind(std::u16string_view rUIFile); bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile); } diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index ac55cc4eb248..6cf67c68e372 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -34,6 +34,7 @@ constexpr auto IgnoredList { u"modules/scalc/ui/dropmenu.ui"}, // Calc -> Navigator -> right click { u"modules/sdraw/ui/navigatorcontextmenu.ui" }, // Impress -> Navigator -> right click { u"modules/swriter/ui/navigatorcontextmenu.ui" }, // Writer -> Navigator -> right click + { u"sfx/ui/quickfind.ui" }, }); // ========== MOBILE DIALOGS ================================================= // @@ -465,6 +466,13 @@ constexpr auto NavigatorList { u"modules/simpress/ui/navigatorpanel.ui"} }); +// ========== QUICKFIND ================================================= // +constexpr auto QuickFindList + = frozen::make_unordered_set<std::u16string_view>({ + { u"modules/swriter/ui/sidebarquickfind.ui" }, +}); + + // ========== NOTEBOOKBAR ================================================= // constexpr auto NotebookbarList @@ -586,6 +594,11 @@ bool isBuilderEnabledForNavigator(std::u16string_view rUIFile) return isInMap(NavigatorList, rUIFile); } +bool isBuilderEnabledForQuickFind(std::u16string_view rUIFile) +{ + return isInMap(QuickFindList, rUIFile); +} + bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile) { return isInMap(NotebookbarList, rUIFile); diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 05c84ec45936..080e93d82a6f 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -103,6 +103,11 @@ void SendSidebarForView(const sal_uInt64 nShellId) jsdialog::SendFullUpdate(OUString::number(nShellId) + "sidebar", "Panel"); } +void SendQuickFindForView(const sal_uInt64 nShellId) +{ + jsdialog::SendFullUpdate(OUString::number(nShellId) + "quickfind", "QuickFindPanel"); +} + void SendFullUpdate(const OUString& nWindowId, const OUString& rWidget) { auto aWidgetMap = JSInstanceBuilder::Widgets().Find(nWindowId); diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 580d96a70826..453ced8a1459 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -186,7 +186,8 @@ void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId, m_aParentDialog = pRoot->GetParentWithLOKNotifier(); - bool bIsNavigatorPanel = jsdialog::isBuilderEnabledForNavigator(rUIFile); + bool bIsDockingWindow = jsdialog::isBuilderEnabledForNavigator(rUIFile) + || jsdialog::isBuilderEnabledForQuickFind(rUIFile); // builder for Panel, PanelLayout, and DockingWindow // get SidebarDockingWindow, or SwNavigatorWin as m_aContentWindow @@ -195,7 +196,7 @@ void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId, // Panel : 7 levels up from pRoot // DockingWindow: 3 levels up from pRoot unsigned nLevelsUp = 100; // limit - if (bIsNavigatorPanel) + if (bIsDockingWindow) nLevelsUp = 3; if (nLevelsUp > 0) @@ -207,7 +208,7 @@ void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId, m_aContentWindow = pRoot; for (unsigned i = 0; i < nLevelsUp && m_aContentWindow; i++) { - if (!bIsNavigatorPanel && m_aContentWindow->get_id() == "Deck") + if (!bIsDockingWindow && m_aContentWindow->get_id() == "Deck") nLevelsUp = i + 3; // Useful to check if any panel doesn't appear diff --git a/vcl/jsdialog/jsdialogregister.cxx b/vcl/jsdialog/jsdialogregister.cxx index 8f064107e528..1342d649d8b6 100644 --- a/vcl/jsdialog/jsdialogregister.cxx +++ b/vcl/jsdialog/jsdialogregister.cxx @@ -16,7 +16,7 @@ OUString JSInstanceBuilder::getMapIdFromWindowId() const { if (m_sTypeOfJSON == "sidebar" || m_sTypeOfJSON == "notebookbar" || m_sTypeOfJSON == "formulabar" || m_sTypeOfJSON == "addressinputfield" - || m_sTypeOfJSON == "navigator") + || m_sTypeOfJSON == "navigator" || m_sTypeOfJSON == "quickfind") { return OUString::number(m_nWindowId) + m_sTypeOfJSON; } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 4391ee1b3065..5c75a23f6e49 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -195,6 +195,8 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, return JSInstanceBuilder::CreateMenuBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); else if (jsdialog::isBuilderEnabledForNavigator(rUIFile)) return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "navigator", nLOKWindowId); + else if (jsdialog::isBuilderEnabledForQuickFind(rUIFile)) + return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "quickfind", nLOKWindowId); else if (jsdialog::isBuilderEnabled(rUIFile, bMobile)) return JSInstanceBuilder::CreateDialogBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); else
