boolean check_horizontal = (IS_WHEEL_BUTTON_HORIZONTAL(button) ||
GetKeyModState() & KMOD_Shift);
+ /* check for the first active scrollbar directly under the mouse pointer */
+ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
+ {
+ if (gi->mapped && gi->active &&
+ (gi->type & GD_TYPE_SCROLLBAR) &&
+ mx >= gi->x && mx < gi->x + gi->width &&
+ my >= gi->y && my < gi->y + gi->height)
+ return gi;
+ }
+
/* check for the first active scrollbar with matching mouse wheel area */
for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
{
return;
}
+ // do not use direct gadget drawing anymore; this worked as a speed-up once,
+ // but would slow things down a lot now the screen is always fully redrawn
+ direct = FALSE;
+
if (direct)
{
BlitBitmap(drawto, window,
gi->drawing.area_ysize = va_arg(ap, int);
/* determine dependent values for drawing area gadget, if needed */
- if (gi->width == 0 && gi->height == 0 &&
- gi->drawing.item_xsize !=0 && gi->drawing.item_ysize !=0)
+ if (gi->drawing.item_xsize != 0 && gi->drawing.item_ysize != 0)
{
gi->width = gi->drawing.area_xsize * gi->drawing.item_xsize;
gi->height = gi->drawing.area_ysize * gi->drawing.item_ysize;
}
- else if (gi->drawing.item_xsize == 0 && gi->drawing.item_ysize == 0 &&
- gi->width != 0 && gi->height != 0)
+ else if (gi->width != 0 && gi->height != 0)
{
gi->drawing.item_xsize = gi->width / gi->drawing.area_xsize;
gi->drawing.item_ysize = gi->height / gi->drawing.area_ysize;
gi->drawing.item_ysize = va_arg(ap, int);
/* determine dependent values for drawing area gadget, if needed */
- if (gi->width == 0 && gi->height == 0 &&
- gi->drawing.area_xsize !=0 && gi->drawing.area_ysize !=0)
+ if (gi->drawing.area_xsize != 0 && gi->drawing.area_ysize != 0)
{
gi->width = gi->drawing.area_xsize * gi->drawing.item_xsize;
gi->height = gi->drawing.area_ysize * gi->drawing.item_ysize;
}
- else if (gi->drawing.area_xsize == 0 && gi->drawing.area_ysize == 0 &&
- gi->width != 0 && gi->height != 0)
+ else if (gi->width != 0 && gi->height != 0)
{
gi->drawing.area_xsize = gi->width / gi->drawing.item_xsize;
gi->drawing.area_ysize = gi->height / gi->drawing.item_ysize;
{
boolean scroll_single_step = ((GetKeyModState() & KMOD_Alt) != 0);
- item_steps = (scroll_single_step ? 1 : DEFAULT_WHEEL_STEPS);
+ item_steps = (scroll_single_step ? 1 : wheel_steps);
item_direction = (button == MB_WHEEL_UP ||
button == MB_WHEEL_LEFT ? -1 : +1);
}