Turning Zolko's theme in to a Preference Pack

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

Isn't this a better solution ?
For those with a big monitor it's indeed an interesting option but not everybody has a big monitor. For my 23" monitor having a dock window on the left and right side already would require too much space.
What layout would you be missing ? It seems to me that the "Combo View" puts the TreeView above the PropertyView a,d the TaskPanel behind (and I can't un-dock it, therefore the TaskPanel always hides the TreeView):
As said with the planned change for the default mode all three views will be independent dock widgets and can be arranged as the user needs it. For the new combo mode the tree view and property view will be added to a dock widget with a QSplitter and the task view will be added to its own dock widget. Of course, this means the layout is less flexible but also requires less space.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

@Zolko @user1234
Here is the implementation of the new dock window handling: https://github.com/wwmayer/FreeCAD/tree/dock_windows
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

wmayer wrote: Fri Sep 16, 2022 8:12 am @Zolko @user1234
Here is the implementation of the new dock window handling: https://github.com/wwmayer/FreeCAD/tree/dock_windows
Nice ! It seems to work in a general usage (didn't test it extensively though) and looks good in my setup.

Now, when applying the ZolkoPack2 (the new one attached, the old one will crash FreeCAD because the Combo View is now called Tasks) from a vrigin FreeCAD (by removing the folder FreeCAD in ~/.config), then I nearly get the correct layout, except that the Task window is not shown. When I apply the post.FCMacro (included in the pack) from the Python console then it DOES show.


dock_pack.png
dock_pack.png (214.32 KiB) Viewed 1775 times

If I apply the ZolkoPack2 on a config-less startup and then type manually into the Python console:

Code: Select all

from PySide import QtGui, QtCore
Gui.getMainWindow().findChild(QtGui.QWidget,'Tasks').show()
then the Task panel is shown. I tried various orders for the panels but it doesn't change anything. I would guess that this is somehow due to the new name "Combo View" => "Tasks"


dock_zolkopack.png
dock_zolkopack.png (117.38 KiB) Viewed 1775 times

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.30341 (Git)
Build type: Compiled
Branch: master
Hash: 74ffd403643405ffd7e44e26d9b62673ffa7956a
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.56a
  * CurvedShapes 1.0.3
  * fcgear 1.0.0
  * sheetmetal 0.2.50
  * TabBar
  * Render 2022.2.0
  * Curves 0.5.1
  * fasteners 0.4.4
  * Assembly4_GitHub 0.12.4
Attachments
ZolkoPack2.zip
(1.76 KiB) Downloaded 61 times
try the Assembly4 workbench for FreCAD — tutorials here and here
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

the new one attached, the old one will crash FreeCAD because the Combo View is now called Tasks
Weird. Maybe a problem with the Qt version. Actually Qt doesn't know the relation of the Task view to the old Combo View and thus should handle it as a new dock window.
then I nearly get the correct layout, except that the Task window is not shown
Also strange. For me the Task view was visible by default.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

wmayer wrote: Fri Sep 16, 2022 1:34 pm For me the Task view was visible by default.
on config-less startup no panel is shown here
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

wmayer wrote: Fri Sep 16, 2022 1:34 pm Maybe a problem with the Qt version
But only for the Task panel ? Do you have a proposal I could test ?
try the Assembly4 workbench for FreCAD — tutorials here and here
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

No, not really.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

I tried to play with some booleans in MainWindow.cpp and Workbench.cpp:

Code: Select all

DockWindowItems* StdWorkbench::setupDockWindows() const
{
    auto root = new DockWindowItems();
    root->addDockWidget("Std_ToolBox", Qt::RightDockWidgetArea, false, false);
    //root->addDockWidget("Std_HelpView", Qt::RightDockWidgetArea, true, false);
    root->addDockWidget("Std_TreeView", Qt::LeftDockWidgetArea, true, false);
    root->addDockWidget("Std_PropertyView", Qt::LeftDockWidgetArea, true, false);

and while it did do some changes (from left to right of the window for example) it refuses to show the panels - any panel - at config-less or completely virgin startup.

Also, the Task panel shows as it should when running the post.FCMacro directly from FreeCAD, but refuses to show when applying the SAME macro with the PreferencePack. Even worse, if the Task panel is already visible, it disappears when the PreferencePack is applied.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

Zolko wrote: Fri Sep 16, 2022 8:57 pm the Task panel shows as it should when running the post.FCMacro directly from FreeCAD, but refuses to show when applying the SAME macro with the PreferencePack
ha, gotcha: the PreferencePack isn't aware of the new dock window called Std_TaskView, that's why it doesn't show it. I edited the pack .cfg file by hand to add that dock window and now the window layout shows as it should.

Next step : the toolbars.


(although I still think that such a macro included in a preference pack is dangerous)
Jolbas wrote: Sun Aug 28, 2022 6:06 am Shouldn't those scripts be considered a security risk ? It's not obvious to me that a preference pack contains executables.
Attachments
ZolkoPack3.zip
(1.63 KiB) Downloaded 56 times
try the Assembly4 workbench for FreCAD — tutorials here and here
drmacro
Veteran
Posts: 8869
Joined: Sun Mar 02, 2014 4:35 pm

Re: Turning Zolko's theme in to a Preference Pack

Post by drmacro »

The macro/s in the PP in github that I made already does the toolbars.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply