Styling menu size with FireMonkey

43 Views Asked by At

I am trying to increase the size of a the drop-down items in a TMenuBar menu using FireMonkey on Windows platform (because when using a touch-screen it is difficult to press the right menu item). I thought I should be able to do this by changing the X and Y scaling of menuitemstyle in my stylebook, but when I do, it changes only the size of the contents of the menu, and not the structure containing the contents, as shown here.enter image description here I have tried playing with all the size options I can find, but haven't found a way to change the size of the elements that drop down. Does anybody have any suggestions to fix this problem, please?

1

There are 1 best solutions below

0
On

Changing the fixedheight of the menubaritemstyle (by code or modifying style) is not the better solution because submenu don't behave correctly. I found a better way, not involving style, even if at this moment I don't see how to take care of MenuBar Height .

If you have the sources, copy the FMX.Menu.pas into the app directory. Change file attribute, removing readonly. Go to line 1636 D11 *line 1650 for D12 You can see that a constant 23 is used for the height.

Change it to the value you want.

P.S. I tried FContent.Height, but this gave me a 50 value, that why I suggest a copy of the original source.

Add this new unit to the project and submenu should be OK