please no, that would be like the current trend of cookie "consent", or the previous trend of EULA, that nobody actually reads and blindly approves, but still costs some extra clicks and stress. I think we should reconsider how and what to put inside these PreferencePacks, rather than offload our uncertainties onto the unsuspecting users.
Turning Zolko's theme in to a Preference Pack
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Turning Zolko's theme in to a Preference Pack
Re: Turning Zolko's theme in to a Preference Pack
yes, I think that you're right.
another solution could be that the positions of the docked widgets and the toolbars is specified as XML data, and the PreferencePack code itself executes the Python code based on the XML data. In this case, the XML data wouldn't be a clone of existing config data, but would still look similar.
Would that be possible ?
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Turning Zolko's theme in to a Preference Pack
I don't find your code for that: could you please point me to where you're doing that stuff ? Also, what is to code to manipulate docked widgets ? So far, I've found the following:
Code: Select all
for widget in Gui.getMainWindow().children()
...
Code: Select all
Gui.getMainWindow().findChild(QtGui.QWidget,'Combo View')
Gui.getMainWindow().findChild(QtGui.QWidget,'Tree view')
Re: Turning Zolko's theme in to a Preference Pack
https://github.com/macdroid53/ZolkoBase
The code in post.FCMacro sets only the tool bar positions by setting the Tux group in the persistent toolbar group.
The docking of panels is maintained in FreeCAD.cfg in a QT byte string. I have yet to decide what/how the bytes work.
The code in post.FCMacro sets only the tool bar positions by setting the Tux group in the persistent toolbar group.
The docking of panels is maintained in FreeCAD.cfg in a QT byte string. I have yet to decide what/how the bytes work.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
- MisterMaker
- Posts: 744
- Joined: Mon Sep 21, 2020 7:41 am
- Contact:
Re: Turning Zolko's theme in to a Preference Pack
The colors are decimals of RGBA values, I would think the others are too decibels but I have no clue on how to understand them.drmacro wrote: ↑Tue Aug 30, 2022 10:59 am https://github.com/macdroid53/ZolkoBase
The code in post.FCMacro sets only the tool bar positions by setting the Tux group in the persistent toolbar group.
The docking of panels is maintained in FreeCAD.cfg in a QT byte string. I have yet to decide what/how the bytes work.
Re: Turning Zolko's theme in to a Preference Pack
I found a way to specify and change the docking position in Python :
Code: Select all
from PySide import QtGui, QtCore
mw = Gui.getMainWindow()
tv = Gui.getMainWindow().findChild(QtGui.QWidget,'Tree view')
# then
mw.addDockWidget(QtCore.Qt.LeftDockWidgetArea,tv)
tv.show()
It's also possible to save and restore the entire wain window state:
Code: Select all
mw.saveState()
=> PySide2.QtCore.QByteArray(b'\x00\x00\x00\xff\...)
mw.restoreState( QtCore.QByteArray(b'\x00\x00\x00\xff\...) )
Re: Turning Zolko's theme in to a Preference Pack
I agree, I think your first idea is a good one -- you can just make up some arbitrary preference data for your Addon that specifies the information you need, include it in your preference pack, and then use that data in your post.FCMacro file to actually move those tab bars into the appropriate positions. I think that gives users the best transparency. The alternative is to modify core FreeCAD to support preference-set tab bar positions.
Re: Turning Zolko's theme in to a Preference Pack
yes, that works ... but not on a new virgin FreeCAD install because the Tree view is not enabled. Even though it's set to enabled in the PreferencePack file. So FreeCAD segfaults. Is there a good reason why the tree view is not enabled by default ?
And this gives the docked window positions, not those of the toolbars.
- Attachments
-
- ZolkoPack.zip
- (1.63 KiB) Downloaded 24 times
Re: Turning Zolko's theme in to a Preference Pack
Is this line failing (e.g. giving "None")?
Code: Select all
tv = Gui.getMainWindow().findChild(QtGui.QWidget,'Tree view')