Open montegoulding opened 8 years ago
Thanks @montegoulding - I think almost all of these are trivial to fix except the color dialog, which is opened with answer color
so there aren't any script-level mode options, and the non-matching color thing (there's an outstanding report in BZ for that)
Looks like the color dialog was made non modal here
I remember discussing this with Seb when he was trying to fix various color picker related issues. Cocoa doesn't have a modal color picker and obviously we've not managed to persuade it to be modal :( I believe QT had exactly the same problem at the time... We should see if they have made any progress is solving the issue!
I just had a little play with it and the following will at least ensure it opens above the calling modal at first:
[t_colorPicker setLevel: kCGModalPanelWindowLevel];
We could try kCGPopUpMenuWindowLevel to force the issue...
Yep kCGPopUpMenuWindowLevel does the job nicely
What Seb and I ended up doing was adding a "pseudo-modal" flag and pointer to the engine's NSApplication object that makes the engine pretend that that particular NSWindow is really modal, even when it isn't. It only affects focus and input events - it doesn't force the window to be topmost. It should probably do the relayer at the time of the "beginPseudoModalFor" call (probably not the name of the method, but it is something along those lines) so that it affects all modal dialogs, not just the colour picker.
Ah... yes @livecodefraser becomePseudoModalFor
I'll submit a PR
After https://github.com/livecode/livecode-ide/pull/965
@livecodeali I think the indicator on the spectrum issue is a different one. Try answer color "red"
and you will get a dialog with likely a target looking control on the spectrum that isn't on red, however, I think this is just standard behavior because that spectrum thing is just an image and you can add other images soo... seems unlikely the color panel will search for the preset color in the image and set the location of the target control. BTW https://github.com/livecode/livecode/pull/3688 deals with the modal behavior of the dialog.
@montegoulding Ah sorry, yes - misunderstood that one. So it may be not fixable then? I actually can't reproduce it here - I get the correct thing here as far as I can see...
Yeah I think it is unfixable or not a bug @livecodeali
Oh, the other thing I was going to suggest was it could select the first stop when the dalog opens which will resolve half of these issues. The biggest issue is probably the first one mentioned though. I think setting an initial gradient if one isn't set and adding a cancel button is the best option.
Oh hang on, my PR does fix that one too (albeit not in the way you have suggested). We should perhaps mark this as closed and open a new one for default gradient as an enhancement request.
When setting a gradient the following quirks were observed:
Linear
(recommend set a gradient if none set yet and include a cancel button on the dialog to back out of changes)