You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
Hello Mark,
Wondering if there is a better way of using the style definitions file.
My application is made of up of perhaps a dozen high level widgets generated by pygubu designer. And I use styles everywhere This means that the style code gets generated and included in each widget. This opens the door for these copies to get out of synch where I add/change styles for one widget and forget to regenerate all the other widgets with the changed style file.
I see your problem here. I think that the best solution will be to allow pygubu designer to fully import the styles file as module, and not to execute its content as it is doing now.
Any suggestions here?
I think in some modifications to the designer.
One restriction is that the styles should be created after the root window is instantiated and before any child widget is created. (alejandroautalan/pygubu#282)
Continuing with this idea, the module will need to define the styles inside a method and not at module level. For example, a method named "setup_ttk_styles".
Remove definition file from global configuration and move them to project level properties:
ttk style definition file: a python module file. The module file name will be saved in ui file.
ttk style setup method: a method of the definition file. Saved in the ui file.
The following example shows how it would look in the future.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
Hello Mark,
I see your problem here. I think that the best solution will be to allow pygubu designer to fully import the styles file as module, and not to execute its content as it is doing now.
I think in some modifications to the designer.
One restriction is that the styles should be created after the root window is instantiated and before any child widget is created. (alejandroautalan/pygubu#282)
Continuing with this idea, the module will need to define the styles inside a method and not at module level. For example, a method named "setup_ttk_styles".
Remove definition file from global configuration and move them to project level properties:
The following example shows how it would look in the future.
Definition file example custom_styles_module.py:
Code generated in Application Mode:
Code generated in Script Mode:
Let me know what do you think of this approach.
Regards
Alejandro A.
Originally posted by @alejandroautalan in #204 (comment)
The text was updated successfully, but these errors were encountered: