logo       

Re: improving KupuStateButton: small proposal: msg#00013

web.kupu.devel

Subject: Re: improving KupuStateButton: small proposal

Hi Duncan!


Duncan Booth wrote:
yuppie wrote:


At least in the repository KupuStateButton objects are only used for browser commands. The browser already maintains a state of its commands. We can get this state calling queryCommandState(command). This state is not perfect, but much better than that currently maintained by Kupu.



The zoom tool is also a KupuStateButton and is not a browser command. +1 on making the sort of change you suggest, but please don't break the zoom tool.

Thanks for your feedback! Actually I forgot to grep for subclasses of KupuStateButton.

But with a small modification of my proposal this should not be a problem:

KupuStateButton would still maintain a 'pressed' variable. The only change to KupuStateButton would be the position of the commandfunc call. Moving it down 2 lines allows to overwrite the visible state from within the commandfunc.

KupuEditor.execCommand does this by calling updateState. KupuZoomTool.commandfunc doesn't touch the visible state, so everything should work as before.

Cheers,

Yuppie


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise