2010-12-08 110 views
1

我遇到了我制作的Firefox工具栏的问题。如果我拖动图标或将搜索框放在它上面,它们都会对齐到工具栏的左侧,并将我的工具栏图标推到右侧。如果我将拖动到栏上的图标移动到图标的右侧,则Firefox重新启动时,它们会移回到左侧。我不知道我做错了什么。FF插件工具栏 - 添加的东西位于工具栏的右侧

这里是我的代码:

<toolbox id="navigator-toolbox"> 

    <toolbar id="TutTB-Toolbar" toolbarname="FreeLayer Toolbar" accesskey="T" 
      class="chromeclass-toolbar" context="toolbar-context-menu" 
      hidden="false" mode="icons" persist="hidden" customizable="true" observes="cmd_viewrstb" inherits="hidden" > 


     <toolbaritem> 
      <toolbarbutton id="Back-MainMenu" type="Plain" oncommand="gBrowser.webNavigation.goBack()" 
          tooltiptext="Back"> 
      </toolbarbutton> 
      <toolbarbutton id="Foward-MainMenu" type="Plain" oncommand="gBrowser.webNavigation.goForward()" 
          tooltiptext="Forward"> 
      </toolbarbutton> 
      <toolbarbutton id="Reload-MainMenu" type="Plain" oncommand="BrowserReloadSkipCache();" 
          tooltiptext="Reload"> 
      </toolbarbutton> 
      <toolbarbutton id="Home-MainMenu" type="Plain" oncommand="window.BrowserHome()" 
          tooltiptext="Home"> 
      </toolbarbutton>                




      <menulist id="TutTB-SearchTerms" editable="true" flex="1" 
         minwidth="100" width="450" 
         onkeypress="objTutorialToolbar.KeyHandler(event);"> 
       <menupopup id="TutTB-SearchTermsMenu" onpopupshowing="objTutorialToolbar.Populate()" /> 
      </menulist> 


     <splitter id="TutTB-ResizeSplitter" state="open" collapse="none" 
        resizebefore="closest" resizeafter="farthest" 
        tooltiptext="Resize the Search Box"> 
      <vbox id="TutTB-ResizeBar" /> 
     </splitter> 


      <toolbarbutton id="TutTB-Combined-Button" label="Search" 
          type="Plain" tooltiptext="Search" 
          oncommand="objTutorialToolbar.Search(event, 'web')"> 

      </toolbarbutton> 

      <toolbarbutton id="Loc-MainMenu" type="menu-button" 
       tooltiptext="Actual Location"> 
       <menupopup> 
        <menuitem id="web-location" label="Actual Location" 
        class="menuitem-iconic" tooltiptext="Actual Location" /> 
       </menupopup> 
      </toolbarbutton> 
     </toolbaritem> 

     <toolbarspring /> 


    </toolbar> 
</toolbox> 

回答

0

您的toolbaritem没有id,这意味着工具栏自定义代码无法保持其位置。

0

哎..克里斯我 真的不知道你想要做什么。 但尝试使用工具栏的align属性。对齐是可以用来对齐xul中的各种对象的一般属性。 https://developer.mozilla.org/en/XUL/align

或者,您可以使用insertafter或insertbefore属性指定您想要放置工具栏的位置。