livecode / livecode-ide

LiveCode cross-platform development environment (IDE)
https://livecode.com/
33 stars 71 forks source link

[PI] Setting gradient is quirky #964

Open montegoulding opened 8 years ago

montegoulding commented 8 years ago

When setting a gradient the following quirks were observed:

gradient

livecodeali commented 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)

montegoulding commented 8 years ago

Looks like the color dialog was made non modal here

runrevmark commented 8 years ago

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!

montegoulding commented 8 years ago

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...

montegoulding commented 8 years ago

Yep kCGPopUpMenuWindowLevel does the job nicely

livecodefraser commented 8 years ago

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.

montegoulding commented 8 years ago

Ah... yes @livecodefraser becomePseudoModalFor

montegoulding commented 8 years ago

I'll submit a PR

livecodeali commented 8 years ago

After https://github.com/livecode/livecode-ide/pull/965

montegoulding commented 8 years ago

@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.

livecodeali commented 8 years ago

@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...

montegoulding commented 8 years ago

Yeah I think it is unfixable or not a bug @livecodeali

montegoulding commented 8 years ago

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.

livecodeali commented 8 years ago

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.