On 2014-10-11 12:23 , Tavmjong Bah wrote:
On Sat, 2014-10-11 at 07:13 +0200, su_v wrote:
On 2014-10-10 21:21 , Tavmjong Bah wrote:
I've replaced a large fraction of the templates in the experimental branch by "procedural" templates. This unclutters quite a bit the Templates menu as well as offering overall more options. Please test your favorite templates and give me feedback.
Great!
Would anyone be interested in an even more generic procedural template which instead of presets presets offers a number of options from the Document Properties dialog?
Snapshot (WIP, not finished): https://gist.github.com/su-v/d2f0fdc10b1d3ea7898e
Here is a brain dump of questions and observations; some are of a more broader nature:
- Can some of the functions could be put into a library to be shared
between procedural templates (e.g. add/delete layers).
Good idea.
- I am wondering if the page size presets could be broken up into
sub-categories. This might make certain categories easier to find... and would make sharing page sizes between templates easier. (BTW, I don't think "Banner 460x60" is useful in the modern age.)
The list of preset formats in empty_custom.py is copied from here: http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/ui/w...
The list was originally extracted for the inklingreader extension [1], but there only a sub-set of page sizes is shown in the AutoGUI. The procedural template currently lists all presets to mirror closely what options are available in the 'Document Properties' dialog.
Agreed that the complete list is too long for a dropdown list.
- It might be good to include the actual size in some of the page size
preset labels, e.g. there seem to be more than one "European" standard size. (See https://en.wikipedia.org/wiki/Business_card )
Agreed (and updated in the gist).
- Is it possible to gray out sections that don't apply (like when the
Page format is not "Custom")? This probably an overall extensions issue.
Currently, this is not supported in INX-based dialogs (aka "AutoGUI"). Would be really nice to have though ...
- The basis for all the templates is "default.svg" (I think). Is this
good? What if someone puts in a really weird default?
- The 'po' files determine which "default.svg" files is used. These
files differ in only one way... the name "Layer 1". Can this change be done programmatically so we can remove all the almost duplicate files?
- What if a user replaces the default file? It won't be picked up if
they don't replace the correct language dependent file.
- I thought we had a "Save default" option, I guess we don't.
The only one I am aware of is via GtkFileChooser dialog (Save as, Save a copy as), where the 'templates' directory of the current user ($XDG_CONFIG_HOME/.config/inkscape/templates) has a special hook under 'Places' on the left.
Questions specific to empty_custom.{inx,py}:
- Page 'viewBox' could use some explanation (maybe it's too specialized
for a generic template).
Agreed - currently present for testing, can be hidden (or moved to an 'Advanced' tab or template).
- "Resize margins" could also use some explanation. Is it really useful
in the generic template?
Agreed (not really useful in templates) - currently present for testing (because the namedview attributes exist and the initial goal for the extension was to implement support for as many options from 'Document Properties' as possible).
- I don't know what "apply all tabs" means.
If it is unchecked, it allows to apply only the settings of the current tab to the new document (instead of applying all settings from all tabs):
Examples: - only change the 'Display' settings - only add a number of new layers (without other changes to default.svg)
- Some kind of color value verification could be useful.
Yes, definitely needed. Another possibility would be to use the color selector widget (available in AutoGUI) for input.
- Zoom level could use an "auto" value. I'm not sure the best way of
doing this (I did a very simple thing in "empty_icons.py").
Thx, will take a look (meaningful auto value probably also is influenced by initial window size (& state)?).
- I would expect the "Guides" and "Grids" tabs to actually allow me to
define guides and grids (and with using document units).
Those two tabs currently are "placeholders" for what could be added (e.g. similar to the 'Layers' tab). For now, they only include the basic 'namedview' attributes which store options for guides and grids.
Guides could offer presets (similar to guides creator), and grids probably too (but that might conflict UX-wise with the global preference settings for new grids).
- Format for "Current layer (id)" is unclear. It will probably need some
coding change to actually work.
Agreed - I initially started with just 'Current layer (id):' on that tab (a remnant from earlier versions of the script as effect), before I added the other choices. Needs more work.
- As I was reworking the templates, I questioned how useful some of the
existing templates were to the average user (LaTeX beamer?) We could have a download section on our website for specialized templates.
Sounds reasonable to me.
Regards, V