Skip to content

Commit

Permalink
Update colortoolbar.cpp
Browse files Browse the repository at this point in the history
Add better tooltip.

Ref: #351
  • Loading branch information
rodlie committed Nov 30, 2024
1 parent 617facf commit 3a114db
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/ui/widgets/colortoolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("<h3>%1 Color</h3>"
"<p>%2.</p>"
"<ul>"
"<li>Click to open popup</li>"
"<li><code>Scroll</code> to adjust color <b>hue</b></li>"
"<li><code>Scroll</code> + <code>Shift</code> to adjust color <b>value</b></li>"
"<li><code>Scroll</code> + <code>Ctrl</code> to adjust color <b>saturation</b></li>"
"</ul>");

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); });
Expand Down

0 comments on commit 3a114db

Please sign in to comment.