HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

ColorPalette: rearranged and added field for color set names #632

Closed dsizzle closed 11 months ago

dsizzle commented 12 months ago

Fixes #255

Incidentally, all the functionality was already there to support color set labels, so basically it was a layout exercise and then wiring up what was there plus a few minor bits like setting the default name.

lmk what you think about the layout.

humdingerb commented 12 months ago

Very good. Comments:

dsizzle commented 12 months ago

Fixed the focus and the name; will think about the arrow keys.

Yeah the flickering is really bad. I guess before you couldn't resize it so it wasn't a problem.

dsizzle commented 11 months ago

I did a quick fix for the flicker; I think it's a lot better.

humdingerb commented 11 months ago

Looks flicker-free to me. 👍 BTW, by default the Colors window has minimum dimensions. The palette swatches are a bit small, even the default 16 colors. Could the default window size made a bit wider and taller, so the swatches are 2x the current height?

humdingerb commented 11 months ago

One more thing: The color set name shouldn't allowed to be empty. How about reverting to the default "Color set #" in that case?

dsizzle commented 11 months ago
dsizzle commented 11 months ago

... and added keyboard control to the color container view - it needs to have focus but then left/right/up/down and page up/page down now work as requested.

humdingerb commented 11 months ago

Nice! Would it work to have the focus be automatically on the color container view when switching to the colors window? Maybe by calling MakeFocus(true) in the view's WindowActivated()?

dsizzle commented 11 months ago

Would it work to have the focus be automatically on the color container view when switching to the colors window? Maybe by calling MakeFocus(true) in the view's WindowActivated()?

sheesh, so demanding. Your wish has been granted.

humdingerb commented 11 months ago

Beautiful! Quick, merge before I have more brilliant ideas!

BTW, would that have worked too with using the color_container view's WindowActivated()? At least I interpret the BeBook's description as such:

Implemented by derived classes to take whatever steps are necessary when the BView's window becomes the active window, or when the window gives up that status. If active is true, the window has become active. If active is false, it no longer is the active window.

dsizzle commented 11 months ago

Beautiful! Quick, merge before I have more brilliant ideas!

I appreciate all of your ideas and insight!

BTW, would that have worked too with using the color_container view's WindowActivated()?

Perhaps it might. I was just thinking that controlling the focus via the parent window makes more sense than controlling it from the container control. How does it resolve conflicts if two different controls on the same window try to get focus in their respective WindowActivated() methods?

humdingerb commented 11 months ago

I appreciate all of your ideas and insight!

"All" of them? Let's say "some" or even "most" if we want to be generous... :)

...controlling the focus via the parent window makes more sense...

Agreed.