[LyX/master] Smarter menu length calculation

Scott Kostyshak skostysh at lyx.org
Tue Apr 2 15:00:14 UTC 2024


On Tue, Apr 02, 2024 at 12:43:00PM GMT, Juergen Spitzmueller wrote:
> commit f3a4602c4c1eca9bc79e7ba0b58395b79eafe9db
> Author: Juergen Spitzmueller <spitz at lyx.org>
> Date:   Tue Apr 2 14:41:54 2024 +0200
> 
>     Smarter menu length calculation
>     
>     It is possible I have missed some shortcut conflicts, so please report
>     if you find any.
> ---

>  		MenuDefinition cat_menu = d->getMenu(toqstr(menu_name));
> -		//FIXME: 50 is a wild guess. We should take into account here
> -		//the expansion of menu items, disabled optional items etc.
> +		// We take into account here the expansion of menu items,
> +		// disabled optional items etc.
> +		MenuDefinition to_menu;
> +		d->expand(fromLyxMenu, to_menu, bv);
> +		MenuDefinition to_cat_menu;
> +		d->expand(cat_menu, to_cat_menu, bv);
>  		bool const in_sub_menu = !fromLyxMenu.empty()
> -			&& fromLyxMenu.size() + cat_menu.size() > 50 ;
> +			&& to_menu.realSize() + to_cat_menu.realSize() > 50;

I don't understand the patch, so I am guessing my comment is not
correct, but in the 1% chance: when you removed the FIXME comment I
expected the "50" to no longer be hardcoded.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240402/2ed6000a/attachment.asc>


More information about the lyx-devel mailing list