UI Improvements / Vertical UI Proposition

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

Petrikas wrote: Sat Jul 31, 2021 2:55 pm There's a whole bunch of things that don't work with the tooltips I made... :
- Tooltips get refreshed (reset) every time a tool is used, tools that were disabled (gray) get a double name (like in your gif)
Hmm, I do not know why this happens, probably i'm lacking some proper skills, cause in my implementation, the name is set when the tooltip is created, so i do not get why the name is duplicated while the description is not... I'll ping someone with c++ skills:
openBrain wrote: help: in the tooltip experiment of the above post, we got duplicated titles, can you give a look to my poor c++ implementation?
here is the code: https://github.com/FreeCAD/FreeCAD/comp ... s?expand=1

- Some tooltips already have a name in the tooltip, resulting in multiple names
This would be easier to standardize, also if a quite boring task :)
- Tooltips that have formatting (break lines, etc.) get put in a single line
I don't think that implementing it in action.cpp will suffer of this...
- Some tooltips have hard-coded hotkeys that don't change when you change the hotkey in the parameters.
You mean like the & character? If we use whatsThis() istead of text() we get a title that have exactly the name of the tool in the wiki and in the documentation, in english. I think that's a more convenient title for the command.

More thoughts:
I have a concern regarding the size of the title: you used < p style = \"font-size:20px\">, but this is really depending on your screen resolution, so perhaps it's not good to hard-code that.
I also tried to put an hiperlink into the tooltip, but this seems to require to write a custom tooltip object, that is really over my possibilities :)

Great job on implementing this! Not having toolnames is much worse than having double names :D
Too kind, if this is supposed to go into the master, we probably need some serious work on it, but i'm happy to have played with this for an hour or two :)
follow my experiments on BIM modelling for architecture design
User avatar
Petrikas
Posts: 122
Joined: Sat Dec 05, 2020 8:05 pm

Re: UI Improvements / Vertical UI Proposition

Post by Petrikas »

carlopav wrote: Sat Jul 31, 2021 3:24 pm ping
What I did is "for show" only, so I have something to make a gif :D

I use FreeCAD not only for CAD, but to learn python as well, so I have a sandbox that I can play in and learn. I'm only a beginner in coding, so please don't take my gibberish as something that might sense.

I'll check how the single and double named tools differ, maybe there's something about the tool names or loading that ends up with a double. Thanks again for your input!
I sometimes make FreeCAD Tutorials | VertUI | MidnightUI
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: UI Improvements / Vertical UI Proposition

Post by Kunda1 »

Sorry if I said this already, but maybe this could be a good usecase for https://github.com/FreeCAD/FreeCAD/pull/4787 ?
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
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

Probably for some of the proposed features, but in my opinion,
carlopav wrote: Wed May 19, 2021 2:34 pm Improved tooltips, new 'dropdown' indicator, locking/unlocking toolbars
are features that are desirable in every user configuration pack...
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

toltp.gif
toltp.gif (242.73 KiB) Viewed 3491 times
this does the trick:
https://github.com/FreeCAD/FreeCAD/comp ... s?expand=1

Code: Select all

Showing
with 7 additions and 1 deletion.
8 src/Gui/Command.cpp
@@ -856,8 +856,14 @@ void Command::applyCommandData(const char* context, Action* action)
{
    QString tooltip;
    tooltip.append(QString::fromLatin1("<b> < p style = \"font-size:14px\">"));
    tooltip.append(QCoreApplication::translate(
        context, getWhatsThis()));
    tooltip.append(QString::fromLatin1("</p></b>"));
    tooltip.append(QCoreApplication::translate(
        context, getToolTipText()));
    action->setToolTip(tooltip);

anyway I can't evaluate if the code is good or not... :( anyone can comment?
follow my experiments on BIM modelling for architecture design
User avatar
Petrikas
Posts: 122
Joined: Sat Dec 05, 2020 8:05 pm

Re: UI Improvements / Vertical UI Proposition

Post by Petrikas »

carlopav wrote: Mon Aug 16, 2021 2:57 pm toltp.gif

this does the trick:
https://github.com/FreeCAD/FreeCAD/comp ... s?expand=1

Code: Select all

Showing
with 7 additions and 1 deletion.
8 src/Gui/Command.cpp
@@ -856,8 +856,14 @@ void Command::applyCommandData(const char* context, Action* action)
{
    QString tooltip;
    tooltip.append(QString::fromLatin1("<b> < p style = \"font-size:14px\">"));
    tooltip.append(QCoreApplication::translate(
        context, getWhatsThis()));
    tooltip.append(QString::fromLatin1("</p></b>"));
    tooltip.append(QCoreApplication::translate(
        context, getToolTipText()));
    action->setToolTip(tooltip);

anyway I can't evaluate if the code is good or not... :( anyone can comment?
Wow, this is great effort! Visually looks perfect.
I wonder why it's pulling Tool Commands, rather than Tool Names?
I sometimes make FreeCAD Tutorials | VertUI | MidnightUI
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

Petrikas wrote: Tue Aug 17, 2021 11:05 am Wow, this is great effort! Visually looks perfect.
I wonder why it's pulling Tool Commands, rather than Tool Names?
Instead of hard coding the size i used a style h3.
I thought to use the "what's this", but we can of course use the command name... What do you think?

Edit: I used the "what's this" because it is exactly the name of the english wiki page, so, being not translated, it helped to find the exact command name on the wiki and on the forum. But of course we can also use the button text (that is translated).
Last edited by carlopav on Tue Aug 17, 2021 6:59 pm, edited 1 time in total.
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

chennes wrote: ping
Hello chris, following @Petrikas proposal I did a "not so quick" but dirty implementation of the "Improved tooltips". The purpouse is to show also the command name as a title in the tooltip text:
@Kunda1 suggested it's something that probably could be better implemented after your PR for prefereces packs get merged.

So I thought it was good to have your opinion before going for a PR (before on the implementation and later also on the code style please). What do you think?
follow my experiments on BIM modelling for architecture design
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: UI Improvements / Vertical UI Proposition

Post by chennes »

I like your idea for the improved tooltips -- I think using the translated button name for the "title" would look nicer, but I don't feel strongly about it. Maybe you could add the "What's this" in parenthesis after the tooltip text, or something like that? The code looks fine to me, it compiles and runs as expected. Since you aren't accessing any user preferences it's not really affected by my PR. What my PR could potentially give you is a path to have a (most likely hidden) preference for that "<h3>" element, so that if some style author wanted something other than <h3> they could change it. But that could easily be a bit of future work, and I don't think should stop you from submitting this PR.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: UI Improvements / Vertical UI Proposition

Post by carlopav »

tooltip2.gif
tooltip2.gif (127.56 KiB) Viewed 3221 times
Good suggestion for the "what's this"!
Here comes the PR#4978.
follow my experiments on BIM modelling for architecture design
Post Reply