From 3a114db48a5ecb48e93287c70b34b62edd4d00ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Sat, 30 Nov 2024 22:46:26 +0100 Subject: [PATCH] Update colortoolbar.cpp Add better tooltip. Ref: #351 --- src/ui/widgets/colortoolbar.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/ui/widgets/colortoolbar.cpp b/src/ui/widgets/colortoolbar.cpp index c6370a36f..323eaa9d0 100644 --- a/src/ui/widgets/colortoolbar.cpp +++ b/src/ui/widgets/colortoolbar.cpp @@ -114,9 +114,26 @@ void ColorToolBar::setupWidgets(Document &document) mColorBackgroundAct = new QAction(QIcon::fromTheme("color_background"), tr("Background"), this); - mColorFillAct->setToolTip(tr("Fill Color")); - mColorStrokeAct->setToolTip(tr("Stroke Color")); - mColorBackgroundAct->setToolTip(tr("Background Color")); + const QString colorToolTip = QString("

%1 Color

" + "

%2.

" + ""); + + mColorFillAct->setToolTip(QString(colorToolTip).arg(tr("Fill"), + tr("Adjust fill color for selected"))); + mColorFill->setToolTip(mColorFillAct->toolTip()); + + mColorStrokeAct->setToolTip(QString(colorToolTip).arg(tr("Stroke"), + tr("Adjust stroke color for selected"))); + mColorStroke->setToolTip(mColorStrokeAct->toolTip()); + + mColorBackgroundAct->setToolTip(QString(colorToolTip).arg(tr("Background"), + tr("Adjust background color"))); + mColorBackground->setToolTip(mColorBackgroundAct->toolTip()); connect(mColorFill, &ColorToolButton::message, this, [this](const QString &msg){ emit message(msg); });