Ceci est une ancienne révision du document !
For a long time users were crying out for Inkscape to have a single dialog that lists all the objects in a document. So the developers added one, back in version 0.92, but it did have an annoying side-effect of slowing the application down once the dialog was opened – even if you then closed it again! Quitting and restarting the application solved it (provided you didn’t open the dialog again), but it was frustrating enough that this feature wasn’t terribly useful on more complex projects, even though those were the ones that would most benefit from an Objects dialog. Meanwhile the long-standing Layers dialog was still performing its task admirably, but was obviously limited to showing a list of layers. With version 1.2 both these older dialogs were removed, and their functionality combined into a single ‘Layers and Objects’ dialog. In order to avoid too much confusion for long-time users, it’s available from both the Layer menu and the Object menu, so if you were used to opening either of the older dialogs from the menus you’ll still manage to find the new one. Similarly the old Layers button in the main toolbar will open the dialog, as will the Ctrl-Shift-L keyboard shortcut. One small annoyance, in my view, is that the tooltip on the toolbar button describes it simply as ‘Open Objects’ and doesn’t mention layers at all. This is particularly jarring as the ‘L’ in the keyboard shortcut is a lot easier to remember if you think of it as the ‘Layers and Objects’ dialog.
The image below shows the dialog as it appears in version 1.3. The key features are present in version 1.2, but the later release adds a few extra bits that are worth discussing. Every object, group or layer in the document gets its own line in this dialog, which shows the following items: • An indicator to show whether the layer or group has been expanded • A colored symbolic icon representing the type of object • The label of the object • An icon indicating the opacity and blend mode of the object • An icon to indicate whether or not the object is visible • An icon to indicate whether or not the object is locked • A thin swatch whose color matches that of the symbolic icon Item 1 only appears on layer or groups, and only those that contain other objects. Items 4, 5 and 6 are visible as you hover over a row with the mouse. Clicking on these three in order to change the defaults can result in them remaining visible even when the mouse has moved away – I’ll describe that in a bit more detail below.
The colors assigned to each topmost layer are drawn from a palette of 8 values, based on the label of the object. Try creating layers named “1” to “8” to see what colors are used in your chosen theme – and throw in a “9” or a “0” if you want to prove there are only 8 in use. Here are the default colors on my system: The fact that these colors are assigned based on the label means that you may end up with identical colors next to each other. Changing one of the labels a little may fix that, but if it really bothers you then you can manually set the color by clicking on the thin swatch at the right of the row. More on that shortly. Eagle-eyed readers will have noticed that I said “the colors assigned to each topmost layer”, rather than to each object. The labels of individual objects and groups – and even of sub-layers – have no bearing on the initial color that is applied. That comes entirely from the color of the topmost layer for that part of the tree. This leads to all the objects within each top layer being given the same icon color, which can be a bit of a problem if you’re the sort of person who keeps the whole structure of your drawing inside a single top-level layer.
To help address this, it’s possible to override the default color for each item in the tree by clicking on the thin swatch at the right. This brings up a small color-picker dialog in which you can change the icon’s color. If you do this on a layer, sub-layer or group, any elements created within it will be given the new color for their icon. Any existing descendent objects will also be updated to the new color, unless they’ve been explicitly overridden (or they’re in a sub-layer or group that has). The dialog provides no way to remove an override and revert back to automatic assignment. If you really want to do that, it will require a trip to the XML Editor to remove the ‘inkscape:highlight-color’ attribute. One rather annoying aspect of the color-picker dialog is that it affects the row whose swatch was last clicked, not the currently selected row. So if you wish to change the icon color for several items you will need to do it one-at-a-time, clicking on the swatch for each one. You don’t have to close the dialog in-between each of them, but it’s still rather annoying if you want to set multiple items to have the same custom color. In practice I doubt many people bother setting custom colors anyway, so it’s not a huge problem – but it would be nice to be able to use some of the advanced features of the Find/Replace dialog to select multiple items, then set them all to something that stands out prominently in the list.
Let’s move past the color of the symbolic icon and onto its shape. The choice of icon reflects the type of Inkscape object you’re looking at. The specific icons vary between themes but, on my system, layers and sub-layers appear with a page icon, groups with a folder icon, text with a “T”, and so on. If an object is clipped or masked, it also gains a small badge on the icon to indicate that state – and if a clipped object has a masked applied, or a masked object is then clipped, you do get both badges. It’s very important to note that the icon used reflects the current type of the object, which may not be how it was originally created. A rectangle that has been converted to a path, for example, will have a path icon, even if the label is still the default “rect1234” type of string. Speaking of those labels, this dialog is perhaps a more useful place to set them than via the Object Properties dialog. Just double-click on a label to edit it in-place. Don’t forget that changing the label of a top-level layer may also change the color of its icon, and those of its descendants. Do note, however, that the label is an Inkscape-specific thing that is purely there for your convenience. I tend to set the labels on layers and perhaps a few key groups or objects, but it’s rarely worth trying to set sensible labels on everything. It also doesn’t change the XML ID of the object, so JavaScript developers who want to use specific IDs for their code to reference will still need to open the Object Properties dialog or the XML Editor.
Moving on to the three icons that appear when you hover over a row, I’m going to skip the first one and come back to it shortly. The second and third are used to indicate the visibility and locked state of the object. The default for any object is for it to be both visible and unlocked, so Inkscape doesn’t bother to show the icons on rows where that’s the case. The only exception is the currently hovered row, where those icons also act as buttons to toggle the state. If you make the object invisible or locked, the corresponding icon remains visible even when you’re no longer hovering over the row, making it easy to see which objects are in the non-default state. If these icons are toggled on a layer or group, then the descendants gain a translucent version of the default icon, indicating that even though the defaults are used, their final appearance is being determined by the ancestor further up the tree: Much like these two controls, the first icon of the three is also hidden when the object is in its default state, but this is not a simple on/off toggle like the others. This control is used to indicate and change both the opacity of the object, and its blend mode. Before describing this in more detail, it’s worth considering why such a control has been added, by taking a look at the Layers dialog from version 0.92:
At the bottom are convenience controls for selecting the layer’s blend mode and opacity. To be honest, I would imagine that the blend mode popup was rarely used beyond a little experimentation. Blend modes can definitely have their uses, but although they can be used to great effect in a bitmap editor, I’ve hardly ever found a need for them in a vector graphics program. Nevertheless, having them there definitely made them far more discoverable to users than their other home inside the Filter Editor. With the new dialog in 1.2 these controls didn’t make the cut. The advice to users who wanted to use blend modes was to add them via the Filter Editor, while opacity could be set in the Fill & Stroke dialog, even for layers. In 1.3 those controls have made it into the new dialog, in the form of that first control in the trio. Personally I would have made it a quartet of controls, and kept the Opacity and Blend Mode as separate things but, instead, clicking on that icon presents a pop-up which combines both of them, looking like this:
As you can see, this pop-up allows you to adjust the Opacity using a slider, and choose the Blend Mode using a collection of radio buttons. Frustratingly there’s no numeric input for the Opacity slider, so if you want a specific value you may have to manage it via the Fill & Stroke dialog anyway. Incidentally, if you need more information about blend modes, I covered them well over a decade ago, in part 9 of this series (Full Circle Magazine #69) and aside from the change in UI the information there still holds true. The default values for an object are 100% opacity and Normal blend mode. The icon will not appear for any row with those settings unless it’s being hovered over. Reduce the opacity or change the blend mode, however, and an icon will be shown, even for non-hovered rows. Considering the states of both the opacity and blend mode, there are six possible combinations that can be shown. Here’s how they appear with the theme I use: The first, a fully filled single square, is what you’ll see when hovering over an object with the default settings. If you reduce the opacity to anything less than 100%, but greater than 0%, the second icon will be displayed. The third appears for objects with 0% opacity. I really do mean 0% - even a 0.1% opacity, despite appearing completely transparent to the human eye, will be displayed with the second icon.
If you change the blend mode, but leave the opacity at 100%, you’ll get the fourth icon. The fifth is for a non-Normal blend mode and less than 100% (but more than 0%) opacity. There isn’t a specific icon for a non-normal blend mode with 0% opacity, and the icon from row 3 is re-used. I guess this makes some sense, because a blend mode doesn’t really have an effect on a fully transparent object, but I’d still prefer to see that state called out explicitly. Each row in this dialog also has a right-click context menu that is identical to the one you would get when right-clicking on the same object on the canvas. One handy shortcut to remember is pressing ‘3’ to zoom to fit the current selection in the window: just click on an object or layer in the dialog and press 3 to bring it into view. The last thing to mention in this dialog is the toolbar at the top. Version 1.2 had a simplified version of this, lacking the search box and settings button. But it did start with a toggle to switch between a view that includes all objects and one that shows only layers – the latter mode mimicking the Layers dialog from earlier releases for those users who never really found much need for a list of every object in the document (I’m one of them). This option is still available, but has been moved into the Settings pop-up, which unfortunately makes it a little less practical to switch back and forth between the two modes as the need arises.
The second button on 1.2, or the first on 1.3, is used to create a new layer, opening the same small dialog as we’re used to from earlier releases. The Up/Down buttons shift the selected object(s) up and down the list – which also moves them up and down in the z-order. When multiple items are selected, each is moved relative to its siblings, but the entire operation is prevented if any one of them is unable to move any further. Then there’s a delete button which will delete the selected object(s) or layer(s) immediately. The Settings button has the ‘Only show layers’ option described above, but also an ‘Expand to display selection’ option. I recommend leaving this one enabled, as it causes the dialog to automatically expand any layers, sub-layers and groups that are required to ensure the selected object is visible in the tree. Turning this off stops the tree from ‘jumping around’ so much, but can make it less obvious which object is selected.
Finally, version 1.3 introduces a search box. Typing something into this and pressing Enter will filter the list to show only objects that match the string. The search is case-insensitive and will match a substring, and the test is performed against not only the label, but also the ID. No other attributes or text nodes are searched, so you can’t use this to filter by color or the contents of a text object, for example. To return to the complete list of objects, use the button in the search field to clear it – there’s no need to press Enter in this case. The addition of this feature is undoubtedly an improvement over the old Objects dialog, and it does make a lot of sense to have a single UI that shows both objects and layers. There are a few small design choices that I might have made differently, but I definitely take my hat off to the Inkscape team for completely replacing the old dialogs in an effort to push the application forward.