From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Subject: [PATCH] [8/11] [gfxmenu/list] scrollbar_thumb_offset
Date: Thu, 11 Apr 2013 15:32:20 +0400 [thread overview]
Message-ID: <2394091.YctMkpr2mY@icedphoenix> (raw)
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
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
[-- Attachment #2: grub-2.00-list-scrollbar-thumb-offset.patch --]
[-- Type: text/x-patch, Size: 1847 bytes --]
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 #3: tmp1.png --]
[-- Type: image/png, Size: 429 bytes --]
[-- Attachment #4: tmp2.png --]
[-- Type: image/png, Size: 423 bytes --]
reply other threads:[~2013-04-11 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2394091.YctMkpr2mY@icedphoenix \
--to=vladimir.testov@rosalab.ru \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.