workbenchdev / Workbench

Code playground for GNOME 🛠️
https://apps.gnome.org/Workbench
GNU General Public License v3.0
702 stars 90 forks source link

Remember UI language #929

Open sonnyp opened 6 months ago

sonnyp commented 6 months ago

I'd love it if it remembered my choice of UI templating language; at the moment, I manually change it to "XML" every time I open a new preview.

https://floss.social/@chriswood@mastodon.design/112209275904050683

Should be quite easy to implement, we do this for Code language, see the setting recent-code-language.

DevHyperCoder commented 5 months ago

I would like to know the possibility of adding a keyboard shortcut to switch between the two (XML and blueprint)

My current workflow innvolves desiging the UI using blueprint, and then copying the XML code into a .ui file.

I have a bit of experience with GTK apps in general so I can try to contribute where I can if the feature request is accepted.

sonnyp commented 5 months ago

Not against the idea of shortcuts but perhaps we can do even better.

When you switch to XML is it to make edits or copy/paste? Do you copy into a new .ui file or an existing one?

I feel like an export action might be worth considering.

DevHyperCoder commented 5 months ago

I use blueprint to edit it (because i find it is much easier to edit) and then switch to XML, copy the code into a existing .ui file.

What exactly do you mean by a export feature ? Do you mean it as a "Save As" ?

Aside: I haven't found a way to load multiple files in workbench ? Because I don't need a whole "project" for my workflow, just being able to preview and edit the files.

vixalien commented 1 week ago

Food for thought: Remember when the Blueprint/XML used to be a simple toggle, and now it's a dropdown?

Now it takes 2 clicks to switch a language, which is kind of a regression. It would be nice if there was a "Switch" button next to the drop down to quickly change the UI language.

Or we can leverage the new AdwToggleGroup