diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2023-01-11 11:12:58 +0100 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2023-01-13 08:04:06 +0000 |
commit | f2a2ca8a9d4bf0314b2012cc1d066c65044bd5e0 (patch) | |
tree | 2d6fe6ed1822ae8ff7920583dee4767c3640deab /sfx2 | |
parent | e001703df46d601a9ba21512a259c1caf266edac (diff) |
Resolves tdf#119919 - Show hidden children in Stylist when in tree mode
To avoid styles appearing on root if their parent is hidden
(eg. Heading hidden, Heading 1 moves under root), the Stylist
shows all styles but with disabled color for the hidden styles
Change-Id: Iec73a3010ab05d01e9b7209d81f1f03c1355ef49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145324
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/StyleList.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 59455758e890..e1ecd4a2108d 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -926,7 +926,7 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam) return; StyleTreeArr_Impl aArr; - SfxStyleSheetBase* pStyle = m_pStyleSheetPool->First(eFam, SfxStyleSearchBits::AllVisible); + SfxStyleSheetBase* pStyle = m_pStyleSheetPool->First(eFam, SfxStyleSearchBits::All); m_bAllowReParentDrop = pStyle && pStyle->HasParentSupport() && m_bTreeDrag; @@ -1564,6 +1564,10 @@ IMPL_LINK(StyleList, CustomRenderHdl, weld::TreeView::render_args, aPayload, voi if (pStyleSheet) { rRenderContext.Push(vcl::PushFlags::ALL); + // tdf#119919 - show "hidden" styles as disabled to not move children onto root node + if (pStyleSheet->IsHidden()) + rRenderContext.SetTextColor(rStyleSettings.GetDisableColor()); + sal_Int32 nSize = aRect.GetHeight(); std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer( pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize)); |