[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fixed item-height, item-spacing, max-elements-shown etc

From: Vladimir Testov
Subject: Re: fixed item-height, item-spacing, max-elements-shown etc
Date: Thu, 07 Feb 2013 14:07:08 +0400
User-agent: KMail/4.8.5 (Linux/3.2.0-36-generic; KDE/4.8.5; x86_64; ; )

>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. 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.

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.

Also I have in mind some more changes:
 - width of scrollbar (similar but a little trickier)
 - move scrollbar (small fix, now scrollbar will be drawn only if we have east 
slice of the menu's bitmap.
 - if we move scrollbar then we should cut a little items' width (also if 
scrollbar's width is total scrollbar width (I mean if we use east and\or west 
slices of scrollbar_thumb or scrollbar_frame) then it will be easier to 
 - also if we move scrollbar then the total idea of the scrollbar will become 
more intuitive (like if we work with something in a "window" and it's height 
is too big then scrollbar will appear in the same "window" and cut the 
"window's" width.) Mean the scrollbar will appear inside the "window" but not 
 - now the distance between right side of the selected item's box and the 
scrollbar is exactly 2 pixels.

I see two solutions for the last problem.
1) make item_spacing be really space between elements and also the space 
between menu_items and scrollbar
2) make additional option "scrollbar_spacing"

The first idea seems to me more adequate and simple.

So the idea of making item_height be total height is interconnected with other 

>The actual fix looks much simpler - get_num_shown_items() should
>additionally account for self->selected_item_box->get_op_pad().

Also we will need:
1) update menu_box (throuhout code) so it also will have "boxing effect"
2) update height of the selected element

because of menu's box update fix won't look much simplier

>Could you make available theme that demonstrates this problem?
Yep, here's the example. Item's height is 20, item's spacing is 10.
so in 110px height menu there will be exactly 4 items (20*4+10*(4-1) == 110)

Let's suppose that we install grub2 into /boot/grub2 directory.

1. unpack test.tar.gz to /boot/grub2/test/
2. set GRUB_THEME="/boot/grub2/themes/test/theme.txt" in /etc/default/grub
3. run update-grub2 (or grub-mkconfig -o /boot/grub2/grub.cfg)
4. add "dummy" entries in /boot/grub2/grub.cfg if needed

so we see result on test_2.png - when we move to the bottom - the box of the 
selected item is not fully drawn

Sorry, for the big message.

There are some more ideas how to make grub2 theming better. I really would 
like to discuss (the ones I've mentioned and the ones I did not).

I have working solutions for the ideas I had mentioned.

With best regards,
Vladimir Testov, ROSA Laboratory.

Attachment: test_1.png
Description: PNG image

Attachment: test_2.png
Description: PNG image

Attachment: test.tar.gz
Description: application/compressed-tar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]