Skip to content

Support for themes in forms #325

@jpgaribotti

Description

@jpgaribotti

Widgets created through loadWidgetsFromFile can only have renderers defined in the file itself. Even if you import a theme in gui-builder, it only copies the theme into the form. If a default theme is set, they won't pick up the default theme, and won't support "hot reloading" if you load a different theme like programatically created widgets do. This makes development somewhat less convenient, and requires duplicating the theme in every form and keeping them up to date as they are modified.

It would be nice to be able to pass a theme to loadWidgetsFromFile and have the widgets either pick the renderer for their type from there, or be able to reference (with the & syntax or a specific syntax) renderers from the theme.

I currently use a workaround for this that after loading from file walks through every widget and sets renderers (I store theme renderer names in UserData if I want something other than the default), but this is not ideal.

I could send a PR if this is something you'd be interested in supporting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions