[Feature Request] [Core] [Preferences] [UI/UX] Buttons to reset default values of Pages/Groups#10688
Conversation
…or Group Signed-off-by: CalligaroV <[email protected]>
|
Can you copy image into the OP to show what the final outcome of the PR looks like in the GUI ? |
src/Gui/DlgPreferencesImp.cpp
Outdated
| ui->buttonResetGroup->setText(tr(std::string("Reset Group\n" + group.toStdString()).c_str())); | ||
| ui->buttonResetTab->setText(tr(std::string("Reset Tab " + tabWidget->tabText(tabIndex).toStdString()).c_str())); |
There was a problem hiding this comment.
What you need here is to use the QString arg function to construct your string, so that translators see the right thing. It will looks like tr("Reset Group %1").arg(groupName). I wouldn't include the "\n" either, that will only work in English. So tell the button to wrap the text (you'll have to use a QToolButton), or something along those lines.
|
Looks great to me :-) It's a very nice enhancement. |
|
@FEA-eng Thank you very much for the appreciation! 😄 @chennes Thanks for the suggestions! About the QToolButton, I'm not sure I understood your suggestion. |
You have included a |
…or Group * reformatted texts for better translations * Morphed buttons from QPushButton to QToolButton * added code to resize items list and buttons on language change Signed-off-by: CalligaroV <[email protected]>
|
I see, so it's just to get rid of However, how is the text wrapping enabled? Besides that, I applied your other suggestion about the I also noticed that, after changing the language, the entries in the groups list lose the vertical alignment so I added some lines of code to fix that too |
|
You can apparently set a label as the widget of a pushbutton: https://stackoverflow.com/questions/8969086/is-there-a-way-to-enable-word-wrapping-of-text-on-some-simple-widgets-like-qpush and then enable word wrap... |
|
Yes, this is one of the pages I found while searching and it's indeed the code I added (basically create a label, set word wrap, add a layout to the button, insert the label into the layout) Looks like that's the most common way to have the word wrap ATM. Thanks @yorikvanhavre! |
|
@CalligaroV Is this PR ready to merge? |
|
@FEA-eng by now I can see only 2 reasons for not merging:
If this two items aren't an issue then for me it's ok to merge! |
|
I had planned on merging it at this morning merge meeting, but then I couldn't make the meeting... sorry for the delay. |
Why? The height of a tool button is different to the height of a push button and this makes the dialog looking bad. Also the behaviour when hovering or pressing a tool button is very different and this makes it more inconsistent. Having three Reset buttons now is very confusing, IMO. The buttons are somehow related but are located at very different places which makes it even more confusing. I think a better and more polished way is to switch back to a single reset button which when clicking on it opens a sub-widget with the 3 options. |
|
@chennes, thanks for merging! @wwmayer, thanks for the feedback!
I saw some differences in the height of those buttons but in my case those differences were small enough to not make it an issue for me. About the hovering behavior, have you experienced something strange because of that or are you foreseeing potential issues?
I can understand your argument and I somehow agree.
I like this idea! At this point, if you agree, I'll expose these last two point on the forum. |
|
FYI there is a UI/UX working group forming right now (details to come once the organizers have a preliminary meeting) and I know that they are planning on working on the Preferences dialog. So you might want to reach out to @obelisk79, who is organizing that effort. |
|
Use of QPushButton is more logical unless the QToolButton with dropdown is implemented. I would like to see the preferences dialog get a complete review and reorganization prior to the next full release, which is one of the reasons why I'll be eventually leading a discussion with the working group. But that will be a little bit further down the road. |
It's not only the height but its visual appearance. If you use the default desktop theme it's not that obvious but as soon as you activate one of the style sheets e.g. to Dark then the push buttons are flat and look like a label while the push buttons are raised. With other style sheets like "Behave-dark" it looks even worse because a tool button has a linear gradient while a push button hasn't it.
No issues but visual appearance only. But IMO this change contradicts to the efforts (e.g. from paddle) to make the UI more user friendly and consistent.
I don't mind what buttons you use for this sub-panel. But IMO three reset buttons are way too prominent and this isn't something a user uses all the time.
OK. Btw, I have tested this function and doesn't work in 100% of all cases because not all setting pages use "PrefWidgets" but get and set the parameters by accessing the parameter groups via the Application. Some example where it fails are:
The class DlgPreferencesImp isn't able to handle all eventualities and thus I think there should be a way to let a concrete settings class override the default behaviour. I can think of two alternatives to achieve this:
The first option is more OOP and thus probably the better choice. |
|
@chennes thanks for the info! @obelisk79 I'm sorry I couldn't attend the meeting. Is the next one already scheduled? @wwmayer, I just saw you already opened a pull request to restore the single reset button layout. Thanks! p.s. for everyone: sorry for the late reply! |
Correct. |

Fixes #10161
Forum discussion
https://forum.freecad.org/viewtopic.php?t=80253
Allows to reset the default values of a Preferences Page, as for the title of the issue, and also adds another button to reset all the Preference Pages of the chosen Group.