From 8e9c527c5a11fdf3645b161e8165d6da68f6396c Mon Sep 17 00:00:00 2001 From: "sspitzer@mozilla.org" Date: Fri, 31 Aug 2007 13:19:19 -0700 Subject: [PATCH] fix for bug #387718: the location bar dropdown should show a star next to bookmarked results r=gavin --- browser/base/content/browser.xul | 1 + browser/themes/pinstripe/browser/browser.css | 17 +++++++++++ browser/themes/winstripe/browser/browser.css | 17 +++++++++++ .../public/nsIAutoCompleteInput.idl | 10 +++++-- .../satchel/src/nsFormFillController.cpp | 17 +++++++++-- toolkit/content/widgets/autocomplete.xml | 29 +++++++++++++++++-- 6 files changed, 84 insertions(+), 7 deletions(-) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 406f30a4d827..f6e162cfb77b 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -224,6 +224,7 @@ completeselectedindex="true" tabscrolling="true" showcommentcolumn="true" + showimagecolumn="true" enablehistory="true" maxrows="10" newlines="stripsurroundingwhitespace" diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index 9de75f6ea15c..bd910452cc27 100755 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -977,6 +977,23 @@ statusbarpanel#statusbar-display { height: 16px; } +#treecolAutoCompleteImage { + max-width : 36px; + padding-end: 18px; +} + +.autocomplete-treebody::-moz-tree-image(favicon, treecolAutoCompleteImage) { + list-style-image: url("chrome://browser/skin/places/starPage.png"); + width: 16px; + height: 16px; +} + +.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) { + list-style-image: url("chrome://browser/skin/places/pageStarred.png"); + width: 16px; + height: 16px; +} + .autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) { color: #555566; } diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css index db53a667fbe5..129ab342aeb2 100644 --- a/browser/themes/winstripe/browser/browser.css +++ b/browser/themes/winstripe/browser/browser.css @@ -970,6 +970,23 @@ statusbarpanel#statusbar-display { height: 16px; } +#treecolAutoCompleteImage { + max-width : 36px; + padding-end: 18px; +} + +.autocomplete-treebody::-moz-tree-image(favicon, treecolAutoCompleteImage) { + list-style-image: url("chrome://browser/skin/places/starPage.png"); + width: 16px; + height: 16px; +} + +.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) { + list-style-image: url("chrome://browser/skin/places/pageStarred.png"); + width: 16px; + height: 16px; +} + .autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) { color: #555566; } diff --git a/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl b/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl index c365233f51f1..97ba504b63c9 100644 --- a/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl +++ b/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl @@ -40,7 +40,7 @@ interface nsIAutoCompletePopup; -[scriptable, uuid(AC029254-06DD-4dff-878C-A292117DE2D3)] +[scriptable, uuid(8a5918dc-89ba-4bd0-934c-90e9c21568b8)] interface nsIAutoCompleteInput : nsISupports { /* @@ -96,7 +96,13 @@ interface nsIAutoCompleteInput : nsISupports * Option to show a second column in the popup which contains * the comment for each autocomplete result */ - attribute unsigned long showCommentColumn; + attribute boolean showCommentColumn; + + /* + * Option to show a third column in the popup which contains + * an additional image for each autocomplete result + */ + attribute boolean showImageColumn; /* * Number of milliseconds after a keystroke before a search begins diff --git a/toolkit/components/satchel/src/nsFormFillController.cpp b/toolkit/components/satchel/src/nsFormFillController.cpp index 7280d9fc5fe0..b362701d23b0 100644 --- a/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/toolkit/components/satchel/src/nsFormFillController.cpp @@ -339,13 +339,26 @@ nsFormFillController::SetMaxRows(PRUint32 aMaxRows) } NS_IMETHODIMP -nsFormFillController::GetShowCommentColumn(PRUint32 *aShowCommentColumn) +nsFormFillController::GetShowImageColumn(PRBool *aShowImageColumn) +{ + *aShowImageColumn = PR_FALSE; + return NS_OK; +} + +NS_IMETHODIMP nsFormFillController::SetShowImageColumn(PRBool aShowImageColumn) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + + +NS_IMETHODIMP +nsFormFillController::GetShowCommentColumn(PRBool *aShowCommentColumn) { *aShowCommentColumn = PR_FALSE; return NS_OK; } -NS_IMETHODIMP nsFormFillController::SetShowCommentColumn(PRUint32 aShowCommentColumn) +NS_IMETHODIMP nsFormFillController::SetShowCommentColumn(PRBool aShowCommentColumn) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index aa808911ffe8..1792a050a4e3 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -151,6 +151,10 @@ onset="this.setAttribute('showcommentcolumn', val); return val;" onget="return this.getAttribute('showcommentcolumn') == 'true';"/> + + @@ -533,7 +537,8 @@ null false false - + false + @@ -576,7 +581,8 @@ this.invalidate(); this.showCommentColumn = this.mInput.showCommentColumn; - + this.showImageColumn = this.mInput.showImageColumn; + this.setAttribute("width", aWidth < 100 ? 100 : aWidth); document.popupNode = null; @@ -674,7 +680,7 @@ onget="return this.mShowCommentColumn;"> + + + + + +