cui/source/dialogs/whatsnewtabpage.cxx | 18 ++++++------- cui/source/inc/whatsnewtabpage.hxx | 6 ++-- cui/uiconfig/ui/welcomedialog.ui | 44 ++++++++++++++++----------------- vcl/inc/qt5/QtBuilder.hxx | 3 +- vcl/qt5/QtBuilder.cxx | 11 ++++---- 5 files changed, 42 insertions(+), 40 deletions(-)
New commits: commit 8e6c53f057e48c0f5bf9c2ea14dd24e6cbd80209 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Jun 13 10:44:35 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 13 14:09:33 2025 +0200 cui: Don't use "p" prefix for non-pointers Change-Id: I63be3cc6aa46b64f42c5e39a7cb7cebea2eba4a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186451 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/source/dialogs/whatsnewtabpage.cxx b/cui/source/dialogs/whatsnewtabpage.cxx index 01ed7d416635..6bfd152a5085 100644 --- a/cui/source/dialogs/whatsnewtabpage.cxx +++ b/cui/source/dialogs/whatsnewtabpage.cxx @@ -52,8 +52,8 @@ AnimatedBrand::AnimatedBrand() { OUString aURL(u"$BRAND_BASE_DIR/" LIBO_SHARE_SHELL_FOLDER "/animatedbrand.gif"_ustr); rtl::Bootstrap::expandMacros(aURL); - GraphicFilter::LoadGraphic(aURL, OUString(), m_pGraphic); - m_pGraphicSize = m_pGraphic.GetSizePixel(); + GraphicFilter::LoadGraphic(aURL, OUString(), m_aGraphic); + m_aGraphicSize = m_aGraphic.GetSizePixel(); } void AnimatedBrand::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) @@ -62,20 +62,20 @@ void AnimatedBrand::Paint(vcl::RenderContext& rRenderContext, const tools::Recta rRenderContext.SetBackground(COL_WHITE); rRenderContext.Erase(); - const Point aGraphicPosition((rRect.GetWidth() - m_pGraphicSize.Width()), - (rRect.GetHeight() - m_pGraphicSize.Height()) >> 1); + const Point aGraphicPosition((rRect.GetWidth() - m_aGraphicSize.Width()), + (rRect.GetHeight() - m_aGraphicSize.Height()) >> 1); #ifndef MACOSX - if (m_pGraphic.IsAnimated() && MiscSettings::IsAnimatedOthersAllowed()) - m_pGraphic.StartAnimation(rRenderContext, aGraphicPosition, m_pGraphicSize); + if (m_aGraphic.IsAnimated() && MiscSettings::IsAnimatedOthersAllowed()) + m_aGraphic.StartAnimation(rRenderContext, aGraphicPosition, m_aGraphicSize); else #endif - m_pGraphic.Draw(rRenderContext, aGraphicPosition, m_pGraphicSize); + m_aGraphic.Draw(rRenderContext, aGraphicPosition, m_aGraphicSize); tools::Rectangle aTextRect; - if (m_pGraphic.isAvailable()) + if (m_aGraphic.isAvailable()) { aTextRect.SetPos(Point(8, 8)); - aTextRect.SetSize(Size(aGraphicPosition.getX(), m_pGraphicSize.Height() - 20)); + aTextRect.SetSize(Size(aGraphicPosition.getX(), m_aGraphicSize.Height() - 20)); } else aTextRect = rRect; diff --git a/cui/source/inc/whatsnewtabpage.hxx b/cui/source/inc/whatsnewtabpage.hxx index 7eeeb0337182..5a10a57f2b3e 100644 --- a/cui/source/inc/whatsnewtabpage.hxx +++ b/cui/source/inc/whatsnewtabpage.hxx @@ -17,13 +17,13 @@ class AnimatedBrand : public weld::CustomWidgetController { private: bool m_bIsFirstStart; - Graphic m_pGraphic; - Size m_pGraphicSize; + Graphic m_aGraphic; + Size m_aGraphicSize; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; public: AnimatedBrand(); - const Size& GetGraphicSize() const { return m_pGraphicSize; }; + const Size& GetGraphicSize() const { return m_aGraphicSize; }; void SetIsFirstStart(const bool bIsFirstStart) { m_bIsFirstStart = bIsFirstStart; }; }; commit d833a023bc15e5554a21c70db62af83435aa1c2a Author: Michael Weghorn <[email protected]> AuthorDate: Fri Jun 13 10:04:32 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 13 14:09:27 2025 +0200 tdf#130857 cui: Set proper position for checkbox in Welcome dialog Set the "Do Show again" checkbox in the Welcome dialog to be at position 0 to make sure this is the first item in the button box. While gtk3 and gen show the checkbox at that position even when its position is set to the last one in the .ui file (i.e. without this change in place), that's not the case for qt6 with SAL_VCL_QT_USE_WELDED_WIDGETS=1. This fixes the following issue mentioned in previous commit Change-Id: Ibaa955798c87db2a41760dd0e6106238ddeff850 Author: Michael Weghorn <[email protected]> Date: Fri Jun 13 09:54:29 2025 +0200 tdf#130857 qt weld: Support checkbox inside button box : > With this commit in place, the checkbox text is no > long cut off. The checkbox is shown at the end > instead of at the beginning now, however, which will > be addressed in a separate commit. Change-Id: Ie2a9c493920bc835a99f434974d94ff744b834c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186445 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/uiconfig/ui/welcomedialog.ui b/cui/uiconfig/ui/welcomedialog.ui index 0a3cde4fc96a..5197807825a6 100644 --- a/cui/uiconfig/ui/welcomedialog.ui +++ b/cui/uiconfig/ui/welcomedialog.ui @@ -21,6 +21,24 @@ <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="layout-style">end</property> + <child> + <object class="GtkCheckButton" id="cbShowAgain"> + <property name="label" translatable="yes" context="welcomedialog|showagain">Do Show Again</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="pack-type">end</property> + <property name="position">0</property> + <property name="secondary">True</property> + </packing> + </child> <child> <object class="GtkButton" id="action"> <property name="label">_Apply</property> @@ -32,7 +50,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -46,7 +64,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -59,7 +77,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> @@ -75,7 +93,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> + <property name="position">4</property> </packing> </child> <child> @@ -89,25 +107,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="cbShowAgain"> - <property name="label" translatable="yes" context="welcomedialog|showagain">Do Show Again</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="use-underline">True</property> - <property name="active">True</property> - <property name="draw-indicator">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="pack-type">end</property> <property name="position">5</property> - <property name="secondary">True</property> </packing> </child> </object> commit 1340977c83cc794e0d09a4f7803bb96fc3910a6e Author: Michael Weghorn <[email protected]> AuthorDate: Fri Jun 13 09:54:29 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 13 14:09:21 2025 +0200 tdf#130857 qt weld: Support checkbox inside button box QCheckBox inherits from QAbstractButton, so can be placed inside of a QDialogButtonBox. Call QtBuilder::setButtonProperties from QtBuilder::setCheckButtonProperties to make that case work as expected, as the former takes care of inserting the QAbstractButton into the button box. It also takes care of handling the "label" property. This is used e.g. by the Welcome dialog (cui/uiconfig/ui/welcomedialog.ui) and fixes the checkbox text being cut off when using the qt6 VCL plugin with SAL_VCL_QT_USE_WELDED_WIDGETS=1 for the following scenario: * copy over profile from older LO version, e.g. copy instdir/user from LO 25.2 bibisect repo * start Writer With this commit in place, the checkbox text is no long cut off. The checkbox is shown at the end instead of at the beginning now, however, which will be addressed in a separate commit. Change-Id: Ibaa955798c87db2a41760dd0e6106238ddeff850 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186444 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx index 4d8d1368c01f..4d296693b133 100644 --- a/vcl/inc/qt5/QtBuilder.hxx +++ b/vcl/inc/qt5/QtBuilder.hxx @@ -87,7 +87,8 @@ private: // remove pOldWidget from the widget hierarchy and set (child widget) pNewWidget in its place static void replaceWidget(QWidget* pOldWidget, QWidget* pNewWidget); void setButtonProperties(QAbstractButton& rButton, stringmap& rProps, QWidget* pParentWidget); - static void setCheckButtonProperties(QAbstractButton& rButton, stringmap& rProps); + void setCheckButtonProperties(QAbstractButton& rButton, stringmap& rProps, + QWidget* pParentWidget); static void setDialogProperties(QDialog& rDialog, stringmap& rProps); static void setEntryProperties(QLineEdit& rLineEdit, stringmap& rProps); static void setLabelProperties(QLabel& rLabel, stringmap& rProps); diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index 8b02dff004a9..541130ab72a6 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -206,7 +206,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: else if (sName == u"GtkCheckButton") { QCheckBox* pCheckBox = new QCheckBox(pParentWidget); - setCheckButtonProperties(*pCheckBox, rMap); + setCheckButtonProperties(*pCheckBox, rMap, pParentWidget); pObject = pCheckBox; } else if (sName == u"GtkComboBox" || sName == u"GtkComboBoxText") @@ -320,7 +320,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: { QRadioButton* pRadioButton = new QRadioButton(pParentWidget); // apply GtkCheckButton properties because GtkRadioButton subclasses GtkCheckButton in GTK 3 - setCheckButtonProperties(*pRadioButton, rMap); + setCheckButtonProperties(*pRadioButton, rMap, pParentWidget); extractRadioButtonGroup(rId, rMap); pObject = pRadioButton; } @@ -863,7 +863,8 @@ void QtBuilder::setButtonProperties(QAbstractButton& rButton, stringmap& rProps, } } -void QtBuilder::setCheckButtonProperties(QAbstractButton& rButton, stringmap& rProps) +void QtBuilder::setCheckButtonProperties(QAbstractButton& rButton, stringmap& rProps, + QWidget* pParentWidget) { for (auto const & [ rKey, rValue ] : rProps) { @@ -877,9 +878,9 @@ void QtBuilder::setCheckButtonProperties(QAbstractButton& rButton, stringmap& rP pCheckBox->setCheckState(Qt::PartiallyChecked); } } - else if (rKey == u"label") - rButton.setText(convertAccelerator(rValue)); } + + setButtonProperties(rButton, rProps, pParentWidget); } void QtBuilder::setDialogProperties(QDialog& rDialog, stringmap& rProps)
