svx/source/dialog/srchdlg.cxx | 10 ++++------ svx/source/tbxctrls/tbunosearchcontrollers.cxx | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-)
New commits: commit 6acda2a36c9025e0d3fe94d6ca8788ab60c3203e Author: Jim Raykowski <rayk...@gmail.com> Date: Thu Mar 29 11:07:04 2018 -0800 tdf#116596 Dynamically size Findbar searchlabel Change-Id: I74d09d439ada6d92fca396ac45c60340cb55e668 Reviewed-on: https://gerrit.libreoffice.org/52043 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits