Edited: adding patch script
The solution is based on the Thunderbird source code. I have applied these changes for Thunderbird 68.8.0 (package at Opensuse 68.8.0-1.1 | x86_64) .
You need to unpack the omni.ja
edit/replace the files the way I have indicated and pack omni.ja
back again (the same way the path script does).
First what you need to patch is messenger.xul
file:
diff -r chrome\messenger\content\messenger\messenger.xul chrome\messenger\content\messenger\messenger.xul
4798,4824d4797
< <toolbarbutton id="qfb-sticky" type="checkbox"
< class="toolbarbutton-1" orient="horizontal"
< crop="none" minwidth="16"
< tooltiptext="&quickFilterBar.sticky.tooltip;"/>
< <label id="qfb-results-label"
< minwidth="&quickFilterBar.resultsLabel.minWidth;"
< value=""
< somefmtstring="&quickFilterBar.resultsLabel.some.formatString;"
< noresultsstring="&quickFilterBar.resultsLabel.none;"/>
< <textbox is="search-textbox" id="qfb-qs-textbox"
< align="center"
< flex="3"
< class="searchBox"
< placeholder=""
< emptytextbase="&quickFilterBar.textbox.emptyText.base1;"
< keyLabelNonMac="&quickFilterBar.textbox.emptyText.keyLabel2.nonmac;"
< keyLabelMac="&quickFilterBar.textbox.emptyText.keyLabel2.mac;"
< timeout="500"
< maxlength="100"
< width="170"
< minwidth="160">
< </textbox>
< <toolbarbutton id="qfb-attachment" type="checkbox"
< class="toolbarbutton-1" orient="horizontal"
< crop="none" minwidth="16"
< label="&quickFilterBar.attachment.label;"
< tooltiptext="&quickFilterBar.attachment.tooltip;"/>
4967a4941
>
4975c4949
< defaultset="button-getmsg,button-newmsg,button-chat,button-address,separator,button-tag,separator,qfb-sticky,qfb-results-label,qfb-qs-textbox,qfb-attachment,qfb-show-filter-bar,spring,gloda-search,button-appmenu">
---
> defaultset="button-getmsg,button-newmsg,button-chat,button-address,separator,button-tag,qfb-show-filter-bar,spring,gloda-search,button-appmenu">
5067c5041,5042
< <vbox id="quick-filter-bar" hidden="true">
---
>
> <vbox id="quick-filter-bar">
5076d5050
< hidden="true"
5082c5056
< <toolbarseparator/>
---
> <toolbarseparator id="qfb-separator"/>
5085,5086c5059
< hidden="true"
< align="center"
---
> crop="none" minwidth="16"
5090c5063
< <toolbarbutton id="qfb-starred" type="checkbox"
---
> <toolbarbutton id="qfb-starred" type="checkbox"
5092d5064
< hidden="true"
5099d5070
< hidden="true"
5106d5076
< hidden="true"
5113d5082
< hidden="true"
5122d5090
< hidden="true"
5129d5096
< hidden="true"
Notice here the move of the whole section to the mail toolbar section. Also I have adjusted the values so the search bar is smaller. Notice that you can simply hide the quickFilterBar
item by adding hidden="true"
to the section. I have added the the hidden tak also to the whole quickFilterBar
vbox
as you wished.
Next you need to patch messageWindow.xul
:
diff -r chrome\messenger\content\messenger\messageWindow.xul chrome\messenger\content\messenger\messageWindow.xul
4531c4531
< defaultset="button-getmsg,button-newmsg,button-chat,button-address,separator,button-tag,separator,qfb-sticky,qfb-results-label,qfb-qs-textbox,qfb-attachment,qfb-show-filter-bar,spring,gloda-search,button-appmenu">
---
> defaultset="button-getmsg,button-newmsg,button-chat,button-address,separator,button-tag,qfb-show-filter-bar,spring,gloda-search,button-appmenu">
Here you want to remain consisten on the messageWindow too.
Next you need to patch primaryToolbar.css
:
diff -r chrome\classic\skin\classic\messenger\primaryToolbar.css chrome\classic\skin\classic\messenger\primaryToolbar.css
479,504d478
< #qfb-sticky {
< list-style-image: url("chrome://messenger/skin/icons/sticky.svg");
< }
<
< /*
< * The coloring based on the matches of the filter is defined at quickFilterBar.js.
< * It would have to be ported to work within the mail toolbar.
< *
< * #qfb-results-label {
< * color: #4e9a06; // was GrayText
< * text-align: end;
< * visibility: hidden;
< * }
< *
< * #quick-filter-bar[filterActive="matches"] #qfb-results-label {
< * color: #4e9a06;
< * }
< *
< * #quick-filter-bar[filterActive="nomatches"] #qfb-results-label {
< * color: #f66;
< * }
< */
< #qfb-attachment {
< list-style-image: url("chrome://messenger/skin/icons/attach.svg");
< }
<
Adding the the images to primaryToolbar.css
and also the reference what to do if you want to have different coloring when using the filters.
Last but not the least quickFilterBar.css
:
diff -r chrome\messenger\content\messenger\quickFilterBar.css chrome\messenger\content\messenger\quickFilterBar.css
42c42
< color: #fff200; /* was GrayText */
---
> color: GrayText;
The last patching is needed in order for the results to get one nice (yellow) color. The toolbar was able to differentiate if result was found - green color and not found red. This solution show only one color yellow for both branches. You would need to migrate the code from the quickFilterBar.js which could prove to be tricky.
Note: Please don't forget to delete your profile(s) when applying the changes.
After the changes it looks like this

A patch for linux
As promised I'm now adding a direct patch file for the changes (Using sed (GNU sed) 4.8): Thunderbird quick filter widgets move to main toolbar - patch. This patch patches the move only (not including the previous patches).
Edit2:
If you need for the quick filter search buttons (Sender
, Recipients
, Subject
, Body
) to appear you need to comment out this sed:
# hiding the whole box
sed -E -i -e 's:(\s*<\w+\s\w+="quick-filter-bar")(>):\1 hidden="true"\2:' chrome/messenger/content/messenger/messenger.xul
After commenting out, you need to active quick search toolbar
again. This will show a black line, the quick search toolbar
itself without buttons. The filter buttons (Sender
, Recipients
, Subject
, Body
) will then appear when a filter string is entered.