Skip to content

Commit

Permalink
Switch to a standard <toolbar> as in bug 562608
Browse files Browse the repository at this point in the history
  • Loading branch information
protz committed May 10, 2010
1 parent e3b0804 commit fe73cc9
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 28 deletions.
31 changes: 15 additions & 16 deletions content/multimessageview.xhtml
Expand Up @@ -135,12 +135,10 @@
if (!buttonBranch.getBoolPref(l))
document.getElementById(l).style.display = "none";
/* That pref is watched from selectionsummaries.js so
as not that register a ton of observers here.
selectionsummaries.js takes care of toggling the class for us */
if (prefsBranch.getBoolPref("toolbar_text_plus_icons")) {
let bb = document.getElementById("buttonhbox");
bb.setAttribute("class", bb.getAttribute("class")+" text-plus-icons");
}
as not to register a ton of observers here.
selectionsummaries.js takes care of changing the mode for us */
document.getElementById("header-view-toolbox")
.setAttribute("mode", prefsBranch.getCharPref("toolbar_mode"));
}

let showquotedtext = stringBundle.getString("showquotedtext");
Expand Down Expand Up @@ -197,48 +195,49 @@
<div id="buttonbox"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox id="buttonhbox" align="start">
<button id="back"
<!--<hbox id="buttonhbox" align="start">-->
<toolbar id="header-view-toolbox" align="start" iconsize="small">
<toolbarbutton id="back"
class="button msgHeaderView-button extra-button"
label="&button.back;"
tooltiptext="&button.back;"
onclick="if (event.button == 0) window.top.gconversation.on_back();"/>
<button id="open_in_new_tab"
<toolbarbutton id="open_in_new_tab"
class="button msgHeaderView-button extra-button"
label="&button.open_in_new_tab;"
tooltiptext="&button.open_in_new_tab;"
onclick="if (event.button == 0) window.top.gconversation.on_load_thread_tab(event);"/>
<button id="mark_as_read"
<toolbarbutton id="mark_as_read"
class="button msgHeaderView-button extra-button"
label="&button.mark_all_read;"
tooltiptext="&button.mark_all_read;"
onclick="if (event.button == 0) window.top.gconversation.mark_all_read()"/>
<button id="expand_all"
<toolbarbutton id="expand_all"
class="button msgHeaderView-button extra-button"
onclick="if (event.button == 0) window.top.gconversation.on_expand_all()"
label="&button.expand_all;"
tooltiptext="&button.expand_all;" />
<button id="collapse_all"
<toolbarbutton id="collapse_all"
class="button msgHeaderView-button extra-button"
onclick="if (event.button == 0) window.top.gconversation.on_collapse_all()"
label="&button.collapse_all;"
tooltiptext="&button.collapse_all;" />
<button id="print"
<toolbarbutton id="print"
class="button msgHeaderView-button extra-button"
label="&button.print;"
tooltiptext="&button.print;"
onclick="if (event.button == 0) window.top.gconversation.print();"/>
<button id="archive"
<toolbarbutton id="archive"
class="button msgHeaderView-button hdrArchiveButton"
onclick="if (event.button == 0) window.top.gconversation.archive_all();"
label="&archive.label;"
tooltiptext="&archive.label;"/>
<button id="trash"
<toolbarbutton id="trash"
class="button msgHeaderView-button hdrTrashButton"
label="&delete.label;"
tooltiptext="&delete.label;"
onclick="if (event.button == 0) window.top.gconversation.delete_all();"/>
</hbox>
</toolbar>
</div>
<div class="heading" id="heading">&selectedmessages.label;</div>
</div>
Expand Down
13 changes: 11 additions & 2 deletions content/options.xul
Expand Up @@ -64,7 +64,7 @@
<preference id="button.open_in_new_tab" name="gconversation.button.open_in_new_tab" type="bool" />
<preference id="focus_first" name="gconversation.focus_first" type="bool" />
<preference id="reverse_order" name="gconversation.reverse_order" type="bool" />
<preference id="toolbar_text_plus_icons" name="gconversation.toolbar_text_plus_icons" type="bool" />
<preference id="toolbar_mode" name="gconversation.toolbar_mode" type="string" />
</preferences>

