Opened 6 years ago

Closed 2 months ago

# PATCH: fixed menu item height

Reported by: Owned by: falkb normal MenusPlugin trivial 0.12

### Description

I saw the mainnav menu item height was not correct with my Trac 0.12.2, and I don't have custom styles installed. It's displayed in FF and IE like this:

This patch fixes that:

 /*** TRAC STYLE CSS ***/ #mainnav { height: 16px; height: 14px; padding-top: 0; } .sf-menu {

### comment:1 follow-up:  2 Changed 6 years ago by Ryan J Ollos

I did some testing with Trac 0.11 and the value 14.75px gives the best results on Ubuntu 10.04 with FF 3.6.24. I doubt that will be true across all browser and OS combinations. Is there a better way to go about this than explicitly setting a value for height in the CSS?

### comment:2 in reply to:  1 ; follow-up:  3 Changed 6 years ago by anonymous

14.75px

How is a 3/4 pixel possible?

### comment:3 in reply to:  2 Changed 6 years ago by Ryan J Ollos

How is a 3/4 pixel possible?

I'm not sure, but if I zoom in many times on the page, then I reach a text size in which I can see the mainnav height change as the height is changed by a fraction of a pixel. I assume the mainnav height is just scaled by the zoom factor, so the fractional value has an effect at a high zoom factor.

Maybe that doesn't matter at all, but my point was, using a fixed pixel value for mainnav height might not be the right solution here. I can't say, I know very very little about CSS and these page layout issues.

### comment:4 Changed 6 years ago by falkb

For a while I played around with px, em, percent and that padding-top setting in different zoom levels of FF. I cannot find the one and only size. Sometimes it was too big, sometimes to small.

After all my impression is it all depends on the font of the menu item and its certain size in each zoom level plus a fixed scaled offset. The font height depends on the font which may be different on other styles or OS.

Best would be to take over the size of overlayed menu items, though I don't know how to do so.

### comment:5 Changed 6 years ago by Ryan J Ollos

Owner: changed from Catalin BALAN to Ryan J Ollos new → assigned

Yeah, I see what you mean. Your patch seems like a step in the right direction. Maybe we can get it into the repository after I finish dealing with #7399.

### comment:6 Changed 6 years ago by Ryan J Ollos

Resolution: → fixed assigned → closed

(In [11167]) Fixes #9627: Applied patch from falkb to adjust mainnav height to better match the height of the buttons for a default Trac installation. In the future, some proper CSS modifications might provide a better fix for this issue, but we don't know a better solution at the moment.

### comment:7 Changed 6 years ago by Ryan J Ollos

In Trac 0.12.2, the alignment looks correct now in FF9 on Win7-x64, but not in IE9:

### comment:8 Changed 6 years ago by falkb

Since we're talking about the height of the bar behind the menu, could a simple artifice help?: Instead of setting a fixed height, insert one single letter that should be overlayed by the foreground menu in all cases. That letter (using the same font like the menu item words) would fit the height as well, automatically.

### comment:9 Changed 6 years ago by Ryan J Ollos

I have no idea if that will work, but it sounds like a clever way to fix this if you can make it work. Maybe you could even just set the color of the letter to be the same as the background so that it is effectively invisible, regardless of a menu overlay.

### comment:10 Changed 6 years ago by falkb

Resolution: fixed closed → reopened

although I haven't got a clue when looking at this superfish stuff... hope dies at last

### comment:11 Changed 7 months ago by Ryan J Ollos

Owner: Ryan J Ollos deleted reopened → new

### comment:12 Changed 2 months ago by Ryan J Ollos

Resolution: → fixed new → closed

Height adjusted for Trac 1.2 in r16733.

### Modify Ticket

Change Properties