bmp-export: invalid choices aren't grayed out in rgb-format combo box
Environment/Versions
- GIMP version: current git master
- Package: git
- Operating System: All
Description of the bug
I'm trying to fix what I believe was an unintended change in the bmp export dialog, but can't figure out how:
The BMP export dialog has a combo box with different RGB formats. Those formats which aren't applicable to the current image used to be grayed out. Currently, they all remain active, and when an invalid one is chosen, it is silently replaced with the next best valid one.
The original functionality of graying them out seems to have been lost with #e6a679f2 (I believe that's when it happened, wasn't able to compile the old version to confirm). Later, with #8dd7783f, the dialog was converted to use GimpChoice.
The graying-out used to be done via the callback function format_sensitive_callback()
, set with gimp_int_combo_box_set_sensitivity()
.
The correct function to use now seems to be gimp_choice_set_sensitive()
, but I can't figure out how to get the required GimpChoice*
. Whatever gimp_procedure_dialog_get_widget()
returns cannot be used with either one (gimp_int_combo_box_set_sensitivity()
or format_sensitive_callback()
).
(I did try simply sticking it into a global variable from where it's created in bmp.c. That works, but seems very ugly)
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Open any RGB (non-indexed) image without an alpha channel
- export as BMP
…
Expected result: The formats with alpha channel (16-bit 'A1 R5 G5 B5' and 32-bit 'A8 R8 G8 B8') should be grayed out
Actual result: They're not