@tab The image file pattern for the scroll bar thumb (the part of the scroll
bar that moves as scrolling occurs).
Example: ``scrollbar_thumb_*.png``
+ @item scrollbar_thumb_overlay
+ @tab If this option is set to ``true`` then the scrollbar thumb
+ side slices (every slice except the center slice) will overlay the
+ scrollbar frame side slices. And the center slice of the scrollbar_thumb
+ can move all the way (from top to bottom), being drawn on the center
+ slice of the scrollbar frame. That way we can make a scrollbar with
+ round-shaped edges so there won't be a free space from the thumb to
+ the frame in top and bottom scrollbar positions. Default is ``false``.
@item scrollbar_slice
@tab The menu frame styled box's slice in which the scrollbar will be
drawn. Possible values are ``west``, ``center``, ``east`` (default).
char *scrollbar_thumb_pattern;
grub_gfxmenu_box_t scrollbar_frame;
grub_gfxmenu_box_t scrollbar_thumb;
+ int scrollbar_thumb_overlay;
int scrollbar_width;
enum scrollbar_slice_mode scrollbar_slice;
int scrollbar_left_pad;
frame->set_content_size (frame,
scrollbar_width - frame_horizontal_pad,
tracklen);
+ if (self->scrollbar_thumb_overlay)
+ {
+ tracklen += thumb_vertical_pad;
+ tracktop -= thumb->get_top_pad (thumb);
+ }
int thumby = tracktop + tracklen * (value - min) / (max - min);
int thumbheight = tracklen * extent / (max - min) + 1;
/* Rare occasion: too many entries or too low height. */
thumby = tracktop + ((tracklen - thumb_vertical_pad) * (value - min)
/ (max - extent));
}
- thumb->set_content_size (thumb,
- scrollbar_width - frame_horizontal_pad
- - thumb_horizontal_pad,
+ int thumbx = frame->get_left_pad (frame);
+ int thumbwidth = scrollbar_width - frame_horizontal_pad;
+ if (!self->scrollbar_thumb_overlay)
+ thumbwidth -= thumb_horizontal_pad;
+ else
+ thumbx -= thumb->get_left_pad (thumb);
+ thumb->set_content_size (thumb, thumbwidth,
thumbheight - thumb_vertical_pad);
frame->draw (frame, 0, 0);
- thumb->draw (thumb, frame->get_left_pad (frame), thumby);
+ thumb->draw (thumb, thumbx, thumby);
}
/* Draw the list of items. */
grub_free (self->scrollbar_thumb_pattern);
self->scrollbar_thumb_pattern = value ? grub_strdup (value) : 0;
}
+ else if (grub_strcmp (name, "scrollbar_thumb_overlay") == 0)
+ {
+ self->scrollbar_thumb_overlay = grub_strcmp (value, "true") == 0;
+ }
else if (grub_strcmp (name, "scrollbar_width") == 0)
{
self->scrollbar_width = grub_strtol (value, 0, 10);
self->scrollbar_thumb = 0;
self->scrollbar_frame_pattern = 0;
self->scrollbar_thumb_pattern = 0;
+ self->scrollbar_thumb_overlay = 0;
self->scrollbar_width = 16;
self->scrollbar_slice = SCROLLBAR_SLICE_EAST;
self->scrollbar_left_pad = 2;