babluboy / bookworm

A simple ebook reader for Elementary OS
GNU General Public License v3.0
1.32k stars 100 forks source link

Disable "check word meaning" and "annotate selected text" when nothing is selected #267

Open johnfactotum opened 5 years ago

johnfactotum commented 5 years ago

In the context menu, "check word meaning" and "annotate selected text" should be disabled or hidden when nothing is selected.

babluboy commented 5 years ago

@johnfactotum Good point and agree with the same - will try to implement in this release.

babluboy commented 5 years ago

Pushed a partial fix for this issue.

Setting the menu items as disabled on the webkit context menu removes the menu, so added a condition to only execute the word meaning and annotation only if a selection is made. If no selection is done then selecting word meaning and annotation in the context menu does not do anything.

Will keep this open to try and make the items disabled rather than enabled when no selection is done.