This is a UX related issue, therefore I'm posting here. If its not supposed to be here, let me know.
So I discovered something weird. If you choose <none> from the FC Workbench dropdown menu, first resets the UI with no toolbars or fancy widgets AND when you open the workbench dropdown list, all the WBs have tooltips.
I'm interested in how we can have tooltips for these WBs normally, any ideas?
FC can display tooltips for WB dropdown list (but only if <none> is selected as workbench)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
FC can display tooltips for WB dropdown list (but only if <none> is selected as workbench)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FC can display tooltips for WB dropdown list (but only if <none> is selected as workbench)
The view menu shows tooltips always. That is, View -> Workbenches. This is available all the time, without choosing <none> first.
But the Workbench toolbar has a combobox object to select the workbenches. Maybe this combobox doesn't have the code to show the tooltips.
Something like this needs to be done
https://stackoverflow.com/questions/233 ... x/23381249
Code: Select all
ui->comboBox->setItemData(0, "This is a tooltip for item[0]", Qt::ToolTipRole);
For example in src/Gui/Action.cpp there is clearly code to set up the tooltips
https://github.com/FreeCAD/FreeCAD/blob ... n.cpp#L531
Code: Select all
if (w->inherits("QToolBar")) {
QToolBar* bar = qobject_cast<QToolBar*>(w);
QComboBox* box = new WorkbenchComboBox(this, w);
box->setIconSize(QSize(16, 16));
box->setToolTip(_action->toolTip());
box->setStatusTip(_action->statusTip());
box->setWhatsThis(_action->whatsThis());
box->addActions(_group->actions());
connect(_group, SIGNAL(triggered(QAction*)), box, SLOT(onActivated (QAction*)));
bar->addWidget(box);
The command that is executed is simply called "Std_Workbench", but this does not define the appearance of the combobox.
https://github.com/FreeCAD/FreeCAD/blob ... td.cpp#L76
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: FC can display tooltips for WB dropdown list (but only if <none> is selected as workbench)
Care to weigh in on this? This would be useful as we could have elaborate tooltips for each workbench that would explain what it does etc...yorik wrote:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FC can display tooltips for WB dropdown list (but only if <none> is selected as workbench)
If you really want to know where the combobox for the workbench selector is implemented you should ask Werner.
And by the way, the tooltip is just defined in the InitGui.py of each workbench in Mod/.
https://github.com/FreeCAD/FreeCAD/blob ... py#L28-L38
Code: Select all
class DraftWorkbench(Workbench):
'''The Draft Workbench definition'''
def __init__(self):
def QT_TRANSLATE_NOOP(scope, text):
return text
self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Draft/Resources/icons/DraftWorkbench.svg"
self.__class__.MenuText = QT_TRANSLATE_NOOP("draft", "Draft")
self.__class__.ToolTip = QT_TRANSLATE_NOOP("draft", "The Draft module is used for basic 2D CAD Drafting")
...
But meanwhile, you can already go to the InitGui.py of all workbenches and add the appropriate tooltip with more information.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.