Sb3 : UI : minor : Colour selection cross-feed

  1. Select some text in the editor.
  2. Load up preferences (Cmd-,)
  3. Select Full Screen tab
  4. Click on a colour chip, say Notes Background
  5. Choose a colour like bright green.
  6. Close preferences.

The text that you selected should now be bright green.

Interestingly, the same bug exists in both DevonThink and MacJournal. It seems to be a Cocoa bug, although Mori and Mail get around it somehow. The colour panel sends out a message when you change a colour, and the application responds to this message by altering the colour of something. The message should only get sent to the first thing that says, “Okay, I’ll change a colour”, but it seems that the text view also gets this message regardless. So… Given how minor this is and that the bug exists in other Cocoa apps, I’m tempted to leave this one for now.

Wonderful, and that Mail gets around it means Apple knows about the bug and hasn’t fixed it. :slight_smile:

Hmm, I have managed to fix this, though it is annoying that I have had to do so. I’ve basically had to create a custom window type for the preferences panel which listens for the “change colour” message and then does nothing. This blocks the text view from ever getting it. This seems a rather silly solution, but it works and it’s lightweight.

There does seem to be an issue with the colour panel in general, though. Whilst testing this, I noticed another annoying issue: if you change a colour in the Preferences panel and then close the Preferences panel but leave the colour panel open, if you then use the colour panel to change the colour of the text or anything else, the colour that you were modifying in the Preferences panel will still be affected, even though the Preferences panel is closed, as you will notice when you open it again. You can reproduce this one in Mail, Mori, MacJournal and all the other apps I tried in. Given that this is an AppKit bug, I won’t attempt to fix this, but it is annoying. As a user, you just have to ensure that you close the colour panel after using it and before using it to change text etc.

That really is a fundamental UI problem that Apple has, in my opinion. The problem shouldn’t ever come up because when you dismiss the requester, the tools that it spawned should not hang around inviting further usage! This goes for the font tool, too. There is no reason to leave them open after the requester gone, but it does, making you feel as though it is a universal tool that is context sensitive, when in actuality the truth is more complicated.

It’s definitely problematic, and there is no easy workaround, either. I could force the colour and font panels to close when the Preferences panel closes, but this isn’t a good solution. Because these panels are application-wide, there is no way of checking whether they have been used by the Preferences panel. So the Preferences panel would end up closing these panels even if they were in use by a text view or something else…