From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Subject: Re: How can I contribute the patch to the upstream?
Date: Thu, 29 Nov 2012 19:41:26 +0400 [thread overview]
Message-ID: <1395399.J5T1BaS7HD@icedphoenix> (raw)
[-- Attachment #1: Type: text/plain, Size: 163 bytes --]
You're welcome to add this patch to the upstream.
=(^_^)=
--
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
[-- Attachment #2: grub2-theme-not_selected_item_box.patch --]
[-- Type: text/x-patch, Size: 3813 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 2012-11-29 16:00:36.642209919 +0400
@@ -58,8 +58,10 @@
int need_to_recreate_boxes;
char *theme_dir;
char *menu_box_pattern;
+ char *item_box_pattern;
char *selected_item_box_pattern;
grub_gfxmenu_box_t menu_box;
+ grub_gfxmenu_box_t item_box;
grub_gfxmenu_box_t selected_item_box;
grub_gfxmenu_icon_manager_t icon_manager;
@@ -76,11 +78,14 @@
grub_free (self->theme_dir);
grub_free (self->menu_box_pattern);
+ grub_free (self->item_box_pattern);
grub_free (self->selected_item_box_pattern);
if (self->menu_box)
self->menu_box->destroy (self->menu_box);
if (self->selected_item_box)
self->selected_item_box->destroy (self->selected_item_box);
+ if (self->item_box)
+ self->item_box->destroy (self->item_box);
if (self->icon_manager)
grub_gfxmenu_icon_manager_destroy (self->icon_manager);
@@ -115,10 +120,14 @@
self->selected_item_box_pattern,
self->theme_dir);
+ grub_gui_recreate_box (&self->item_box,
+ self->item_box_pattern,
+ self->theme_dir);
+
self->need_to_recreate_boxes = 0;
}
- return (self->menu_box != 0 && self->selected_item_box != 0);
+ return (self->menu_box != 0 && self->selected_item_box != 0 && self->item_box != 0);
}
static int
@@ -212,7 +221,7 @@
static void
draw_menu (list_impl_t self, int num_shown_items)
{
- if (! self->menu_box || ! self->selected_item_box)
+ if (! self->menu_box || ! self->selected_item_box || !self->item_box)
return;
int boxpad = self->item_padding;
@@ -225,6 +234,7 @@
make_selected_item_visible (self);
+ grub_gfxmenu_box_t itbox = self->item_box;
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);
@@ -256,7 +266,15 @@
selbox->draw (selbox, 0,
item_top - sel_toppad);
}
-
+ else
+ {
+ int cwidth = oviewport.width - 2 * boxpad - 2;
+ if (itbox->get_border_width)
+ cwidth -= itbox->get_border_width (itbox);
+ itbox->set_content_size (itbox, cwidth, item_height - 1);
+ itbox->draw (itbox, 0,
+ item_top - sel_toppad);
+ }
icon = get_item_icon (self, menu_index);
if (icon != 0)
grub_video_blit_bitmap (icon, GRUB_VIDEO_BLIT_BLEND,
@@ -302,7 +320,7 @@
check_boxes (self);
- if (! self->menu_box || ! self->selected_item_box)
+ if (! self->menu_box || ! self->selected_item_box || ! self->item_box)
return;
grub_gui_set_viewport (&self->bounds, &vpsave);
@@ -487,6 +505,12 @@
grub_free (self->menu_box_pattern);
self->menu_box_pattern = value ? grub_strdup (value) : 0;
}
+ else if (grub_strcmp (name, "item_pixmap_style") == 0)
+ {
+ self->need_to_recreate_boxes = 1;
+ grub_free (self->item_box_pattern);
+ self->item_box_pattern = value ? grub_strdup (value) : 0;
+ }
else if (grub_strcmp (name, "selected_item_pixmap_style") == 0)
{
self->need_to_recreate_boxes = 1;
@@ -604,8 +628,10 @@
self->need_to_recreate_boxes = 0;
self->theme_dir = 0;
self->menu_box_pattern = 0;
+ self->item_box_pattern = 0;
self->selected_item_box_pattern = 0;
self->menu_box = grub_gfxmenu_create_box (0, 0);
+ self->item_box = grub_gfxmenu_create_box (0, 0);
self->selected_item_box = grub_gfxmenu_create_box (0, 0);
self->icon_manager = grub_gfxmenu_icon_manager_new ();
next reply other threads:[~2012-11-29 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-29 15:41 Vladimir Testov [this message]
2012-12-01 19:59 ` How can I contribute the patch to the upstream? Gerard Butler
2013-01-20 21:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
-- strict thread matches above, loose matches on Subject: below --
2012-11-29 14:07 Vladimir Testov
2012-11-29 15:27 ` 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=1395399.J5T1BaS7HD@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.