summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2018-03-29 11:07:04 -0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-02 12:44:13 +0200
commit6acda2a36c9025e0d3fe94d6ca8788ab60c3203e (patch)
tree0b47fef012c66e6452953fe3d0cd22e7280e0eae
parentac65efa1cff5c3ae763c24d0f1340617625e3fbc (diff)
tdf#116596 Dynamically size Findbar searchlabel
Change-Id: I74d09d439ada6d92fca396ac45c60340cb55e668 Reviewed-on: https://gerrit.libreoffice.org/52043 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/dialog/srchdlg.cxx10
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx4
2 files changed, 6 insertions, 8 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 99e6823b3cde..3b7fca06a673 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2369,7 +2369,6 @@ SfxChildWinInfo SvxSearchDialogWrapper::GetInfo() const
return aInfo;
}
-
static void lcl_SetSearchLabelWindow(const OUString& rStr)
{
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
@@ -2394,15 +2393,14 @@ static void lcl_SetSearchLabelWindow(const OUString& rStr)
{
vcl::Window* pSearchLabel = pToolBox->GetItemWindow(id);
assert(pSearchLabel);
- pSearchLabel->Hide();
pSearchLabel->SetText(rStr);
- if (!rStr.isEmpty())
- {
+ if (rStr.isEmpty())
+ pSearchLabel->SetSizePixel(Size(16, pSearchLabel->get_preferred_size().Height()));
+ else
pSearchLabel->SetSizePixel(pSearchLabel->get_preferred_size());
- pSearchLabel->Show();
- }
}
}
+ xLayoutManager->doLayout();
pToolBox->Resize();
}
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index cfe346d3cc2f..aa4b03fb033a 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -1269,7 +1269,7 @@ void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::Fea
{
OUString aStr = SvxSearchDialogWrapper::GetSearchLabel();
m_pSL->SetText(aStr);
- long aWidth = !aStr.isEmpty() ? m_pSL->get_preferred_size().getWidth() : 300;
+ long aWidth = !aStr.isEmpty() ? m_pSL->get_preferred_size().getWidth() : 16;
m_pSL->SetSizePixel(Size(aWidth, m_pSL->get_preferred_size().getHeight()));
}
}
@@ -1277,7 +1277,7 @@ void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::Fea
css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent )
{
m_pSL = VclPtr<FixedText>::Create(VCLUnoHelper::GetWindow( Parent ));
- m_pSL->SetSizePixel(Size(300, 25));
+ m_pSL->SetSizePixel(Size(16, 25));
return VCLUnoHelper::GetInterface(m_pSL);
}