Skip to content

Commit

Permalink
Sketcher: Tooltips for solver message hyperlinks
Browse files Browse the repository at this point in the history
================================================

I promised Uwe I would look into improving the information of the solver messages, including the abbreviation DoF.

I wanted to keep the effort by Paddle to reduce the width of the taskbar.

This commit introduces new explanatory tooltips for the hyperlinks, a different tooltip per type of information.

UrlLabel sets the tooltips automatically to the url text on change. This commit modifies the tooltip just after the change,
so that the meaningful tooltip is shown.
  • Loading branch information
abdullahtahiriyo committed Apr 21, 2023
1 parent f5eccb1 commit bfd8e5d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp
Expand Up @@ -105,6 +105,25 @@ void TaskSketcherMessages::slotSetUp(const QString& state, const QString& msg, c
ui->labelConstrainStatus->setText(msg);
ui->labelConstrainStatusLink->setUrl(link);
ui->labelConstrainStatusLink->setText(linkText);
updateToolTip(link);
}

void TaskSketcherMessages::updateToolTip(const QString& link)
{
if( link == QString::fromLatin1("#conflicting"))
ui->labelConstrainStatusLink->setToolTip(tr("Click to select the conflicting constraints."));
else
if( link == QString::fromLatin1("#redundant"))
ui->labelConstrainStatusLink->setToolTip(tr("Click to select the redundant constraints."));
else
if( link == QString::fromLatin1("#dofs"))
ui->labelConstrainStatusLink->setToolTip(tr("The sketch has unconstrained elements giving raise to those Degrees Of Freedom. Click to select the unconstrained elements."));
else
if( link == QString::fromLatin1("#malformed"))
ui->labelConstrainStatusLink->setToolTip(tr("Click to select the malformed constraints."));
else
if( link == QString::fromLatin1("#partiallyredundant"))
ui->labelConstrainStatusLink->setToolTip(tr("Some constraints in combination are partially redundant. Click to select the partially redundant constraints."));
}

void TaskSketcherMessages::onLabelConstrainStatusLinkClicked(const QString &str)

Check warning on line 129 in src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

method 'onLabelConstrainStatusLinkClicked' can be made static [readability-convert-member-functions-to-static]
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Sketcher/Gui/TaskSketcherMessages.h
Expand Up @@ -54,6 +54,8 @@ class TaskSketcherMessages : public Gui::TaskView::TaskBox
void onLabelConstrainStatusLinkClicked(const QString &);
void onAutoUpdateStateChanged();
void onManualUpdateClicked(bool checked);

void updateToolTip(const QString& link);

protected:
ViewProviderSketch *sketchView;
Expand Down

0 comments on commit bfd8e5d

Please sign in to comment.