scrollbar_thumb_offset
PATCH 8/11 scrollbar_thumb_offset
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)
Signature · 4 lines
With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru
grub-core/gfxmenu/gui_list.c +17 -0
@@ -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 ;