summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2024-07-08 16:50:37 +0200
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2024-07-09 09:45:00 +0200
commit4e606c5b38139c4424fe9334aed32515c7547418 (patch)
treed43ec11269038c0d1096fea918fbcdf27530c85c /svx/source
parentdd56ce1bbf5b8ea51aeaaa3319f3247654f43df8 (diff)
Resolves tdf#161568 - Feedback for QFS in floating mode
As band-aid for the lack of proper toolbar resizing, feedback is given via entry message type Change-Id: Ic2b2a2aff93040f558775d63c18c21370fabcb39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170167 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/srchdlg.cxx17
-rw-r--r--svx/source/inc/findtextfield.hxx1
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx5
3 files changed, 23 insertions, 0 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index a1455a49e6d5..679cc66a2a41 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -72,6 +72,8 @@
#include <cstdlib>
#include <memory>
+#include <findtextfield.hxx>
+
#include <svx/labelitemwindow.hxx>
#include <svx/xdef.hxx>
#include <officecfg/Office/Common.hxx>
@@ -572,6 +574,9 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
m_xSearchBox->set_size_request(-1, aSize.Height());
m_xSearchBox->set_background(COL_TRANSPARENT);
}
+
+ if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
+ m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Error);
}
void SvxSearchDialog::ApplyTransliterationFlags_Impl( TransliterationFlags nSettings )
@@ -2369,6 +2374,18 @@ static void lcl_SetSearchLabelWindow(const OUString& rStr, SfxViewFrame& rViewFr
pSearchLabel->set_label(rStr, LabelItemWindowType::Info);
pSearchLabel->SetOptimalSize();
}
+
+ if (pToolBox->IsFloatingMode() && pToolBox->GetItemCommand(id) == ".uno:FindText")
+ {
+ FindTextFieldControl* pFindText = dynamic_cast<FindTextFieldControl*>(pToolBox->GetItemWindow(id));
+ assert(pFindText);
+ if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
+ pFindText->set_entry_message_type(weld::EntryMessageType::Error);
+ else if (rStr == SvxResId(RID_SVXSTR_SEARCH_END) || rStr == SvxResId(RID_SVXSTR_SEARCH_START))
+ pFindText->set_entry_message_type(weld::EntryMessageType::Warning);
+ else
+ pFindText->set_entry_message_type(weld::EntryMessageType::Normal);
+ }
}
xLayoutManager->doLayout();
pToolBox->Resize();
diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx
index 9d15a0d8b47d..2c79a529b3f4 100644
--- a/svx/source/inc/findtextfield.hxx
+++ b/svx/source/inc/findtextfield.hxx
@@ -47,6 +47,7 @@ public:
OUString get_text(int nIndex) const;
OUString get_active_text() const;
void append_text(const OUString& rText);
+ void set_entry_message_type(weld::EntryMessageType eType);
private:
ImplSVEvent* m_nAsyncGetFocusId;
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 94ac6c8fde8c..05bdedb4827d 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -437,6 +437,11 @@ OUString FindTextFieldControl::get_active_text() const
return m_xWidget->get_active_text();
}
+void FindTextFieldControl::set_entry_message_type(weld::EntryMessageType eType)
+{
+ m_xWidget->set_entry_message_type(eType);
+}
+
void FindTextFieldControl::append_text(const OUString& rText)
{
m_xWidget->append_text(rText);