Commit Graph

3 Commits

Author SHA1 Message Date
Jehan 97b81118aa libgimpwidgets: add a "mnemonic-widget-changed" signal to GimpLabeled.
This allows to track changes of mnemonic widgets, as we do in
GimpLabelColor when we switch from editable to non-editable (or
reverse).
2022-02-17 23:24:05 +01:00
Jehan 4fecdd57d8 libgimpwidgets: allow editable GimpLabelColor.
I was initially considering a second widget, but it makes actually much
more sense to make the editability a property of the GimpLabelColor. It
also mean it can be switched on or off depending on situations.
2022-02-17 23:13:42 +01:00
Jehan d7fb0842a1 libgimpwidgets: new GimpLabelColor widget (color area with a label).
I tried to have a not too overwhelming API, so we just ask for the label
and initial color at construction. We keep sane defaults for the rest
and let people tweak the result by getting the color area widgets
themselves (if they need to force-showing flat colors or change the drag
buttons in particular).

Another thing I wondered about was the initial size of the color area.
Without a size request or being in some container expanding its
children (which may also be ugly), it ends up too small. I can imagine
such widget being used especially when you want to display several
color rectangles next to each other with a label each. So I just set it
this way. Anyone is free to request a resize after constructing the
object.

Last but not least, the position of the label was especially of interest
here. For my idea of a list of colors, I could definitely imagine color
blocks aligned with vertically-oriented labels above or below. It might
be worth adding an API for this later on.
2022-02-17 23:13:42 +01:00