Menu text and icon vertical alignment (+ more things)

I always used “MenuStyle * VerticalItemSpacing 0 0”, so never noticed this before, but when I use another values, for example “VerticalItemSpacing 10 10” the text does not align in the center of the icons. It, instead, keeps showing in this fashion:

----------------------
| \ /                |
|  X                 |
| / \   Text         |
----------------------
| \ /                |
|  X                 |
| / \   Text         |
----------------------

And I would like:

----------------------
| \ /                |
|  X     Text        |
| / \                |
----------------------
| \ /                |
|  X     Text        |
| / \                |
----------------------

Is there any way to align the text without giving the font a very huge size?
This is nothing critical for me, I’m just curious if a so simple option is just missing.

Cheers and thanks. :wink:

EDIT: Something more about menus :slight_smile:

I was doing some fine tuning when I decided to do with the rclick menu of my FvwmIconMan the same that I do with the Fvwm button that I have to show the menu: adjust the geometry a bit with “Rectangle”. So I did this:

...
*FvwmIconMan: Action Mouse 3 A sendcommand "Popup menu_WindowOps Rectangle +$[pointer.cx]+$[margin.t] 0 0m"
...

$[margin.t] is the top margin, that I use to set some things, like the panels geometry the EWMHStrut geometry and some other things. Anyway, that works well and is not an issue. The menu aligns ok in the y axis, just where my panels ends. :slight_smile:

The problems is about $[pointer.x]. It is supposed to hold to current x coordinate of the cursor. The menu aligns ok on the y-axis, as said before, but it takes some arbitraty position in the x-axis (concretely, the position that the cursor had when entered the FvwmIconMan.

I realised that, and then changed the variable to $[pointer.wx], and that works better, but only to a certain limit. After some research I discovered that it work ok for the windows IN THE CURRENT PAGE. And there’s a curious thing that I will try to explain.

Imagine a 3x2 layout (wich is what I use). Imagine also that I have the following programs on each page:

-------------
| a | b | c |
-------------
| d | e | f |
-------------

Ok, I go to the page (0, 2), which is the second page on the upper row, where the program ‘b’ resides. If I rclick on a task on THAT PAGE OR A PAGE IN THE SAME COLUMN then the thing is as espected. The menu opens honoring both variables and it is right under my cursor, and just next to the bottom line of the main panel where the FvwmIconMan is swallowed.

But if I click on a task outside that column then the things goes weird and the menu is displayed like if $[pointer.x] was -0 or +0. The thing seems to be totally arbitrary.

I never used that variable so I don’t know if that is not the real meaning of the variable. If it is, then I think there is a bug here. I also tried $[pointer.cx], with same results as $[pointer.wx]. :confused:

What have you got for your ‘ItemFormat’? This, controls
amongst other things the horizontal spacing of such things as
text, in this instance.

I often use $top and $left for much the same thing to the
Rectange command (they’re inherent variables that can be used
verbatim like that).

– Thomas Adam

Yup, I have one of those:

MenuStyle "*" ItemFormat "%.10|%.4r%4.4i%.|%.4s"

But what I want to control is not the horizontal spacing, but the vertical one. Imagine that a icon takes three rows, i want the text to be in the middle. It is centered by default if you use “MenuStyle * VerticalItemSpacing 0 0”, but if you specify any other values the text aligns to the ground of the cell (what would be the third row in my example).

I will look into that, thanks for the tip :wink:

Another litle anoyance by 6thpink. I wrote this today in the mailing lists, I put it here also in case anyone has ever run into a similar problem and has some advice (or want to join the club :stuck_out_tongue: )

[code]
Hello everybody.

Does anyone know if there is any known problem when using
ItemFormat strings in the menus without icons? I mean, something
like this:
MenuStyle “*” ItemFormat “%.5|%.4r%.|%.4s”

Let’s name three items in the menu from A to C, from the top to the
bottom of the menu. If I use the default (or any other string with
%.i in the middle) the thing displays as always, all is ok.

But if I use that string then, the item A is displayed where
B should be, and B is displed also one cell down, where C should
appear, so, yes, the first row appears empty, and the last item
is not visible… weird.

The most strange thing is that, even if, visually, the iterms are
disordered, they really are into the correct place, for example,
if I click into the position where A should display (which seems
empty) the A submenu is displayed, if I click into the position
where B should appears (but instead you can read A) then the B app
is launched. So, it is only the visualization which is screwed.

Tried .12 and .14, no difference. Can someone try that format
string and tell me if you can reproduce this weird behaviour?

Thanks.

  • Jesús Guerrero[/code]

I can’t help but think this is a bug. Indeed, using VerticalItemSpacing 0 0 vertically centers the text while any other values cause the text to be flush with the bottom of the item. VerticalItemSpacing defines the spacing between items, it shouldn’t have anything to do with the text.

I am sure this has since been followed up on the FVWM mailing list.

– Thomas Adam

And the verdict? 6thpink?

But this is what mailing-list archives are for. :slight_smile:

– Thomas Adam