I've found that I miss this options if I want to do something like scrollvar 
thumb, rounded on the edges. (see screenshots)

tmp1 - the bottom position - before

tmp2 - the bottom position - after (with offsets)

-- 
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
diff -Naur grub-new8/grub-core/gfxmenu/gui_list.c grub-new9/grub-core/gfxmenu/gui_list.c
--- grub-new8/grub-core/gfxmenu/gui_list.c	2013-03-26 20:50:56.171267835 +0400
+++ grub-new9/grub-core/gfxmenu/gui_list.c	2013-03-27 11:27:43.851690260 +0400
@@ -53,6 +53,8 @@
   char *scrollbar_thumb_pattern;
   grub_gfxmenu_box_t scrollbar_frame;
   grub_gfxmenu_box_t scrollbar_thumb;
+  int thumb_top_offset;
+  int thumb_bottom_offset;
   int scrollbar_width;
   int scrollbar_left_pad;
   int scrollbar_right_pad;
@@ -212,6 +214,11 @@
   int tracktop = topy + frame->get_top_pad (frame);
   int tracklen = height - frame_vertical_pad;
   frame->set_content_size (frame, self->scrollbar_width, tracklen);
+  if (self->list_version > 0)
+    {
+      tracktop += self->thumb_top_offset;
+      tracklen += self->thumb_bottom_offset - self->thumb_top_offset;
+    }
   int thumby = tracktop + tracklen * (value - min) / (max - min);
   int thumbheight = tracklen * extent / (max - min) + 1;
   thumb->set_content_size (thumb,
@@ -612,6 +619,14 @@
       grub_free (self->scrollbar_thumb_pattern);
       self->scrollbar_thumb_pattern = value ? grub_strdup (value) : 0;
     }
+  else if (grub_strcmp (name, "thumb_top_offset") == 0)
+    {
+      self->thumb_top_offset = grub_strtol (value, 0, 10);
+    }
+  else if (grub_strcmp (name, "thumb_bottom_offset") == 0)
+    {
+      self->thumb_bottom_offset = grub_strtol (value, 0, 10);
+    }
   else if (grub_strcmp (name, "scrollbar_width") == 0)
     {
       self->scrollbar_width = grub_strtol (value, 0, 10);
@@ -726,6 +741,8 @@
   self->scrollbar_thumb = 0;
   self->scrollbar_frame_pattern = 0;
   self->scrollbar_thumb_pattern = 0;
+  self->thumb_top_offset = 0;
+  self->thumb_bottom_offset = 0;
   self->scrollbar_width = 16;
   self->scrollbar_left_pad = 2;
   self->scrollbar_right_pad = 0;

<<attachment: tmp1.png>>

<<attachment: tmp2.png>>

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to