General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Symbol for option in context menu
Posted by: Mello
Date: May 23, 2018 04:13PM

I want to make a right click option easier to recognise by placing
a symbol against it. how do I go about this?

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: siria
Date: May 23, 2018 05:48PM

Quote
Mello
I want to make a right click option easier to recognise by placing
a symbol against it. how do I go about this?

Uhm... good question :cool:
As usual there are multiple possibilities for customizing, depending on the used KM-version and the used skin:

- edit menuicons.cfg in current skin (e.g. Klassic)
- edit skins.cfg in current skin (e.g. modern default skin)
- or use a little macro (needs min KM75, can look blurry)

For opening the correct cfg file helps a menU:
Edit > Configuration > MenuIcons

_HowTo_
Of course you need to provide an icon image.
And need to know the command/macro name for which that icon shall be used.
Most default commands are listed in menu Edit>Configuration>Commands List (opens commands.html)
Or do a Windows file search inside the macros folder, for the text your menuline is showing.

=========== Examples ============

For older skins like Klassic, add something like this to its
menuicons.cfg:

lang_ru.bmp {
macros(Translate_From(ru))
}
lang_ru.bmp {
macros(Translate_To(ru))
}

------
Or selecting images from a multi-icon-row:

macro_blublub.bmp{
0
macros(blublub_popupmenu)
macros(blublub_LinkOpen)
0
macros(blublub_TogglePage)
}

------
Or try using a macro in KM75 or newer.
Actually "setcmdicon" sets the icon for all uses of that command, not only the menu icon.
Am not quite sure if this is correct, perhaps just try yourself:

Create a file named e.g. my_menuicons.kmm into your macros folder.
Write something like this inside it:

_my_menuicons{
setcmdicon("macros(Translate_From(ru))","lang_ru.bmp[0,16,16]");
}
$OnSetup=$OnSetup."_my_menuicons;";


------
Guess rodocop figured out ways to get SHARP menuicons by using ico-files, he mentioned it somewhere in the forum... Probably also used in his KM-Pro builds.

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: Mello
Date: May 25, 2018 09:00PM

Wow! that's given me a lot to go on. Thank you siria.
I don't have time right now but will report back.

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: hermes
Date: May 26, 2018 07:05PM

@Mello

If I understand you correctly, do you want to do something like this?



Yes siria is right, in classical skins this is made easier.
The main thing is to find what macro or ID you need and just enter what image to use.

In my example, English and Russian are specially highlighted. And the menu itself (for the text) is simplified to copy, paste (which can be understood from the icons) and translate.

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: Mello
Date: May 28, 2018 10:01PM

Spoilt for choice but I'm not getting how to do this.

Would a single how-to for K-M Goanna with AuraAlpha large skin be possibe?

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: siria
Date: May 28, 2018 10:26PM

Need to know: for which command do you want it?
And what shall be the name for your future image?

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: Mello
Date: May 29, 2018 10:09PM

Menu entry is: Download link with IDM

Image name: IDM.ico


Thank you.



Edited 2 time(s). Last edit at 05/29/2018 10:10PM by Mello.

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: siria
Date: May 30, 2018 01:13AM

Quote
Mello
Menu entry is: Download link with IDM
Image name: IDM.ico

http://kmeleonbrowser.org/forum/read.php?1,143718

No wonder, you've picked the most complicated version for the beginning, a custom addon and ico image ;-)

With ico-files I have no personal experience yet, if they work exactly the same as bmp+png or not? Would just try.




Put the image IDM.ico into folder K-Meleon/skins/shared (old KM-versions: skins/default)

Open menu Edit > Configuration > Menuicons
Aura is an older skin, so this opens menuicons.cfg
Add this:

IDM.ico{
macros(Oget)
}





Restart and look if it shows up?
If not, try the macro method, add this at end of the kmm-file:

_IDM_menuicon{
setcmdicon("macros(Oget)","IMD.ico[0,16,16]");
}
$OnSetup=$OnSetup."_IDM_menuicon;";


Would add it to the same macro (oGet.kmm) which belongs to that addon, at the end.
Or if you prefer, create a new, own macro and add it there.
For ico-files am not sure if they also need a size, possibly just:
setcmdicon("macros(Oget)","IMD.ico[0]");
or even
setcmdicon("macros(Oget)","IMD.ico");
?



Edited 1 time(s). Last edit at 05/30/2018 01:15AM by siria.

Options: ReplyQuote
Re: Symbol for option in context menu (HowTo menuicons)
Posted by: Mello
Date: May 31, 2018 10:10PM

Quote
siria
No wonder, you've picked the most complicated version for the beginning, a custom addon and ico image ;-)

grinning smiley

Perfect siria, I used the first solution.

I'm keeping you busy. ;-)

Much appreciated.



Edited 1 time(s). Last edit at 05/31/2018 10:10PM by Mello.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.