From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Subject: Re: fixed item-height, item-spacing, max-elements-shown etc
Date: Wed, 06 Feb 2013 15:08:37 +0400 [thread overview]
Message-ID: <1979241.kBLIK5IbDB@icedphoenix> (raw)
[-- Attachment #1: Type: text/plain, Size: 152 bytes --]
Oh. One more white-space removed. That's better.
--
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
[-- Attachment #2: grub2-item-height-size-fix.patch --]
[-- Type: text/x-patch, Size: 1965 bytes --]
diff -Naur grub-2.00/grub-core/gfxmenu/gui_list.c grub-new/grub-core/gfxmenu/gui_list.c
--- grub-2.00/grub-core/gfxmenu/gui_list.c 2011-12-14 14:36:07.000000000 +0400
+++ grub-new/grub-core/gfxmenu/gui_list.c 2013-02-06 15:06:36.620696079 +0400
@@ -228,7 +228,9 @@
grub_gfxmenu_box_t selbox = self->selected_item_box;
int sel_leftpad = selbox->get_left_pad (selbox);
int sel_toppad = selbox->get_top_pad (selbox);
- int item_top = sel_toppad;
+ int sel_vertical_pad = sel_toppad
+ + selbox->get_bottom_pad (selbox);
+ int item_top = 0;
int menu_index;
int visible_index;
struct grub_video_rect oviewport;
@@ -252,9 +254,13 @@
int cwidth = oviewport.width - 2 * boxpad - 2;
if (selbox->get_border_width)
cwidth -= selbox->get_border_width (selbox);
- selbox->set_content_size (selbox, cwidth, item_height - 1);
- selbox->draw (selbox, 0,
- item_top - sel_toppad);
+ int cheight = item_height - sel_vertical_pad;
+ if (cwidth < 1)
+ cwidth = 1;
+ if (cheight < 1)
+ cheight = 1;
+ selbox->set_content_size (selbox, cwidth, cheight);
+ selbox->draw (selbox, 0, item_top);
}
icon = get_item_icon (self, menu_index);
@@ -391,9 +397,6 @@
int box_bottom_pad = box->get_bottom_pad (box);
unsigned width_s;
- grub_gfxmenu_box_t selbox = self->selected_item_box;
- int sel_toppad = selbox->get_top_pad (selbox);
-
*width = grub_font_get_string_width (self->item_font, "Typical OS");
width_s = grub_font_get_string_width (self->selected_item_font,
"Typical OS");
@@ -406,7 +409,7 @@
*height = (item_height * num_items
+ item_vspace * (num_items - 1)
+ 2 * boxpad
- + box_top_pad + box_bottom_pad + sel_toppad);
+ + box_top_pad + box_bottom_pad);
}
else
{
next reply other threads:[~2013-02-06 11:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 11:08 Vladimir Testov [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-02-07 10:07 fixed item-height, item-spacing, max-elements-shown etc Vladimir Testov
2013-02-21 17:56 ` Andrey Borzenkov
2013-02-22 9:32 ` Vladimir Testov
2013-02-06 10:26 Vladimir Testov
2013-02-05 20:21 Vladimir Testov
2013-02-06 2:49 ` Andrey Borzenkov
[not found] <1553109984.2496.1360082210371.JavaMail.root@collab.rosalab.ru>
2013-02-05 16:44 ` Vladimir Testov
2013-02-06 18:14 ` Andrey Borzenkov
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=1979241.kBLIK5IbDB@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.