ashchan/safarikai

Disabling Safarikai does not gray out the icon

beschoenen opened this issue · 7 comments

This behavior has changed since the new app-extension version. In the old version clicking the icon would make it grayer as to indicate it was turned off.

Is it possible to restore this behavior?

I love the disabled gray behavior. We have a popover (dropdown menu) now so that's a little bit complicated but I'll see how to improve.

Update: just an idea: when Safarikai is enabled, when we click the icon, it shows the popover from where we can choose to "Enable". When it's disabled, the icon is grayed out, and clicking it enables it directly. It's done by changing the icon image as a true disabled toolbar item won't respond to clicking.

As the initial App Store version, 2.0 still has several issue that I'd like to address soon.

Are there APIs for double-clicking or long-clicking the icon? Cause a long click to enable/disable would be nice as well.

Are there APIs for double-clicking or long-clicking the icon? Cause a long click to enable/disable would be nice as well.

AFAIK there's no such APIs.

Update: just an idea: when Safarikai is enabled, when we click the icon, it shows the popover from where we can choose to "Enable". When it's disabled, the icon is grayed out, and clicking it enables it directly. It's done by changing the icon image as a true disabled toolbar item won't respond to clicking.

Doesn't seem to work. A toolbar item either triggers a popover or a command. That behavior is decided at design time.

Closing this. Did some research and found ATM a toolbar item with popover cannot change its image on runtime.

I could move the popover settings into the main app then change the toolbar item back to a command to restore the old 1.0 greyed out toolbar icon when enabled/disabled. Wasn't sure what would be best when I originally implemented this at that time.

I'll look into it.

Sounds good to me 👍