cui/source/dialogs/colorpicker.cxx | 18 +++++++++--------- vcl/inc/qt5/QtBuilder.hxx | 8 ++++---- vcl/qt5/QtBuilder.cxx | 30 +++++++++++++++--------------- 3 files changed, 28 insertions(+), 28 deletions(-)
New commits: commit c0b40fed77ee6b792d663bf4e998a5f3957ec4bb Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu May 29 22:16:58 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri May 30 07:47:23 2025 +0200 cui: Make most ColorPickerDialog methods private Only the ctor and GetColor need to be public, the rest is only used internally. Also have all field declarations in once place for a better overview. Change-Id: Ibf9087c2415197052bd0f25927910aaa2a7ea5ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186026 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 296ca82b9e7a..19649399afd1 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -771,9 +771,18 @@ private: std::unique_ptr<weld::MetricSpinButton> m_xMFYellow; std::unique_ptr<weld::MetricSpinButton> m_xMFKey; + ColorMode meMode; + + double mdRed, mdGreen, mdBlue; + double mdHue, mdSat, mdBri; + double mdCyan, mdMagenta, mdYellow, mdKey; + public: ColorPickerDialog(weld::Window* pParent, Color nColor, sal_Int16 nMode); + Color GetColor() const; + +private: void update_color(UpdateFlags n = UpdateFlags::All); DECL_LINK(ColorFieldControlModifydl, ColorFieldControl&, void); @@ -783,16 +792,7 @@ public: DECL_LINK(ColorModifyEditHdl, weld::Entry&, void); DECL_LINK(ModeModifyHdl, weld::Toggleable&, void); - Color GetColor() const; - void setColorComponent(ColorComponent nComp, double dValue); - -private: - ColorMode meMode; - - double mdRed, mdGreen, mdBlue; - double mdHue, mdSat, mdBri; - double mdCyan, mdMagenta, mdYellow, mdKey; }; } commit 980c95c59a7a3105710349578af6f27019103b93 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu May 29 20:26:01 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri May 30 07:47:11 2025 +0200 tdf#130857 qt weld: Use "r" prefix for reference ... and be more consistent how to camelCase `rId` inside QtBuilder. Change-Id: Id967e7f698708ae07f08da60b259c42aa330ac39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186023 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx index ca469e31a622..4d8d1368c01f 100644 --- a/vcl/inc/qt5/QtBuilder.hxx +++ b/vcl/inc/qt5/QtBuilder.hxx @@ -45,13 +45,13 @@ public: template <typename T = QWidget> T* get(const OUString& rId); QObject* makeObject(QObject* pParent, std::u16string_view sName, std::string_view sType, - const OUString& sID, stringmap& rMap); + const OUString& rId, stringmap& rMap); virtual void applyAtkProperties(QObject* pObject, const stringmap& rProperties, bool bToolbarItem) override; virtual void applyPackingProperties(QObject* pCurrentChild, QObject* pParent, const stringmap& rPackingProperties) override; - virtual void applyTabChildProperties(QObject* pParent, const std::vector<OUString>& rIDs, + virtual void applyTabChildProperties(QObject* pParent, const std::vector<OUString>& rIds, std::vector<vcl::EnumContext::Context>& rContext, stringmap& rProperties, stringmap& rAtkProperties) override; @@ -59,7 +59,7 @@ public: const std::vector<ComboBoxTextItem>& rItems) override; virtual QObject* insertObject(QObject* pParent, const OUString& rClass, std::string_view sType, - const OUString& rID, stringmap& rProps, + const OUString& rId, stringmap& rProps, stringmap& rPangoAttributes, stringmap& rAtkProps) override; void tweakInsertedChild(QObject* pParent, QObject* pCurrentChild, std::string_view sType, @@ -77,7 +77,7 @@ public: virtual QMenu* createMenu(const OUString& rId) override; virtual void insertMenuObject(QMenu* pParent, QMenu* pSubMenu, const OUString& rClass, - const OUString& rID, stringmap& rProps, stringmap& rAtkProps, + const OUString& rId, stringmap& rProps, stringmap& rAtkProps, accelmap& rAccels) override; virtual void set_response(const OUString& rId, int nResponse) override; diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index 74c0a58bcb66..0d97fb2f5154 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -77,9 +77,9 @@ QtBuilder::QtBuilder(QWidget* pParent, std::u16string_view sUIRoot, const OUStri QtBuilder::~QtBuilder() {} -QWidget* QtBuilder::get_by_name(const OUString& rID) +QWidget* QtBuilder::get_by_name(const OUString& rId) { - auto aIt = m_aWidgets.find(rID); + auto aIt = m_aWidgets.find(rId); if (aIt != m_aWidgets.end()) return aIt->second; @@ -109,9 +109,9 @@ void QtBuilder::insertComboBoxOrListBoxItems(QObject* pObject, stringmap& rMap, } QObject* QtBuilder::insertObject(QObject* pParent, const OUString& rClass, std::string_view sType, - const OUString& rID, stringmap& rProps, stringmap&, stringmap&) + const OUString& rId, stringmap& rProps, stringmap&, stringmap&) { - QObject* pCurrentChild = makeObject(pParent, rClass, sType, rID, rProps); + QObject* pCurrentChild = makeObject(pParent, rClass, sType, rId, rProps); rProps.clear(); @@ -119,7 +119,7 @@ QObject* QtBuilder::insertObject(QObject* pParent, const OUString& rClass, std:: } QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std::string_view sType, - const OUString& sID, stringmap& rMap) + const OUString& rId, stringmap& rMap) { // ignore placeholders if (sName.empty()) @@ -278,7 +278,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: { QLabel* pLabel = new QLabel(pParentWidget); setLabelProperties(*pLabel, rMap); - extractMnemonicWidget(sID, rMap); + extractMnemonicWidget(rId, rMap); pObject = pLabel; } else if (sName == u"GtkLevelBar" || sName == u"GtkProgressBar") @@ -323,7 +323,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); - extractRadioButtonGroup(sID, rMap); + extractRadioButtonGroup(rId, rMap); pObject = pRadioButton; } else if (sName == u"GtkScrollbar") @@ -473,14 +473,14 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: if (pParentLayout) pParentLayout->addWidget(pWidget); - QtInstanceWidget::setHelpId(*pWidget, getHelpRoot() + sID); + QtInstanceWidget::setHelpId(*pWidget, getHelpRoot() + rId); pWidget->setToolTip(toQString(extractTooltipText(rMap))); pWidget->setVisible(extractVisible(rMap)); #if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) // Set GtkBuilder ID as accessible ID - pWidget->setAccessibleIdentifier(toQString(sID)); + pWidget->setAccessibleIdentifier(toQString(rId)); #endif } else if (QLayout* pLayout = qobject_cast<QLayout*>(pObject)) @@ -493,10 +493,10 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: } if (pObject) - pObject->setObjectName(toQString(sID)); + pObject->setObjectName(toQString(rId)); if (pWidget) - m_aWidgets[sID] = pWidget; + m_aWidgets[rId] = pWidget; return pObject; } @@ -675,14 +675,14 @@ void QtBuilder::setMenuActionGroup(QMenu* pMenu, QAction* pAction, const OUStrin } void QtBuilder::insertMenuObject(QMenu* pParent, QMenu* pSubMenu, const OUString& rClass, - const OUString& rID, stringmap& rProps, stringmap&, accelmap&) + const OUString& rId, stringmap& rProps, stringmap&, accelmap&) { assert(!pSubMenu && "Handling not implemented yet"); (void)pSubMenu; const QString sLabel = convertAccelerator(extractLabel(rProps)); QAction* pAction = pParent->addAction(sLabel); - pAction->setObjectName(toQString(rID)); + pAction->setObjectName(toQString(rId)); const OUString sActionName(extractActionName(rProps)); QtInstanceMenu::setActionName(*pAction, sActionName); @@ -775,7 +775,7 @@ void QtBuilder::applyPackingProperties(QObject* pCurrentChild, QObject* pParent, SAL_WARN("vcl.qt", "QtBuilder::applyPackingProperties not yet implemented for this case"); } -void QtBuilder::applyTabChildProperties(QObject* pParent, const std::vector<OUString>& rIDs, +void QtBuilder::applyTabChildProperties(QObject* pParent, const std::vector<OUString>& rIds, std::vector<vcl::EnumContext::Context>&, stringmap& rProperties, stringmap&) { @@ -784,7 +784,7 @@ void QtBuilder::applyTabChildProperties(QObject* pParent, const std::vector<OUSt // set ID and label for the last inserted tab assert(rProperties.contains(u"label"_ustr) && "Tab has no label"); - QtInstanceNotebook::setTabIdAndLabel(*pTabWidget, pTabWidget->count() - 1, rIDs.front(), + QtInstanceNotebook::setTabIdAndLabel(*pTabWidget, pTabWidget->count() - 1, rIds.front(), rProperties.at(u"label"_ustr)); }