Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

[PI] Setting gradient is quirky #964

Open
montegoulding opened this issue Mar 4, 2016 · 14 comments
Open

[PI] Setting gradient is quirky #964

montegoulding opened this issue Mar 4, 2016 · 14 comments

Comments

@montegoulding
Copy link
Member

When setting a gradient the following quirks were observed:

  • It is possible to click on the color setting button without having chosen a gradient to apply even though the option menu indicates Linear (recommend set a gradient if none set yet and include a cancel button on the dialog to back out of changes)
  • It is possible to click on the color setting button without selecting a gradient stop
  • The color dialog is presented behind the gradient dialog (perhaps it can be upgraded to open as sheet?)
  • The color dialog doesn't default to the currently selected color
  • The indicator on the spectrum doesn't match the default color on the color dialog (probably engine or maybe OS X issue but noticed here)
  • When resetting to default the dialog appears in addition to clearing the gradient then choosing Linear from the option button sets a gradient on the object but doesn't indicate the gradient in the dialog.

gradient

@livecodeali
Copy link
Member

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
Copy link
Member Author

Looks like the color dialog was made non modal here

@runrevmark
Copy link
Contributor

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
Copy link
Member Author

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
Copy link
Member Author

Yep kCGPopUpMenuWindowLevel does the job nicely

@livecodefraser
Copy link
Contributor

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
Copy link
Member Author

Ah... yes @livecodefraser becomePseudoModalFor

@montegoulding
Copy link
Member Author

I'll submit a PR

@livecodeali
Copy link
Member

After #965

  • It is possible to click on the color setting button without having chosen a gradient to apply even though the option menu indicates Linear (recommend set a gradient if none set yet and include a cancel button on the dialog to back out of changes)
  • It is possible to click on the color setting button without selecting a gradient stop
  • The color dialog is presented behind the gradient dialog (perhaps it can be upgraded to open as sheet?)
  • The color dialog doesn't default to the currently selected color
  • The indicator on the spectrum doesn't match the default color on the color dialog (probably engine or maybe OS X issue but noticed here) (http://quality.livecode.com/show_bug.cgi?id=14308)
  • When resetting to default the dialog appears in addition to clearing the gradient then choosing Linear from the option button sets a gradient on the object but doesn't indicate the gradient in the dialog.

@montegoulding
Copy link
Member Author

@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 livecode/livecode#3688 deals with the modal behavior of the dialog.

@livecodeali
Copy link
Member

@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
Copy link
Member Author

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

@montegoulding
Copy link
Member Author

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
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants