fix for bug #387718: the location bar dropdown should show a star next to bookmarked results r=gavin

This commit is contained in:
sspitzer@mozilla.org 2007-08-31 13:19:19 -07:00
parent e860010ddf
commit a1f34414b7
6 changed files with 84 additions and 7 deletions

View File

@ -224,6 +224,7 @@
completeselectedindex="true"
tabscrolling="true"
showcommentcolumn="true"
showimagecolumn="true"
enablehistory="true"
maxrows="10"
newlines="stripsurroundingwhitespace"

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -151,6 +151,10 @@
onset="this.setAttribute('showcommentcolumn', val); return val;"
onget="return this.getAttribute('showcommentcolumn') == 'true';"/>
<property name="showImageColumn"
onset="this.setAttribute('showimagecolumn', val); return val;"
onget="return this.getAttribute('showimagecolumn') == 'true';"/>
<property name="timeout"
onset="this.setAttribute('timeout', val); return val;"
onget="return parseInt(this.getAttribute('timeout')) || 50;"/>
@ -533,7 +537,8 @@
<field name="mInput">null</field>
<field name="mPopupOpen">false</field>
<field name="mShowCommentCol">false</field>
<field name="mShowImageCol">false</field>
<constructor><![CDATA[
this.setAttribute("ignorekeys", "true");
]]></constructor>
@ -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;">
<setter><![CDATA[
if (!val && this.mShowCommentColumn) {
// reset the flex on the value column and add the comment column
// reset the flex on the value column and remove the comment column
document.getElementById("treecolAutoCompleteValue").setAttribute("flex", 1);
this.removeColumn("treecolAutoCompleteComment");
} else if (val && !this.mShowCommentColumn) {
@ -687,6 +693,23 @@
]]></setter>
</property>
<property name="showImageColumn"
onget="return this.mShowImageColumn;">
<setter>
<![CDATA[
if (!val && this.mShowImageColumn) {
// remove the image column
this.removeColumn("treecolAutoCompleteImage");
} else if (val && !this.mShowImageColumn) {
// add the image column
this.addColumn({id: "treecolAutoCompleteImage", flex: 1});
}
this.mShowImageColumn = val;
return val;
]]>
</setter>
</property>
<method name="addColumn">
<parameter name="aAttrs"/>
<body><![CDATA[