When the sane.ds TWAIN data source displays it's user interface, it auto-generates a proprties dialog from the sane options for the current scanner.
Oftenly this dialog contains windows ComboBox controls to choose between scan modes (gray / color) or resolutions.
The ComboBox controls created are too flat to properly drop down, they only open about half a line height. This is difficult to use.
This patch makes the control about 10 times the height of a string. The combox will not occupy more height than the elements that are filled in anyway.
Behaviour before the patch:
{width=305 height=244}
Behaviour after the patch:
{width=308 height=246}
From: Bernd Herd codeberg@herdsoft.com
--- dlls/sane.ds/ui.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/sane.ds/ui.c b/dlls/sane.ds/ui.c index 25a1cf33970..a8a0e13c760 100644 --- a/dlls/sane.ds/ui.c +++ b/dlls/sane.ds/ui.c @@ -281,6 +281,10 @@ static int create_item(HDC hdc, const struct option_descriptor *opt,
tpl->cx = ctl_cx; } + if (class == 0x0085 && 0!=(styles & CBS_DROPDOWNLIST)) + { /* Drop-Down ComboBox */ + tpl->cy *= 10; + } ptr = (WORD *)(tpl + 1); *ptr++ = 0xffff; *ptr++ = class;
Esme Povirk (@madewokherd) commented about dlls/sane.ds/ui.c:
tpl->cx = ctl_cx; }
- if (class == 0x0085 && 0!=(styles & CBS_DROPDOWNLIST))
This way of checking a flag confuses me. I'd be OK with `(var & FLAG) != 0`, `!!(var & FLAG)`, or even just `(var & FLAG)`.