Sorry for delay. В Thu, 07 Feb 2013 14:07:08 +0400 Vladimir Testov <vladimir.tes...@rosalab.ru> пишет:
> >I am not sure whether it is appropriate fix. After your patch "box > >effect" on selected item is effectively lost (it makes > >selected_item_box the same height as selected item itself). > About "box effect" - there is no "box effect" in menu_box. The menu's box is > drawn inside given area. So the idea of "box effect" was unclear to me. > (Also, > the height of selected element (with box) is item_height + box_pad_top + > box_pad_bottom - 1... that "-1" makes the "box effect" totally unclear. My > idea > was to make GRUB theme be countable to pixel. But it is. You know exactly which size you need. But in practice most themes would probably use dynamic sizing by specifying screen size percentage. I am not sure if grub2 currently dynamically adjusts size to ensure whole number of items fit into it. > Also, with my patch (when we can > have a box for every unselected element) item_spacing loses it's meaning > totally. It has uncertain meaning in current GRUB state too. > It is pretty much certain meaning. Of course I agree that having more detailed "style guide" for writing grub theme would definitely help. As I understand current code, it lays out quite predictably outer image top border selected item box top border item 1 inter-item space item 2 iter-item space ... item n selected item box lower border outer image lower border selected item box itself is overlayed (or, rather, underlayed). It does not change layout. So you, as theme author, has to ensure suitable space to draw selected item box so that it fits without changing existing layout. Your patch changes text layout for selected item (by reducing available space). As text is vertically aligned, this results in "jumping effect" or part of text may be cut off. In your example setting menu size to 118 provides for full 4 items + selected item box. > I thought that idea of menu's box was more valuable because it has influence > to > the code. > > So, when we need to calculate exact values so the result will request our > expectations, the idea of item_height as total height is more acceptable. > selected item box is not really used to layout items. Only to adjust where the first item is placed, to allow for full top border to be displayed. Patch I just sent also adds space for lower border. Anyway, this is just my 2c. Hopefully somebody with commit rights or one of original theme authors can chime in :) _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel