A ludicrously complex PR for improving the layer panel usability.
Currently the indicator in the layers panel indicates a "can drop inside" (currently a black frame around the layer) for all layers, even though the dropped item may not be put inside the targeted item if actually dropped. What is annoying about this, is that you lose the insertion marker (above and below) as soon as you hover over a layer and you won't know where your insertion ends up.
This PR fixes this by basically checking if a dragged item can actually be inserted into another item. If not, QT will revert to inserting only above and below, i.e. giving you only insertion above and below. This simplifies usage of drag and drop inside the layers panel.
The whole use case is more obvious in conjunction with D8055 that actually displays the "drop inside" indicator as a clearly visible filled box.
The implementation is kind of hacky, unfortunately, but it is, I fear, partially QT's fault (though I'm by no means a QT expert). QT seems to want a definitive info whether an item can be a receiver of a drop (using an item flag called Qt::ItemIsDropEnabled in the KisNodeModel's item). API-wise, this flag is queried without any additional data concerning the current and thus cannot be properly changed or updated depending on the currently dragged data, using QT's API. There is a (model) function canDropMimeData in the QT API that pretends to solve this, but it basically messes up if it returns something else as the flag says (it displays an indicator but fails to perform the drag if you release the mouse, very annoying). So, after experimenting for two days, the best solution seems to be to basically reset all the Qt::ItemIsDropEnabled flags in the model each time a drag is started on the view to the values needed for this specific drag of nodes. To do this, the model needs to be informed about the drag and its contents which necessitates another small hack (using setData and a new property KisNodeModel::DropEnabled).