# HG changeset patch # User Tomasz KoƂodziejski WIP --- toolkit/content/widgets/autocomplete.xml | 150 +++++++++++++++++++++---------- 1 file changed, 105 insertions(+), 45 deletions(-) diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index ef056d4..7c038a1 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -1200,83 +1200,130 @@ extends="chrome://global/content/bindings/popup.xml#popup"> onget="return this.mInput.controller;" onset="return val;"/> - - - - - - - - - - - - - - + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + = 0) { let [,action, param] = url.match(/^moz-action:([^,]+),(.*)$/); this.setAttribute("actiontype", action); url = param; let desc = this._stringBundle.GetStringFromName("switchToTab"); this._setUpDescription(this._action, desc, true); // Remove the "action" substring so that the correct style, if any, // is applied below. types.splice(actionIndex, 1); type = types.join(" "); + + this._actionBox.style.display = "inline"; } // Check if we have a search engine name let searchEngine = ""; let searchIndex = types.indexOf("search"); if (searchIndex >= 0) { const TITLE_SEARCH_ENGINE_SEPARATOR = " \u00B7\u2013\u00B7 "; @@ -1479,86 +1534,91 @@ extends="chrome://global/content/bindings/popup.xml#popup"> // is applied below. types.splice(searchIndex, 1); type = types.join(" "); } // If we have a tag match, show the tags and icon if (type == "tag") { // Configure the extra box for tags display - this._extraBox.hidden = false; + /*this._extraBox.hidden = false; this._extraBox.childNodes[0].hidden = false; this._extraBox.childNodes[1].hidden = true; this._extraBox.pack = "end"; - this._titleBox.flex = 1; + this._titleBox.flex = 1;*/ // The title is separated from the tags by an endash let tags; [, title, tags] = title.match(/^(.+) \u2013 (.+)$/); // Each tag is split by a comma in an undefined order, so sort it let sortedTags = tags.split(",").sort().join(", "); // Emphasize the matching text in the tags this._setUpDescription(this._extra, sortedTags); // Treat tagged matches as bookmarks for the star type = "bookmark"; } else if (type == "keyword") { + this._keywordBox.style.display = "inline"; + // Configure the extra box for keyword display - this._extraBox.hidden = false; + /*this._extraBox.hidden = false; this._extraBox.childNodes[0].hidden = true; this._extraBox.childNodes[1].hidden = false; this._extraBox.pack = "start"; - this._titleBox.flex = 0; + this._titleBox.flex = 0;*/ // Hide the ellipsis so it doesn't take up space. - this._titleOverflowEllipsis.hidden = true; + //this._titleOverflowEllipsis.hidden = true; // Put the parameters next to the title if we have any let search = this.getAttribute("text"); let params = ""; let paramsIndex = search.indexOf(' '); if (paramsIndex != -1) params = search.substr(paramsIndex + 1); // Emphasize the keyword parameters this._setUpDescription(this._extra, params); // Don't emphasize keyword searches in the title or url this.setAttribute("text", ""); } else { // Hide the title's extra box if we don't need extra stuff - this._extraBox.hidden = true; - this._titleBox.flex = 1; + //this._extraBox.hidden = true; + //this._titleBox.flex = 1; } // Give the image the icon style and a special one for the type this._typeImage.className = "ac-type-icon" + (type ? " ac-result-type-" + type : ""); // Show the url as the title if we don't have a title if (title == "") title = url; // Emphasize the matching search terms for the description this._setUpDescription(this._title, title); if (!searchEngine) { this._setUpDescription(this._url, url); + this._urlBox.style.display = "inline"; } else { let desc = this._stringBundle.formatStringFromName("searchWithEngine", [searchEngine], 1); // The search engine name, when present, is not emphasized. this._setUpDescription(this._url, desc, true); } // Set up overflow on a timeout because the contents of the box // might not have a width yet even though we just changed them - setTimeout(this._setUpOverflow, 0, this._titleBox, this._titleOverflowEllipsis); - setTimeout(this._setUpOverflow, 0, this._urlBox, this._urlOverflowEllipsis); + //setTimeout(this._setUpOverflow, 0, this._titleBox, this._titleOverflowEllipsis); + //setTimeout(this._setUpOverflow, 0, this._urlBox, this._urlOverflowEllipsis); + + setTimeout(this._setupWidth, 0, this._box); ]]>