KMeleonWiki > MacroLibrary > Toggling toolbars

Submitted by: Marc

Here is a macro to initialize toolbars ID's, and use them to toggle the display.

In macros.cfg:

# in OnLoad? {} add the line:
$bars ? "":macros(setTB_IDs);

then the code (pay attention to the hard returns that the forum adds):


setTB_IDs {
  $ID_URL_bar?=$bars; $bars=$bars+1;
  $ID_Thr_bar?=$bars; $bars=$bars+1;

  getpref(INT,"kmeleon.toolband.Layers.size") !=0 ? $ID_Layer_bar?=$bars : $bars=$bars-1;

  getpref(INT,"kmeleon.toolband.Hotlist.size") !=0 ? $ID_Hotlist_bar?=$bars : $bars=$bars-1;

  getpref(INT,"kmeleon.toolband.Favorites.size") !=0 ? $ID_Fav_bar?=$bars : $bars=$bars-1;

  # this are in fact the first two user defined toolbars
  # default Tool Bar
  getpref(INT,"kmeleon.toolband.Tool Bar.size") !=0 ? $ID_ToolBar?=$bars : $bars=$bars-1;

  # the default "GO button" bar
  getpref(INT,"kmeleon.toolband.URL Bar buttons.size") !=0 ? $ID_Go_bar?=$bars : $bars=$bars-1;

  # User toolbars (in order of appearance in "toolbars.cfg")
  # Insert your own here...

  # as an example, this is my toolbar with the "close layer" button
  getpref(INT,"kmeleon.toolband.Layer Buttons.size") !=0 ? $ID_LayBut_bar?=$bars : $bars=$bars-1;

  # Last toolbars
  # (always after user defined bars)
  getpref(INT,"kmeleon.toolband.Menu.size") !=0 ? $ID_Menu_bar?=$bars : $bars=$bars-1;

  getpref(INT,"kmeleon.toolband.Bookmarks.size") !=0 ? $ID_Bookmarks_bar?=$bars : $bars=$bars-1;

Now, if you want to toggle the layers toolbar:

in accel.cfg:

CTRL ALT L = macros(hide_layer_bar)

in macros.cfg:



(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.