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!
User avatar
JMG
Posts: 278
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Feature Request: Expand tooltip with GIF image

Postby JMG » Wed Mar 23, 2016 6:56 pm

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
Posts: 2906
Joined: Wed Oct 05, 2011 7:36 am

Re: Feature Request: Expand tooltip with GIF image

Postby ickby » Wed Mar 23, 2016 9:29 pm

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
Posts: 8457
Joined: Mon Dec 12, 2011 4:45 pm

Re: Feature Request: Expand tooltip with GIF image

Postby triplus » Thu Mar 24, 2016 11:15 am

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
Posts: 8457
Joined: Mon Dec 12, 2011 4:45 pm

Re: Feature Request: Expand tooltip with GIF image

Postby triplus » Thu Mar 24, 2016 11:48 am

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!
User avatar
JMG
Posts: 278
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Feature Request: Expand tooltip with GIF image

Postby JMG » Thu Mar 24, 2016 7:04 pm

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
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Feature Request: Expand tooltip with GIF image

Postby NormandC » Thu Mar 24, 2016 11:17 pm

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
Posts: 9535
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Feature Request: Expand tooltip with GIF image

Postby jmaustpc » Fri Mar 25, 2016 12:57 am

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: 475
Joined: Sat Jul 12, 2014 8:39 pm

Re: Feature Request: Expand tooltip with GIF image

Postby Joyas » Fri Mar 25, 2016 2:10 am

This feature was very useful when doing my "Final Year Project" (PFC in Spain), it was done with Autodesk Revit.
I prefer JavaScript, I don't like Python indentation.
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: Feature Request: Expand tooltip with GIF image

Postby cox » Fri Mar 25, 2016 7:53 am

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
User avatar
JMG
Posts: 278
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Feature Request: Expand tooltip with GIF image

Postby JMG » Fri Mar 25, 2016 8:25 am

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