cui/source/dialogs/FontFeaturesDialog.cxx | 12 +++++++----- cui/source/inc/FontFeaturesDialog.hxx | 14 ++++++++------ extensions/source/propctrlr/browserline.cxx | 8 ++++---- extensions/source/propctrlr/browserline.hxx | 4 ++-- 4 files changed, 21 insertions(+), 17 deletions(-)
New commits: commit 19d9a4d0d6fcfc2b5b5c6d8b983817f94c0c1e1a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Dec 16 20:45:53 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Dec 17 22:54:34 2024 +0100 Port FontFeaturesDialog to new weld::Grid API See previous commit Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Mon Dec 16 11:02:00 2024 +0100 weld: Add weld::Grid to handle grid child positions for more background. To trigger dialog: * open context menu for paragraph in Writer * select "Character" -> "Character" to open the "Character" dialog * in the "Font" tab, click on the "Features" button Change-Id: I9b87a82c65c59b5d02ddf44df96ca85113f7ffc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178613 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index feb7f401025c..dd036c37bb28 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -25,11 +25,11 @@ FontFeaturesDialog::FontFeaturesDialog(weld::Window* pParent, OUString aFontName , m_sFontName(std::move(aFontName)) , m_xContentWindow(m_xBuilder->weld_scrolled_window(u"contentWindow"_ustr)) , m_xContentBox(m_xBuilder->weld_container(u"contentBox"_ustr)) - , m_xContentGrid(m_xBuilder->weld_container(u"contentGrid"_ustr)) + , m_xContentGrid(m_xBuilder->weld_grid(u"contentGrid"_ustr)) , m_xStylisticSetsBox(m_xBuilder->weld_container(u"stylisticSetsBox"_ustr)) - , m_xStylisticSetsGrid(m_xBuilder->weld_container(u"stylisticSetsGrid"_ustr)) + , m_xStylisticSetsGrid(m_xBuilder->weld_grid(u"stylisticSetsGrid"_ustr)) , m_xCharacterVariantsBox(m_xBuilder->weld_container(u"characterVariantsBox"_ustr)) - , m_xCharacterVariantsGrid(m_xBuilder->weld_container(u"characterVariantsGrid"_ustr)) + , m_xCharacterVariantsGrid(m_xBuilder->weld_grid(u"characterVariantsGrid"_ustr)) , m_xPreviewWindow(new weld::CustomWeld(*m_xBuilder, u"preview"_ustr, m_aPreviewWindow)) { initialize(); @@ -139,8 +139,10 @@ int FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFea sal_Int32 nGridPositionX = (nIdx % 2) * 2; sal_Int32 nGridPositionY = nIdx / 2; - aCurrentItem.m_xContainer->set_grid_left_attach(nGridPositionX); - aCurrentItem.m_xContainer->set_grid_top_attach(nGridPositionY); + aCurrentItem.m_pParentGrid->set_child_left_attach(*aCurrentItem.m_xContainer, + nGridPositionX); + aCurrentItem.m_pParentGrid->set_child_top_attach(*aCurrentItem.m_xContainer, + nGridPositionY); Link<weld::ComboBox&, void> aComboBoxSelectHandler = LINK(this, FontFeaturesDialog, ComboBoxSelectedHdl); diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index e1c8d9d97163..00551fca3ac1 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -20,10 +20,11 @@ namespace cui { struct FontFeatureItem { - FontFeatureItem(weld::Widget* pParent) - : m_aFeatureCode(0) + FontFeatureItem(weld::Grid* pParentGrid) + : m_pParentGrid(pParentGrid) + , m_aFeatureCode(0) , m_nDefault(-1) - , m_xBuilder(Application::CreateBuilder(pParent, u"cui/ui/fontfragment.ui"_ustr)) + , m_xBuilder(Application::CreateBuilder(pParentGrid, u"cui/ui/fontfragment.ui"_ustr)) , m_xContainer(m_xBuilder->weld_widget(u"fontentry"_ustr)) , m_xText(m_xBuilder->weld_label(u"label"_ustr)) , m_xCombo(m_xBuilder->weld_combo_box(u"combo"_ustr)) @@ -32,6 +33,7 @@ struct FontFeatureItem m_xCheck->connect_toggled(LINK(this, FontFeatureItem, CheckBoxToggledHdl)); } + weld::Grid* m_pParentGrid; sal_uInt32 m_aFeatureCode; sal_Int32 m_nDefault; weld::TriStateEnabled m_aTriStateEnabled; @@ -56,11 +58,11 @@ private: SvxFontPrevWindow m_aPreviewWindow; std::unique_ptr<weld::ScrolledWindow> m_xContentWindow; std::unique_ptr<weld::Container> m_xContentBox; - std::unique_ptr<weld::Container> m_xContentGrid; + std::unique_ptr<weld::Grid> m_xContentGrid; std::unique_ptr<weld::Container> m_xStylisticSetsBox; - std::unique_ptr<weld::Container> m_xStylisticSetsGrid; + std::unique_ptr<weld::Grid> m_xStylisticSetsGrid; std::unique_ptr<weld::Container> m_xCharacterVariantsBox; - std::unique_ptr<weld::Container> m_xCharacterVariantsGrid; + std::unique_ptr<weld::Grid> m_xCharacterVariantsGrid; std::unique_ptr<weld::CustomWeld> m_xPreviewWindow; void initialize(); commit f956d81ac75450710629ee883bc2193f13dd6091 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Dec 16 11:48:41 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Dec 17 22:54:26 2024 +0100 Port OBrowserLine to new weld::Grid API See previous commit Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Mon Dec 16 11:02:00 2024 +0100 weld: Add weld::Grid to handle grid child positions for more background. Change-Id: If0e0ea858a64411a137f07f33b1963185025e4d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178572 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 702c29898fa7..00c8c3f6ddb6 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -55,7 +55,7 @@ namespace pcr weld::Container* pInitialControlParent) : m_sEntryName(std::move(aEntryName)) , m_xBuilder(Application::CreateBuilder(pParent, u"modules/spropctrlr/ui/browserline.ui"_ustr)) - , m_xContainer(m_xBuilder->weld_container(u"BrowserLine"_ustr)) + , m_xGrid(m_xBuilder->weld_grid(u"BrowserLine"_ustr)) , m_xFtTitle(m_xBuilder->weld_label(u"label"_ustr)) , m_xBrowseButton(m_xBuilder->weld_button(u"browse"_ustr)) , m_xAdditionalBrowseButton(m_xBuilder->weld_button(u"morebrowse"_ustr)) @@ -77,7 +77,7 @@ namespace pcr { implHideBrowseButton(true); implHideBrowseButton(false); - m_pParent->move(m_xContainer.get(), nullptr); + m_pParent->move(m_xGrid.get(), nullptr); } void OBrowserLine::IndentTitle( bool _bIndent ) @@ -116,8 +116,8 @@ namespace pcr if ( m_pControlWindow ) { - m_pInitialControlParent->move(m_pControlWindow, m_xContainer.get()); - m_pControlWindow->set_grid_left_attach(1); + m_pInitialControlParent->move(m_pControlWindow, m_xGrid.get()); + m_xGrid->set_child_left_attach(*m_pControlWindow, 1); m_xFtTitle->set_mnemonic_widget(m_pControlWindow); m_pControlWindow->show(); } diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index dfde2969f41f..e468b5003898 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -50,7 +50,7 @@ namespace pcr private: OUString m_sEntryName; std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Container> m_xContainer; + std::unique_ptr<weld::Grid> m_xGrid; std::unique_ptr<weld::Label> m_xFtTitle; std::unique_ptr<weld::Button> m_xBrowseButton; std::unique_ptr<weld::Button> m_xAdditionalBrowseButton; @@ -91,7 +91,7 @@ namespace pcr OUString GetTitle() const; void SetTitleWidth(sal_uInt16); - int GetRowHeight() const { return m_xContainer->get_preferred_size().Height(); } + int GetRowHeight() const { return m_xGrid->get_preferred_size().Height(); } void Show(bool bFlag=true); void Hide();