All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Subject: Re: fixed item-height, item-spacing, max-elements-shown etc
Date: Thu, 07 Feb 2013 14:07:08 +0400	[thread overview]
Message-ID: <42509525.u0FQyoZF34@icedphoenix> (raw)

[-- Attachment #1: Type: text/plain, Size: 3447 bytes --]

>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 
calculate)
 - 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 
outside.
 - 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 
ideas.

>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



P.S.
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.
www.rosalab.ru

[-- Attachment #2: test_1.png --]
[-- Type: image/png, Size: 47072 bytes --]

[-- Attachment #3: test_2.png --]
[-- Type: image/png, Size: 46949 bytes --]

[-- Attachment #4: test.tar.gz --]
[-- Type: application/x-compressed-tar, Size: 10895 bytes --]

             reply	other threads:[~2013-02-07 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 10:07 Vladimir Testov [this message]
2013-02-21 17:56 ` fixed item-height, item-spacing, max-elements-shown etc Andrey Borzenkov
2013-02-22  9:28   ` [PATCH] fix selected item's height Vladimir Testov
2013-02-22  9:32   ` fixed item-height, item-spacing, max-elements-shown etc Vladimir Testov
  -- strict thread matches above, loose matches on Subject: below --
2013-02-06 11:08 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=42509525.u0FQyoZF34@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.