Quote
clutterless
Can someone tell me how to create a Block Ad button for the Privacy Bar. Constantly using
the Tools Menu to reach Block Advertisement is tiresome.
====== SHORT VERSION:
Various ways possible, for users easiest probably this one:
1)
Edit > Configuration > Toolbars
(This opens toolbars.cfg in the PROGRAM folder, in newer KM versions the DEFAULT TEMPLATE directly, which is slightly dangerous in case of typos, and really modifies the original skin. Better to make a
backup copy before changing that file, just in case. Or yet better, manually copy over that file into the currently chosen skin folder and modify it there)
Make sure you have
WRITE PERMISSION there.
2) Look if the desired button already exists and is perhaps only hidden (adblock not yet).
If not found,
choose a neighbor button, where you want to insert the new one. Copy the lines of that button and modify it
3) Exchange the name (random), the command, the right-click menu (optional), the tooltip, (icon only if needed) etc. for the new function, save and restart. Suggestion:
Adblock{
macros(KM_ToggleAdblock)|_Config_Appearance
Hide most Ad-Banners (could accidentally hide a 'good' image too). Right-click to modify detailed settings.
}
4) make a BACKUP copy of that modified file again in a safe place
PS: Want to see the
Privacy menu by right-clicking a button?
=> on a button of your choice, simply write "|&Privacy" after the command name. Done.
Actually nearly all menu names you see in KM will work this way. The important thing is just to replace underscores with &, if they are part of the menu name.
The adblock example above uses the menu "_Config_Appearance", that is a bit trickier because it's only a submenu, the menu name not visible directly. This one was created and found in macro cfg.kmm
====== LONG VERSION AND TRICKS
structure of buttons in toolbars.cfg
Line-1{ = button name = random, no function, only appears as button TEXT and defines the WIDTH
Line-2= action (left-click) | menu (right-click)
Line-3= tooltip, when mouse hovers over button
Line-4 etc: icon, but NOT necessary for pure text bars, or for modern KM versions at all
}
If you prefer smaller buttons in a TEXT-toolbar, like the privbar, simply shorten the button names in Line-1!
The LONGEST name defines the width for all buttons in the same toolbar
The help text in default toolbars.cfg is long since outdated, still dating from KM0.X or so
Buttons can be created in different ways, mostly by editing toolbars.cfg or by using a macro
Possible commands and menus are found in various places (
menus.cfg, commands.html, *.kmm, wiki etc.) Almost everything is possible incl. new user macro functions. Easiest way to find the command name is to just ask here, as you did ;-)
You can also create
own new toolbars if you like, easiest in toolbars.cfg, simply by looking at the syntax of other toolbars
Highly recommand:
Better not modify the default skin, or all your changes will be overwritten and lost when updating to a newer KM version.
To avoid this possible loss, and to avoid syntax typos making KM crash at next start, and to keep the "default" skin still "original default", a great way is to create
your own personal skin:
In the Windows file explorer, in ...KM/skins, simply create a manual copy of your current skin folder (default, Klassic, etc) and name it as you wish, e.g. "myskin" or whatever. If there's no toolbars.cfg in it yet, copy over the one from KM/browser/defaults/settings/toolbars.cfg
Now modify what you wish there.
At next browser start, choose this "new skin" in F2/GUI, then restart again.
(If it crashes now, rename the folder to whatever and KM will restart with the native default skin again)
Secret special trick for personal skins:
(but not sure if it only works with named skins or also with "default" skin?):
name that copied skin folder the SAME and add something in brackets, e.g. "Klassic(mine)" or "default(clut1)" etc.
This way, only the modified stuff must be inside, in this case only the file toolbars.cfg, otherwise the whole folder can be EMPTY! All the rest KM will automatically look up in the "family folder" without brackets, e.g. "Klassic".
Generally, if something is not found there either, KM looks it up in "shared" or "default". The highest priority though have skins in the user profile folder.
If unsure about that bracket() method, download KM1.5.4 or older and take a look at the Phoenity skin folders. There it was used for different icon sizes, 16 or 24px
Edited 1 time(s). Last edit at 11/10/2017 03:01PM by siria.