<groupbox>
Expand Down Expand Up @@ -97,7 +97,16 @@
<groupbox>
<caption label="&title.toolbar;"/>
<description style="width: 0; height: 2em;">&buttons.info;</description>
<checkbox class="fullwidth" label="&option.toolbar_text_plus_icons;" preference="toolbar_text_plus_icons" id="toolbar_text_plus_icons_checkbox" />
<hbox align="center">
<label value="&option.toolbar_mode;" />
<menulist preference="toolbar_mode" id="toolbar_mode_menulist">
<menupopup>
<menuitem label="&option.toolbar_mode_icons;" value="icons" />
<menuitem label="&option.toolbar_mode_text_plus_icons;" value="full" />
<menuitem label="&option.toolbar_mode_text;" value="text" />
</menupopup>
</menulist>
</hbox>
<hbox>
<vbox flex="1">
<checkbox label="&option.button.archive;" preference="button.archive" id="archive_checkbox" />
Expand Down
9 changes: 5 additions & 4 deletions content/selectionsummaries.js
Expand Up @@ -204,10 +204,11 @@ window.addEventListener("load", function f_temp0 () {
gPrefs["fold_rule"] = prefs.getCharPref("fold_rule");
break;
/* Warning this one has no key in gPrefs */
case "toolbar_text_plus_icons":
/* We toggle it because we know that multimessageview.xhtml has set it
* in the right position. */
_mm_toggleClass(htmlpane.contentDocument.getElementById("buttonhbox"), "text-plus-icons");
case "toolbar_mode":
/* No need to store it anywhere. mmv.xhtml sets it on load, we process
* the updates. */
htmlpane.contentDocument.getElementById("header-view-toolbox").setAttribute("mode",
prefs.getCharPref("toolbar_mode"));
break;
case "monospaced_senders":
gPrefs["monospaced_senders"] = prefs.getCharPref("monospaced_senders").split(",");
Expand Down
2 changes: 1 addition & 1 deletion defaults/preferences/defaults.js
Expand Up @@ -15,6 +15,6 @@ pref("gconversation.reverse_order", false);
pref("gconversation.auto_fetch", true);
pref("gconversation.disable_error_empty_collection", false);
pref("gconversation.auto_mark_read", false);
pref("gconversation.toolbar_text_plus_icons", false);
pref("gconversation.toolbar_mode", "icons");
pref("gconversation.monospaced_senders", "bugzilla-daemon@mozilla.org");
pref("gconversation.info_af_shown", false);
5 changes: 4 additions & 1 deletion locale/en-US/options.dtd
Expand Up @@ -11,7 +11,10 @@
<!ENTITY option.no_messages "No messages">
<!ENTITY title.toolbar "Toolbar buttons">
<!ENTITY buttons.info "All these commands are also accessible through the contextual menu of the thread summary (right-click).">
<!ENTITY option.toolbar_text_plus_icons "Show text beside icons for these buttons">
<!ENTITY option.toolbar_mode "Show:">
<!ENTITY option.toolbar_mode_icons "Icons">
<!ENTITY option.toolbar_mode_text "Text">
<!ENTITY option.toolbar_mode_text_plus_icons "Icons beside Text">
<!ENTITY option.button.archive "Display &quot;archive&quot; button">
<!ENTITY option.button.trash "Display &quot;delete&quot; button">
<!ENTITY option.button.print "Display &quot;print&quot; button">
Expand Down
4 changes: 0 additions & 4 deletions skin/multimessageview.css
Expand Up @@ -49,10 +49,6 @@ body {
list-style-image: url("chrome://gconversation/skin/up.png");
}

#buttonhbox:not(.text-plus-icons) > button > hbox > label {
display: none;
}

#back {
list-style-image: url("chrome://gconversation/skin/back.png");
}
Expand Down

0 comments on commit fe73cc9

Please sign in to comment.