b) If the scrollbar won't be drawn then the boot menu entry's width
is the width of the center slice.
c) We don't necessary need the menu pixmap box to display the scrollbar.
+ @item scrollbar_left_pad
+ @tab The left scrollbar padding in pixels.
+ Unused if ``scrollbar_slice`` is ``west``.
+ @item scrollbar_right_pad
+ @tab The right scrollbar padding in pixels.
+ Unused if ``scrollbar_slice`` is ``east``.
+ @item scrollbar_top_pad
+ @tab The top scrollbar padding in pixels.
+ @item scrollbar_bottom_pad
+ @tab The bottom scrollbar padding in pixels.
@item max_items_shown
@tab The maximum number of items to show on the menu. If there are more than
*max_items_shown* items in the menu, the list will scroll to make all
grub_gfxmenu_box_t scrollbar_thumb;
int scrollbar_width;
enum scrollbar_slice_mode scrollbar_slice;
+ int scrollbar_left_pad;
+ int scrollbar_right_pad;
+ int scrollbar_top_pad;
+ int scrollbar_bottom_pad;
int first_shown_index;
switch (self->scrollbar_slice)
{
case SCROLLBAR_SLICE_WEST:
- content_rect.x += 2;
- content_rect.width -= 2;
+ content_rect.x += self->scrollbar_right_pad;
+ content_rect.width -= self->scrollbar_right_pad;
break;
case SCROLLBAR_SLICE_CENTER:
if (drawing_scrollbar)
- content_rect.width -= scrollbar_width + 2;
+ content_rect.width -= scrollbar_width + self->scrollbar_left_pad
+ + self->scrollbar_right_pad;
break;
case SCROLLBAR_SLICE_EAST:
- content_rect.width -= 2;
+ content_rect.width -= self->scrollbar_left_pad;
break;
}
if (drawing_scrollbar)
{
+ content_rect.y += self->scrollbar_top_pad;
+ content_rect.height -= self->scrollbar_top_pad
+ + self->scrollbar_bottom_pad;
content_rect.width = scrollbar_width;
switch (self->scrollbar_slice)
{
break;
case SCROLLBAR_SLICE_CENTER:
content_rect.x = self->bounds.width - box_right_pad
- - scrollbar_width;
+ - scrollbar_width - self->scrollbar_right_pad;
content_rect.width = scrollbar_width;
break;
case SCROLLBAR_SLICE_EAST:
switch (self->scrollbar_slice)
{
case SCROLLBAR_SLICE_WEST:
- *width += 2;
+ *width += self->scrollbar_right_pad;
break;
case SCROLLBAR_SLICE_CENTER:
- *width += self->scrollbar_width + 2;
+ *width += self->scrollbar_width + self->scrollbar_left_pad
+ + self->scrollbar_right_pad;
break;
case SCROLLBAR_SLICE_EAST:
- *width += 2;
+ *width += self->scrollbar_left_pad;
break;
}
else if (grub_strcmp (value, "east") == 0)
self->scrollbar_slice = SCROLLBAR_SLICE_EAST;
}
+ else if (grub_strcmp (name, "scrollbar_left_pad") == 0)
+ {
+ self->scrollbar_left_pad = grub_strtol (value, 0, 10);
+ }
+ else if (grub_strcmp (name, "scrollbar_right_pad") == 0)
+ {
+ self->scrollbar_right_pad = grub_strtol (value, 0, 10);
+ }
+ else if (grub_strcmp (name, "scrollbar_top_pad") == 0)
+ {
+ self->scrollbar_top_pad = grub_strtol (value, 0, 10);
+ }
+ else if (grub_strcmp (name, "scrollbar_bottom_pad") == 0)
+ {
+ self->scrollbar_bottom_pad = grub_strtol (value, 0, 10);
+ }
else if (grub_strcmp (name, "scrollbar") == 0)
{
self->draw_scrollbar = grub_strcmp (value, "false") != 0;
self->scrollbar_thumb_pattern = 0;
self->scrollbar_width = 16;
self->scrollbar_slice = SCROLLBAR_SLICE_EAST;
+ self->scrollbar_left_pad = 2;
+ self->scrollbar_right_pad = 0;
+ self->scrollbar_top_pad = 0;
+ self->scrollbar_bottom_pad = 0;
self->first_shown_index = 0;