Workbench drop down list is long, too long.

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Workbench drop down list is long, too long.

Post by wmayer »

@wmayer: thanks for being so patient with my C++ and for all the tests, coments and hints!
Your C++ is not so bad as you always claim :)
I'm not going to make any changes unless there is something wrong, broken or missing.
I'll try out soon.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Workbench drop down list is long, too long.

Post by PrzemoF »

wmayer wrote:
@wmayer: thanks for being so patient with my C++ and for all the tests, coments and hints!
Your C++ is not so bad as you always claim :)
I'm not going to make any changes unless there is something wrong, broken or missing.
I'll try out soon.
Thanks, but that's not true :) I'm mostly copying code from other parts of FreeCAD or stackoverflow :) Then a quick variable rename, adding a random const or static and I can claim I did all the coding :D
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Workbench drop down list is long, too long.

Post by wmayer »

A few issues:
* in QlistWidgetCustom.cpp you should write:

Code: Select all

#include "PreCompiled.h"
#ifndef _PreComp_
# include <QListWidget>
# include <QDragMoveEvent>
# include <QString>
#endif
because otherwise it fails to build on Windows.

* Initialization works a bit different than with Python. The correct line is:

Code: Select all

QListWidgetCustom::QListWidgetCustom(QWidget * parent)
  : QListWidget(parent)
{
}
* only a tiny issue: The file guard of QListWidgetCustom.h can be changed to:

Code: Select all

#ifndef QLISTWIDGETCUSTOM_HPP
#define QLISTWIDGETCUSTOM_HPP
...
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Workbench drop down list is long, too long.

Post by sgrogan »

I like it :D

One very minor thing. First time with the dropdown after a change, the last item is cut off in the middle of the last entry.
Menu.png
Menu.png (45.54 KiB) Viewed 1682 times
Hovering the mouse over the menu or scrolling fixes it for the remainder of the session. Condition returns after a restart.
All workbenches can still be activated from the python console (a very good thing, I activate commands from little used wb's with a script this way for custom toolbars)

Great Job!
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.4973 (Git)
Build type: Release
Branch: workbenches_v7
Hash: 5cbd5d2ac118f781f2208044dc33f40637f5a958
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
"fight the good fight"
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Workbench drop down list is long, too long.

Post by PrzemoF »

Thanks for testing! I have no idea how I could fix that, but I'll be thinking about it. If anyone knows why the last item is cut in half please share the info!
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Workbench drop down list is long, too long.

Post by ian.rees »

This looks really good, thanks! A few items to consider:

1) If I set my enabled workbenches to not include Start (in my case: Part, Sketcher, Part Design, Drawing, FEM, Test framework), then when I open FreeCAD, the dropdown indicates that I'm in Part workbench, but Part doesn't get loaded. So, that's an inconsistent state that I think should be resolved. What would be really sweet is if your new workbench picker would let me pick the default workbench to load on startup :).

2) On my system (MacOS), the default size of the Customize dialog is now such that the tab titles are all truncated (It's "Comm... | Keyb... | Workben..." rather than "Commands" | "Keyboard" | "Workbenches") and I have to manually resize to get things looking right. Would be good to increase the Customize dialog size before pushing this out.

3) This is a somewhat more general thought, but IMHO most (all?) of the items in the Customize dialog would fit in better as pages in Preferences. To me, the distinction between what is a Preference and what is a Customization is not clear. -Ian-
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Workbench drop down list is long, too long.

Post by PrzemoF »

Thanks for testing!
ad 1). that can be done - we already have a selector in Preferences, so it's matter of deciding where it should be and merging it together.
ad 2). it's OK on my system, but the parent window is to small, so we have to strech it - that should fix both problems
ad 3). my first version of the wb picker was in Preferences :D Adding a new tab to General Preferences and merging it with selector for the start workbench seems to be a good idea. I have the same feeling about Customization/Preferences, but I have a long list what I want to change/add to FreeCAD, so I'm not even thinking about it.
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Workbench drop down list is long, too long.

Post by yorik »

ian.rees wrote: To me, the distinction between what is a Preference and what is a Customization is not clear.
Interesting thougth.. In freecad it actually doesn't bother me much (I guess I'm used to it), but it is true that I don't like that in other apps (openoffice for example, or draftsight). But also having huge, complex preferences systems where you loose hours trying to find your option is also annoying. Anyway, this deserves some thinking...
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Workbench drop down list is long, too long.

Post by wmayer »

To me, the distinction between what is a Preference and what is a Customization is not clear.
The idea doing it this way was taken from MS's Visual Studio.

When you change something in the preferences then the changes will only take effect after pressing OK or Apply. The Customize dialog originally was used for the tabs Commands, Keyboard, Toolbars and Macros. Later the two tabs for the space mouse has been added. The basic difference to the Preferences dialog is that changes take effect immediately and thus an OK or Apply button is not needed.

So, IMO it makes no sense to put everything in one dialog.
Post Reply