The layer GUI is almost done, it needs support for DxfLinePatterns now.
This widget allows to select a layer to draw entities, add new ones, delete them and modify them.

Instead of using in Lua

d:layerByName("0")

we should use

active_layer()

that will prevent crashes when the layer doesn't exist.