Feature Request: Expand tooltip with GIF image

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Feature Request: Expand tooltip with GIF image

Post by JMG »

Hi!

I have been thinking about placing gif images as an extension to the icons tooltips.

The idea is that the basic tooltip behaves as it does now, but if you hang the cursor there for a bit longer it will expand to show an animated gif with a visual explanation of the tool.
IMHO this could be a good solution when icon image is not enough to define a tool, being the major drawback a bit longer workbench load time.

I have tried to retrieve the position of the icons within the FreeCAD main window, to draw a frameless widget over them containing the gif image...
...an ugly hack with no success. :(

What do you think?



Javier.
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Feature Request: Expand tooltip with GIF image

Post by ickby »

I played with an extended help tooltip one time (the idea was to use the wiki page in s simplified and small widget as tooltip, which is anvigatable). Never made it very far, but I was able to set a custom widget as tooltip widget. I don't remember the implementation details, but if interested I could look it up. It was in c++, but most likely also works in python.


EDIT: ah no my code only worked with c++. Adding a custom widget to every tool in FreeCAD from python will be hard as the action system is not really well exposed. But of course one could provide the c++ code to add a python widget. Here the code I used in src/Gui/Action.cpp:

Code: Select all


@@ -82,6 +83,10 @@ Action::~Action()
 void Action::addTo(QWidget *w)
 {
     w->addAction(_action);
+    
+    //if the action is added to a toolbar we can show the extended tooltips
+    if(QToolBar *tb = qobject_cast<QToolBar*>(w))
+       tb->widgetForAction(_action)->installEventFilter(this);
 }
 
 /**
@@ -196,6 +201,25 @@ void Action::setMenuRole(QAction::MenuRole menuRole)
     _action->setMenuRole(menuRole); 
 }
 
+bool Action::eventFilter(QObject* o, QEvent* e)
+{
+    if(e->type() == QEvent::ToolTip) {
+        
+        QToolTip::hideText();
+        if(!ExtendedActionTooltip()->isVisible() || this != ExtendedActionTooltip()->displayedAction()) {
+            QHelpEvent* he = static_cast<QHelpEvent*>(e);
+            ExtendedActionTooltip()->setGeometry(QRect(he->globalPos()+QPoint(5,15), ExtendedActionTooltip()->size()));
+            ExtendedActionTooltip()->show(this, true); 
+        }
+        return true;
+    }
+    else if (e->type() == QEvent::Leave) {
+        ExtendedActionTooltip()->show(this, false);
+    };
+        
+    return false;
+}
+
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Feature Request: Expand tooltip with GIF image

Post by triplus »

Currently user has to have help files installed, press on a button and go over individual tool and click on it to open help. To figure this out and set up takes time and understanding. And there is a problem of incomplete documentation. If this could be improved in the future that would be good.

If we would expand tooltip with GIF image what i do imagine could remain the issue.
  • Would we include the GIF image database in standard FreeCAD install packages? If not i guess a lot of users wouldn't use it.
  • And about the GIF image documentation itself. I guess it would take substantial effort to make it?
But i am in favour of improving this area as currently it's not optimal. Help could be located for example in task dialog or to add help dialog and after user clicks on a tool if documentation exists it's automatically available in that additional tab after user activates it.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Feature Request: Expand tooltip with GIF image

Post by triplus »

What i will probably explore when creating documentation for TabBar is this:

http://tiddlywiki.com/

FreeCAD already used it a few years back. I guess it could be displayed in sidebar "in mini browser mode". The challenge would therefore probably be on how to change the page after individual tool is activated. That is if documentation is available for the tool. And from FreeCAD perspective translations could represent issues. From TabBar perspective i will probably be able to "hard code" some links and that will be it. But i haven’t done any investigation about using this approach up to this point yet!
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Feature Request: Expand tooltip with GIF image

Post by JMG »

Thanks for your replies :)

@ickby
Thanks for pointing out where the tooltip its located. I'll try to do some investigation there, but my c++ skills are below zero :lol:

@triplus
My idea about the gift is to keep them as simple as possible: an image with no text.

For example:
Part design extrusion
Image

Part design revolution
Image

The only need to modify those gif images is when the tool behavior changes (something that rarely happens), so the documentation problem is kept unaltered.
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Feature Request: Expand tooltip with GIF image

Post by NormandC »

JMG wrote:The only need to modify those gif images is when the tool behavior changes (something that rarely happens), so the documentation problem is kept unaltered.
And no language translation required either.

I like it. But the Part Design extrusion gif is too fast! :D

Edit: maybe there should be a setting in the preferences to enable/disable the animated tooltips... One may tire of seeing them when the mouse pointer passes over a tool.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Feature Request: Expand tooltip with GIF image

Post by jmaustpc »

JMG wrote:example:
Part design extrusion
I can see how informative an animated gif can be, but they are generally so annoying! On my phone or Firefox on Ubuntu you don't seem to have any obvious way to stop them moving or control their speed, so they often move to fast, can't be paused, and are very distracting if they are something you don't want to see again or ever.

I can see how useful it could be for a very new newbie...but this could become annoying very quickly. I think this is a case of trying to make FreeCAD for newbies which is the wrong thing to do, they should read the wiki etc.
Joyas
Posts: 532
Joined: Sat Jul 12, 2014 8:39 pm

Re: Feature Request: Expand tooltip with GIF image

Post by Joyas »

This feature was very useful when doing my "Final Year Project" (PFC in Spain), it was done with Autodesk Revit.
Estudié ingeniería técnica industrial en España y sólo me ha servido para estar en el paro, no me contratan porque no tengo experiencia, y no tengo experiencia porque no me contratan. No debí estudiar esa carrera.
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Feature Request: Expand tooltip with GIF image

Post by cox »

NormandC wrote:I like it. But the Part Design extrusion gif is too fast! :D
That was my first reaction as well, but after watching it for a while I think the speed might be perfect. Imagine hovering over an icon and have to wait 5 seconds for the information to be revealed. It could get annoying fast. It should also be tecknicaly possible to control the speed by swapping out the frame delay for each frame as it is read from disk. That way one might have a animation speed slider or something to that effect.
jmaustpc wrote:I think this is a case of trying to make FreeCAD for newbies which is the wrong thing to do, they should read the wiki etc.
I do not understand this stance/logic. Stuff is almost never this black and white, at least when you have almost infinitely more prospective new users, than actual users. I think a more productive way of looking at the balance between usability for new and experienced users is, to be extremely vigilant when usability features soly aimed at new users is hampering productivity or quality of FreeCAD for seasoned users. And not to forget, seasoned users could be stuck in the rott, and not seeing the tree for the forest.

I think this is an excellent idea, that should be given room and ideas to grow and develop. If it evolves to its potential, I do not think it would be difficult to come up with a technical solution, so that seasoned users only see this once, or maybe ever(plugin?).
Need help? Feel free to ask, but please read the guidelines first
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Feature Request: Expand tooltip with GIF image

Post by JMG »

I can see how informative an animated gif can be, but they are generally so annoying! On my phone or Firefox on Ubuntu you don't seem to have any obvious way to stop them moving or control their speed, so they often move to fast, can't be paused, and are very distracting if they are something you don't want to see again or ever.

I can see how useful it could be for a very new newbie...but this could become annoying very quickly. I think this is a case of trying to make FreeCAD for newbies which is the wrong thing to do, they should read the wiki etc.
This is something new and is to be coded, and the good thing is that we can do it the way we want. I know that this gif images get annoying when you know what are you doing (happens to me with modern CAD tools), but because we know this and we need to code them, I think that its easy to place a small check-box or radio button in the preferences dialog.

Lowers a bit the learning curve for newbies, makes you check a small box to disable them and have the same FreeCAD as always. :)
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Post Reply