зеркало из https://github.com/mozilla/gecko-dev.git
[Australis] Bug 916953: introduce separator in overflow panel buttons and bookmark star button gets different label when inside overflow panel. r=Gijs
This commit is contained in:
Родитель
c03d0c746a
Коммит
e2032da70f
|
@ -1082,8 +1082,14 @@ let BookmarkingUI = {
|
||||||
this._updateToolbarStyle();
|
this._updateToolbarStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
init: function() {
|
||||||
|
CustomizableUI.addListener(this);
|
||||||
|
},
|
||||||
|
|
||||||
_hasBookmarksObserver: false,
|
_hasBookmarksObserver: false,
|
||||||
uninit: function BUI_uninit() {
|
uninit: function BUI_uninit() {
|
||||||
|
CustomizableUI.removeListener(this);
|
||||||
|
|
||||||
this._uninitView();
|
this._uninitView();
|
||||||
|
|
||||||
if (this._hasBookmarksObserver) {
|
if (this._hasBookmarksObserver) {
|
||||||
|
@ -1279,6 +1285,44 @@ let BookmarkingUI = {
|
||||||
onItemVisited: function () {},
|
onItemVisited: function () {},
|
||||||
onItemMoved: function () {},
|
onItemMoved: function () {},
|
||||||
|
|
||||||
|
// CustomizableUI events:
|
||||||
|
_starButtonLabel: null,
|
||||||
|
_starButtonOverflowedLabel: null,
|
||||||
|
onWidgetOverflow: function(aNode, aContainer) {
|
||||||
|
let win = aNode.ownerDocument.defaultView;
|
||||||
|
if (aNode.id != "bookmarks-menu-button" || win != window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!this._starButtonOverflowedLabel) {
|
||||||
|
let browserBundle = Services.strings.createBundle(
|
||||||
|
"chrome://browser/locale/browser.properties");
|
||||||
|
this._starButtonOverflowedLabel = browserBundle.GetStringFromName(
|
||||||
|
"starButtonOverflowed.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
let button = this.button;
|
||||||
|
if (!this._starButtonLabel)
|
||||||
|
this._starButtonLabel = button.label;
|
||||||
|
|
||||||
|
if (button && button.label == this._starButtonLabel)
|
||||||
|
button.setAttribute("label", this._starButtonOverflowedLabel);
|
||||||
|
},
|
||||||
|
|
||||||
|
onWidgetUnderflow: function(aNode, aContainer) {
|
||||||
|
let win = aNode.ownerDocument.defaultView;
|
||||||
|
if (aNode.id != "bookmarks-menu-button" || win != window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If the button hasn't been in the overflow panel before, we may ignore
|
||||||
|
// this event.
|
||||||
|
if (!this._starButtonOverflowedLabel || !this._starButtonLabel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let button = this.button;
|
||||||
|
if (button && button.label == this._starButtonOverflowedLabel)
|
||||||
|
button.setAttribute("label", this._starButtonLabel);
|
||||||
|
},
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([
|
QueryInterface: XPCOMUtils.generateQI([
|
||||||
Ci.nsINavBookmarkObserver
|
Ci.nsINavBookmarkObserver
|
||||||
])
|
])
|
||||||
|
|
|
@ -1052,6 +1052,8 @@ var gBrowserInit = {
|
||||||
// Enable/Disable auto-hide tabbar
|
// Enable/Disable auto-hide tabbar
|
||||||
gBrowser.tabContainer.updateVisibility();
|
gBrowser.tabContainer.updateVisibility();
|
||||||
|
|
||||||
|
BookmarkingUI.init();
|
||||||
|
|
||||||
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
|
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
|
||||||
|
|
||||||
var homeButton = document.getElementById("home-button");
|
var homeButton = document.getElementById("home-button");
|
||||||
|
|
|
@ -178,6 +178,6 @@
|
||||||
level="top"
|
level="top"
|
||||||
hidden="true">
|
hidden="true">
|
||||||
<vbox id="widget-overflow-scroller">
|
<vbox id="widget-overflow-scroller">
|
||||||
<vbox id="widget-overflow-list"/>
|
<vbox id="widget-overflow-list" class="widget-overflow-list"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
</panel>
|
</panel>
|
||||||
|
|
|
@ -3235,6 +3235,7 @@ OverflowableToolbar.prototype = {
|
||||||
this._collapsed.set(child.id, this._target.clientWidth);
|
this._collapsed.set(child.id, this._target.clientWidth);
|
||||||
child.classList.add("overflowedItem");
|
child.classList.add("overflowedItem");
|
||||||
child.setAttribute("cui-anchorid", this._chevron.id);
|
child.setAttribute("cui-anchorid", this._chevron.id);
|
||||||
|
CustomizableUIInternal.notifyListeners("onWidgetOverflow", child, this._target);
|
||||||
|
|
||||||
this._list.insertBefore(child, this._list.firstChild);
|
this._list.insertBefore(child, this._list.firstChild);
|
||||||
if (!this._toolbar.hasAttribute("overflowing")) {
|
if (!this._toolbar.hasAttribute("overflowing")) {
|
||||||
|
@ -3291,6 +3292,7 @@ OverflowableToolbar.prototype = {
|
||||||
}
|
}
|
||||||
child.removeAttribute("cui-anchorid");
|
child.removeAttribute("cui-anchorid");
|
||||||
child.classList.remove("overflowedItem");
|
child.classList.remove("overflowedItem");
|
||||||
|
CustomizableUIInternal.notifyListeners("onWidgetUnderflow", child, this._target);
|
||||||
}
|
}
|
||||||
|
|
||||||
let win = this._target.ownerDocument.defaultView;
|
let win = this._target.ownerDocument.defaultView;
|
||||||
|
@ -3365,6 +3367,7 @@ OverflowableToolbar.prototype = {
|
||||||
this._collapsed.set(aNode.id, minSize);
|
this._collapsed.set(aNode.id, minSize);
|
||||||
aNode.setAttribute("cui-anchorid", this._chevron.id);
|
aNode.setAttribute("cui-anchorid", this._chevron.id);
|
||||||
aNode.classList.add("overflowedItem");
|
aNode.classList.add("overflowedItem");
|
||||||
|
CustomizableUIInternal.notifyListeners("onWidgetOverflow", aNode, this._target);
|
||||||
}
|
}
|
||||||
// If it is not overflowed and not in the toolbar, and was not overflowed
|
// If it is not overflowed and not in the toolbar, and was not overflowed
|
||||||
// either, it moved out of the toolbar. That means there's now space in there!
|
// either, it moved out of the toolbar. That means there's now space in there!
|
||||||
|
@ -3382,6 +3385,7 @@ OverflowableToolbar.prototype = {
|
||||||
this._collapsed.delete(aNode.id);
|
this._collapsed.delete(aNode.id);
|
||||||
aNode.removeAttribute("cui-anchorid");
|
aNode.removeAttribute("cui-anchorid");
|
||||||
aNode.classList.remove("overflowedItem");
|
aNode.classList.remove("overflowedItem");
|
||||||
|
CustomizableUIInternal.notifyListeners("onWidgetUnderflow", aNode, this._target);
|
||||||
|
|
||||||
if (!this._collapsed.size) {
|
if (!this._collapsed.size) {
|
||||||
this._toolbar.removeAttribute("overflowing");
|
this._toolbar.removeAttribute("overflowing");
|
||||||
|
|
|
@ -229,6 +229,7 @@ refreshBlocked.redirectLabel=%S prevented this page from automatically redirecti
|
||||||
# Star button
|
# Star button
|
||||||
starButtonOn.tooltip=Edit this bookmark
|
starButtonOn.tooltip=Edit this bookmark
|
||||||
starButtonOff.tooltip=Bookmark this page
|
starButtonOff.tooltip=Bookmark this page
|
||||||
|
starButtonOverflowed.label=Bookmark This Page
|
||||||
|
|
||||||
# Offline web applications
|
# Offline web applications
|
||||||
offlineApps.available=This website (%S) is asking to store data on your computer for offline use.
|
offlineApps.available=This website (%S) is asking to store data on your computer for offline use.
|
||||||
|
|
|
@ -7,3 +7,12 @@
|
||||||
#BMB_bookmarksPopup > menuitem[type="checkbox"] {
|
#BMB_bookmarksPopup > menuitem[type="checkbox"] {
|
||||||
-moz-appearance: none !important; /* important, to override toolkit rule */
|
-moz-appearance: none !important; /* important, to override toolkit rule */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||||
|
-moz-appearance: none;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||||
|
-moz-margin-start: 0;
|
||||||
|
}
|
||||||
|
|
|
@ -63,3 +63,7 @@ toolbarbutton[cui-areatype="menu-panel"] {
|
||||||
#BMB_bookmarksPopup > menu > .menu-right {
|
#BMB_bookmarksPopup > menu > .menu-right {
|
||||||
-moz-margin-end: 0;
|
-moz-margin-end: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||||
|
-moz-margin-start: 4px;
|
||||||
|
}
|
||||||
|
|
|
@ -532,6 +532,20 @@ toolbarpaletteitem[place="palette"] > #search-container {
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button::after {
|
||||||
|
content: "";
|
||||||
|
display: -moz-box;
|
||||||
|
width: 1px;
|
||||||
|
height: 18px;
|
||||||
|
-moz-margin-end: -1px;
|
||||||
|
background-image: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 18px);
|
||||||
|
background-clip: padding-box;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 1px 18px;
|
||||||
|
box-shadow: 0 0 0 1px hsla(0,0%,100%,.2);
|
||||||
|
}
|
||||||
|
|
||||||
#PanelUI-developerItems > toolbarbutton[checked="true"],
|
#PanelUI-developerItems > toolbarbutton[checked="true"],
|
||||||
#PanelUI-bookmarks > toolbarbutton[checked="true"],
|
#PanelUI-bookmarks > toolbarbutton[checked="true"],
|
||||||
#PanelUI-history > toolbarbutton[checked="true"],
|
#PanelUI-history > toolbarbutton[checked="true"],
|
||||||
|
|
|
@ -1375,7 +1375,7 @@ toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
|
||||||
-moz-margin-start: 5px;
|
-moz-margin-start: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bookmarks-menu-button[cui-areatype="toolbar"]:not(.bookmark-item) > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
|
#bookmarks-menu-button[cui-areatype="toolbar"]:not(.bookmark-item):not(.overflowedItem) > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,3 +28,19 @@
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||||
|
-moz-appearance: none;
|
||||||
|
border: 0;
|
||||||
|
-moz-margin-start: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||||
|
padding: 0 2px;
|
||||||
|
-moz-padding-start: 0;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
|
||||||
|
padding: 0 6px;
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче