Lazarus

Using the Lazarus IDE => Editor => Topic started by: Nicole on November 29, 2022, 01:10:57 pm

Title: menue - ident icons
Post by: Nicole on November 29, 2022, 01:10:57 pm
Please check the screenshot.
I have 2 icons looking the same.

In English they mean "complete source code" and "copy source block".
What can I do to distinguish them?
Title: Re: menue - ident icons
Post by: Zvoni on November 29, 2022, 01:17:16 pm
At a guess: Default-Icon for entries not having an individual Icon.
Haven't found an option to assign an icon to a menu
Title: Re: menue - ident icons
Post by: Nicole on November 29, 2022, 04:30:48 pm
 :'(

I have two icons with flashes side by side.
IMHO they SHOULD have an individual icon.
Title: Re: menue - ident icons
Post by: wp on November 29, 2022, 05:09:32 pm
The menu items are created in unit mainbase in the ide folder of your Lazarus installation, the "Source" menu in TMainIDEBase.SetupSourceMenu:

Code: Pascal  [Select][+][-]
  1. procedure TMainIDEBase.SetupSourceMenu;
  2. var
  3.   ParentMI, SubParentMI: TIDEMenuSection;
  4. begin
  5.   with MainIDEBar do begin
  6.     CreateMenuSeparatorSection(mnuSource,itmSourceBlockActions,'itmSourceBlockActions');
  7.     ParentMI:=itmSourceBlockActions;
  8.     CreateMenuItem(ParentMI,itmSourceCommentBlock,'itmSourceCommentBlock',lisMenuCommentSelection, 'menu_comment');
  9.     ...
  10.     CreateMenuItem(ParentMI,itmSourceCompleteCodeInteractive,'itmSourceCompleteCodeInteractive',lisMenuCompleteCodeInteractive);
  11.     ...    
The first CreateMenuItem call has as last parameter the name of the icon, here: "menu_comment". The second does not. Therefore, it gets the default icon.

All you have to do is to go to folder images/menu, find the icon that you would like to have for the "Complete code" item, add its name (without ".png") to the corresponding CreateMenuItem call, and rebuild the IDE.
Title: Re: menue - ident icons
Post by: Nicole on November 29, 2022, 06:01:34 pm
Thank you!
I will keep your post in my tricks-folder.

Double post, because I thought, this may be a new feature wish, if it would not have been possible (as Zvoni thought and me too)
Title: Re: menue - ident icons
Post by: wp on November 29, 2022, 06:21:53 pm
Double post, because I thought, this may be a new feature wish, if it would not have been possible (as Zvoni thought and me too)
New feature wish for customizable icons? I think this is not easy, and has little benefit. Better: If you miss an icon propose which one among the huge icon collection that we have in the images folder should be used (it must be unique, of course, and should "fit" somehow to the others logically), or describe or sketch how it should be modified, and submit it as a feature request to bug tracker.
Title: Re: menue - ident icons
Post by: Nicole on December 06, 2022, 12:06:31 pm
thank you!
TinyPortal © 2005-2018