toolbox { -moz-binding: url("chrome://your/mozilla/project/path/gtoolbar.xml#toolbox"); }The above four style definitions add the gtoolbar.xml bindings to the <toolbox/>, <toolbar/>, <menubar/> and toolbargrippy to those three xul elements. Now you may style these bindings as with any xul element.
toolbar { -moz-binding: url("chrome://your/mozilla/project/path/gtoolbar.xml#toolbar"); }
menubar { -moz-binding: url("chrome://your/mozilla/project/path/gtoolbar.xml#menubar"); }
toolbargrippy { -moz-binding: url("chrome://your/mozilla/project/path/gtoolbar.xml#toolbargrippy"); }
toolbargrippy {
cursor: pointer;
}
toolbargrippy {
/* -moz-box-orient: vertical;
-moz-box-align: center;
-moz-box-pack: end;
-moz-box-direction: reverse;
border-top: 1x solid #EEF0F3;
border-right: 1px solid #86929E;
border-bottom: 1px solid #86929E;
border-left: 1px solid #EEF0F3; */
list-style-image: url(" ");
}
toolbargrippy:hover:active {
/* border-color: #67737E;
background-color: #9DA9B6; */
list-style-image: url(" ");
}
.toolbargrippy-arrow {
margin: 0px 0px 0px 0px;
width: 0px;
height: 0px;
}
***Note that the .toolbargrippy-arrow class is for styling the xul:image that is included in the grippy. There is also the .toolbargrippy-texture class that is for styling the xul:spacer included in the grippy but not used in this example. The xul:spacer has it's flex="1". The xul:image is placed in the grippy first and the xul:spacer is placed in the grippy second.
Here, below, is a style defintion for a menubar grippy:
menubar > toolbargrippy {
border-top: 1px solid #EBF4FF;
border-right: 1px solid #B9BFC7;
border-bottom: 1px solid #B9BFC7;
border-left: 1px solid #F4FAFF;
background-color: #DDE3EB;
list-style-image: url(" ");
}
The collapse/expand functionality is achived by wrapping a toolbar or menubar in the toolbox tag:
<toolbox>
<toolbar>
<menubar/>
</toolbar>
</toolbox>
If no collapse functionality is desired then wrap your toolbars and menubars in an vbox or hbox:
<vbox>
<toolbar>
<menubar/>
</toolbar>
</vbox>
Here is a definition that shows a non-collapsable menubar and a collapsable toolbar with tooltips for collapsed and expanded states:
<toolbox>
<menubar UPgrippytooltiptext="Expanded menubar"
grippytooltiptext="Collapsed menubar" Collapsable="false" />
<toolbar UPgrippytooltiptext="Expanded toolbar"
grippytooltiptext="Collapsed toolbar" Collapsable="true" />
</toolbox>
Notice in the above toolbar definition the Collapsable parameter. This may be used in a toolbar or menubar when they are grouped together in a toolbox and some are collapsable and some are not.
The grippy displays as a button and includes a xul:image and xul:spacer that can be styled. When a grippy is clicked the grippyTriggered method is called and if collapsed=true then toolbox.expandtoolbar(this.id) is called else if attribute Collapsable="true" call toolbox.collapseToolbar(toolbar).
When a toolbar or menubar is collapsed, by clicking the expanded grippy, it's collapsed attribute="true" and a default, as styled in gtoolbar.css or styled elsewhere, collapsed grippy is created and placed in the toolbox tray and the id is set to the string "moz_tb_collapsed_"+BarID, i.e "moz_tb_collapsed_BarID" where BarID is the id of the current bar being collapsed.
When a collapsed toolbar or menubar is expanded, by clicking the collapsed grippy, the moz_tb_collapsed_BarID child element is removed from the toolbox tray and the toolbar or menubar attribute collapsed="false"
The grippy styling for the toolbar with the id=VKboard1 expanded and collapsed state:
#VKboard1 > toolbargrippy:hover:active > .toolbargrippy-arrow { height: 50px; width: 55px background-color: #ffffff; list-style-image: url("chrome://kiosk/content/VKeyboard/images/VKeyboard.png"); } toolbargrippy[moz_grippy_collapsed="true"][id="moz_tb_collapsed_VKboard1"] > .toolbargrippy-arrow { margin: 1px 0px 1px 3px; width: 105px; height: 20px; background-color: #ffffff; list-style-image: url("chrome://kiosk/content/VKeyboard/images/VKeyboardH1.png"); } toolbargrippy[id="moz_tb_collapsed_VKboard1"]:hover:active > .toolbargrippy-arrow { margin: 1px 0px 1px 3px; width: 105px; height: 20px; list-style-image: url("chrome://kiosk/content/VKeyboard/images/VKeyboardH3.png"); }