Bug 514462: page titles are styled as URLs in location bar autocomplete (awesomebar styling is broken), r=gavin

This commit is contained in:
Vivien Nicolas 2009-09-21 17:09:47 -04:00
Родитель 4617709e36
Коммит 31026af668
3 изменённых файлов: 113 добавлений и 117 удалений

Просмотреть файл

@ -40,10 +40,12 @@
</binding>
<binding id="popup_autocomplete_result">
<content align="center">
<xul:image class="autocomplete-item-image" src="" xbl:inherits="src"/>
<xul:description flex="1" class="autocomplete-item-desc" xbl:inherits="xbl:text=value"></xul:description>
<xul:label class="autocomplete-item-tags" xbl:inherits="favorite,xbl:text=tags"></xul:label>
<content orient="vertical">
<xul:hbox class="autocomplete-item-label" align="center" xbl:inherits="tags, favorite" mousethrough="always">
<xul:image xbl:inherits="src"/>
<xul:label flex="1" crop="center" xbl:inherits="value"/>
</xul:hbox>
<xul:label class="autocomplete-item-url" xbl:inherits="value=url" crop="center" mousethrough="always"/>
</content>
</binding>
@ -221,6 +223,7 @@
if (i > matchCount - 1) {
// Just clear out the old item
item.setAttribute("value", "");
item.removeAttribute("favorite");
item._empty = true;
continue;
@ -237,7 +240,8 @@
item.setAttribute("tags", tags);
let url = controller.getValueAt(i);
item.setAttribute("value", this._truncate((title || url)) + '\n' + this._truncate(url));
item.setAttribute("value", title || url);
item.setAttribute("url", url);
let isBookmark = ((type == "bookmark") || (type == "tag"));
item.setAttribute("favorite", isBookmark);
@ -272,20 +276,6 @@
<property name="allBookmarksItemSelected" readonly="true"
onget="return this._selectedItem == this._allBookmarksItem;"/>
<method name="_truncate">
<parameter name="aString" />
<body><![CDATA[
// Simulate a crop by replacing the end part of the string by an
// ellipsis and a few remaining characters from the end of the string
//XXX done in hard for now but should be done depending on the width
let max = 60;
if (aString.length > max) {
return aString.substr(0, max-20) + '...' + aString.slice(-10);
}
return aString;
]]></body>
</method>
<method name="selectBy">
<parameter name="aReverse"/>
<parameter name="aPage"/>
@ -352,11 +342,6 @@
<handler event="click" button="0">
<![CDATA[
let target = event.originalTarget;
if (target.localName != "autocompleteresult")
target = target.parentNode;
if (target.localName != "autocompleteresult")
return;
if (target == this._allBookmarksItem) {
// XXX bug 516575
// select the item, since closing the popup can be slow...
@ -364,7 +349,8 @@
this.selectedIndex = 0;
this.close();
CommandUpdater.doCommand("cmd_bookmarks");
} else if (!target._empty) {
}
else if (target.localName == "autocompleteresult" && !target._empty) {
let offset = this._allBookmarksItem._hidden ? 0 : 1;
// XXX bug 516575
// same as above - we can just set _selectedIndex directly to avoid

Просмотреть файл

@ -575,7 +575,9 @@ placeitem .button-text {
}
autocompleteresult {
padding: 0.5mm 0.2mm;
color: black;
background-color: white;
padding: 1.5mm 1mm;
border-bottom: 0.1mm solid rgb(207,207,207);
min-height: 14.4mm; /* row size */
}
@ -585,76 +587,81 @@ autocompleteresult {
background-color: grey !important;
}
.autocomplete-item-desc {
color: blue;
white-space: pre;
font-size: 10pt !important;
}
.autocomplete-item-desc:first-line {
color: black;
.autocomplete-item-label {
margin: 0;
padding: 0;
font-size: 15.75pt !important;
font-weight: normal;
margin-right: 2mm;
}
.autocomplete-item-tags {
color: black;
.autocomplete-item-label > image {
width: 24px;
height: 24px;
margin: 0mm 5mm 0mm 2mm;
}
.autocomplete-item-label > label {
-moz-margin-start: 1px;
}
.autocomplete-item-label[favorite="true"] {
padding-right: 30px;
background: url(images/star-24.png) no-repeat 100%;
}
.autocomplete-item-label[favorite="true"]:after {
float: right;
content: attr(tags);
font-size: 11.75pt !important;
font-weight: lighter;
padding-top: 1mm;
margin-left: 2mm;
}
.autocomplete-item-tags[favorite=true]:after {
float: right;
position: relative;
top: -3pt;
content: url(images/star-24.png);
margin: 0mm 2mm 0mm 1.5mm;
}
.autocomplete-item-image {
height: 24px;
width: 24px;
margin: 1.6mm 4mm 5mm 2mm;
.autocomplete-item-url {
margin: 0;
padding: 0;
color: blue;
font-size: 10pt !important;
margin-left: 14mm;
margin-right: 2mm;
}
/* special "no results" and "all bookmarks" items */
autocompleteresult.noresults > .autocomplete-item-desc {
text-align: center;
}
autocompleteresult.noresults > .autocomplete-item-desc:first-line {
color: grey;
}
autocompleteresult.noresults > .autocomplete-item-image,
autocompleteresult.noresults > .autocomplete-item-tags {
visibility: hidden;
}
autocompleteresult.noresults {
font-style: italic;
border-bottom: none;
}
autocompleteresult.allbookmarks {
color: black;
background-color: #E9E9E9;
autocompleteresult.noresults > .autocomplete-item-label {
text-align: center;
color: grey;
}
autocompleteresult.allbookmarks > .autocomplete-item-desc {
color: black;
autocompleteresult.noresults > .autocomplete-item-label > image,
autocompleteresult.noresults > .autocomplete-item-url {
visibility: hidden;
}
autocompleteresult.allbookmarks {
-moz-box-pack: center;
background: #E9E9E9 url("images/arrowright-16.png") no-repeat 98% 50%;
}
autocompleteresult.allbookmarks > .autocomplete-item-label {
font-size: 15.75pt !important;
}
autocompleteresult.allbookmarks > .autocomplete-item-image {
autocompleteresult.allbookmarks > .autocomplete-item-label > image {
width: 44px;
height: 30px;
margin: 0 3mm;
list-style-image: url(images/bookmarks-30.png);
}
autocompleteresult.allbookmarks > .autocomplete-item-tags:after {
content: url(images/arrowright-16.png);
-moz-margin-end: 4mm;
autocompleteresult.allbookmarks > .autocomplete-item-url {
display: none;
}
/* Left sidebar (tabs) ---------------------------------------------------- */

Просмотреть файл

@ -342,7 +342,9 @@ placeitem .button-text {
}
autocompleteresult {
padding: 0.25mm 0.1mm;
color: black;
background-color: white;
padding: 1.25mm 0.5mm;
border-bottom: 0.05mm solid rgb(207,207,207);
min-height: 9.2mm; /* row size */
}
@ -352,74 +354,75 @@ autocompleteresult {
background-color: grey !important;
}
.autocomplete-item-desc {
color: blue;
white-space: pre;
font-size: 8pt !important;
}
.autocomplete-item-desc:first-line {
color: black;
.autocomplete-item-label {
margin: 0;
padding: 0;
font-size: 9pt !important;
font-weight: normal;
margin-right: 2mm;
}
.autocomplete-item-tags {
color: black;
.autocomplete-item-label > image {
width: 24px;
height: 24px;
margin: 0mm 2.5mm 0mm 2mm;
}
.autocomplete-item-label > label {
-moz-margin-start: 1px;
}
.autocomplete-item-label[favorite="true"] {
padding-right: 30px;
background: url(images/star-24.png) no-repeat 100%;
}
.autocomplete-item-label[favorite="true"]:after {
float: right;
content: attr(tags);
font-size: 8pt !important;
font-weight: lighter;
padding-top: 1mm;
margin-left: 2mm;
}
.autocomplete-item-tags[favorite=true]:after {
float: right;
position: relative;
top: -6pt;
content: url(images/star-24.png);
margin: 0mm 2mm 0mm 1.5mm;
}
.autocomplete-item-image {
height: 24px;
width: 24px;
margin: 1.6mm 1.5mm 0mm 2mm;
.autocomplete-item-url {
margin: 0;
padding: 0;
color: blue;
font-size: 8pt !important;
margin-left: 11.5mm;
margin-right: 2mm;
}
/* special "no results" and "all bookmarks" items */
autocompleteresult.noresults > .autocomplete-item-desc {
text-align: center;
}
autocompleteresult.noresults > .autocomplete-item-desc:first-line {
color: grey;
}
autocompleteresult.noresults > .autocomplete-item-image,
autocompleteresult.noresults > .autocomplete-item-tags {
visibility: hidden;
}
autocompleteresult.noresults {
font-style: italic;
border-bottom: none;
}
autocompleteresult.noresults > .autocomplete-item-label {
text-align: center;
color: grey;
}
autocompleteresult.noresults > .autocomplete-item-label > image,
autocompleteresult.noresults > .autocomplete-item-url {
visibility: hidden;
}
autocompleteresult.allbookmarks {
color: black;
background-color: #E9E9E9;
-moz-box-pack: center;
background: #E9E9E9 url("images/arrowright-16.png") no-repeat 98% 50%;
}
autocompleteresult.allbookmarks > .autocomplete-item-desc {
color: black;
autocompleteresult.allbookmarks > .autocomplete-item-label {
font-size: 9pt !important;
}
autocompleteresult.allbookmarks > .autocomplete-item-image {
margin: 0 1.5mm;
}
autocompleteresult.allbookmarks > .autocomplete-item-tags:after {
/* this image works fine for both -high and -low */
content: url(images/arrowright-16.png);
-moz-margin-end: 1.1mm;
autocompleteresult.allbookmarks > .autocomplete-item-url {
display: none;
}
/* Left sidebar (tabs) ---------------------------------------------------- */