DreamWall-Animation / dwpicker

Animation picker.
MIT License
155 stars 31 forks source link

Items created with "Add selection button" are not selectable when background is locked #92

Open kalemas opened 2 months ago

kalemas commented 2 months ago

See video please, i ve created a new button from editor and it can select it to edit when only when background image is unlocked

https://github.com/DreamWall-Animation/dwpicker/assets/638393/7b4e0bbb-fe08-42de-85e0-9a504e1b045a

When i manually add something to "action.targets": ["something"] in picker file, it goes well. PR will take some time, but may you have a clue where to look at.

kalemas commented 2 months ago

It seems that there is no clear issue with dwPicker, it works as stated, "Add selection button", it only was not expected that in case of empty selection and locked background button become locked. It is better to resolve this confuse but it is up to you, if it will become clear on how it have to be resolved, i would prepare PR. My ideas are: 1. prevent button creation - show query "do you really want to create button with empty selection", or 2. disabled action in menu, 3. make background item instead of button-looking-item, 4. make script button doing nothing or printing "button was created with empty selection", 5. add None targets, so item will not behave as background.

luckylyk commented 2 months ago

Hi Kalemas, Indeed, this is a "normal" behavior reading the code. I guess the best solution is that I should add an attribute on buttons to define if they are background or not instead of guessing from their content. I will always wrongly guess in some cases. In state, it means that if you create a command button, it will be not selectable before you add a commande :/