Re: [Builder] XML editor for GtkBuilder files



Comments inline

On 04/06/2015 05:40 AM, Sébastien Wilmet wrote:
I think what would be nice is a specialized XML editor for GtkBuilder
files. In short, take the good parts of Glade, but the main view would
be the XML file, with auto-completion etc.

Agreed. I've been writing all the .ui files for Builder in Builder's XML editor. Some things that work really well today:

 1) Closing of XML elements happens automatically.
 2) Auto-Indentation (and unindent) works really well.

We also have a basic HTML auto completion engine that could share a lot of the underlying code with autocomplete for .ui files. Right now, the HTML engine is hard coded from w3c data. But long term, we should have a generic XML auto-completion engine that is based on the document DTD.

Then, making this work with .ui files is as simple as us formally defining that XML format (which we should do anyway). Additionally, we could tie this into gnome-code-assistance to get invalid XML warnings.

To have an overview of the GtkBuilder file and to navigate in it easily,
there would be a side panel with the structure, like in Glade. With a
context menu on right click to e.g. insert a new parent container,
delete the element, etc.

If we use GbTree, we can have tree-builders that add nodes based on XML (which know nothing about .ui files). We can have an additional tree-builder that knows about .ui files and presents GMenu entries for the mutations.

With the XML file we are more sure that it contains what we want. With a
WYSIWYG interface, some stuff can be done accidentally without noticing
it. And since the commit diff can be really big (new parent container ->
everything is re-indented), sometimes some changed properties are
sneaked in [1].

Agreed.

I think once GSK (gtk+ scene kit) lands and we have the ability to have a canvas (in addition to traditional box hierarchy), we may want to make some radical changes to glade. However, I'm not up to speed enough to know yet.

Allan also mentioned the idea of a "live preview" for .ui files like we do for HTML and Markdown.

We need to definitely make sure that <template parent="..."> works as we start integrating glade. This is a major PITA that prevents our contributors from using Glade with Builder .ui files today.

Also, with the XML editor, new widgets would be supported automatically
(at least for the completion).

An installed DTD should win us this too.

What do you think? Note that I don't plan to work on that myself (at
least not anytime soon), it's just a thought after using Glade recently.

Everything makes sense to me. I really need to figure out what we are going to prioritize for 3.18. I need a few more days to get 3.16.1 out the door :)

-- Christian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]