Do not show "More" next to "Recent Docs" if there are no docs (bug #582037)
This commit is contained in:
parent
3ffc510be7
commit
36b11ee8c7
@ -506,6 +506,13 @@ SectionHeader.prototype = {
|
||||
this.backLink.actor.hide();
|
||||
},
|
||||
|
||||
setMoreLinkVisible : function(visible) {
|
||||
if (visible)
|
||||
this.moreLink.actor.show();
|
||||
else
|
||||
this.moreLink.actor.hide();
|
||||
},
|
||||
|
||||
setCountText : function(countText) {
|
||||
if (countText == "") {
|
||||
this.countText.hide();
|
||||
@ -782,8 +789,8 @@ Dash.prototype = {
|
||||
|
||||
this._docsSection = new Section(_("RECENT DOCUMENTS"));
|
||||
|
||||
let docDisplay = new DocDisplay.DashDocDisplay();
|
||||
this._docsSection.content.append(docDisplay.actor, Big.BoxPackFlags.EXPAND);
|
||||
this._docDisplay = new DocDisplay.DashDocDisplay();
|
||||
this._docsSection.content.append(this._docDisplay.actor, Big.BoxPackFlags.EXPAND);
|
||||
|
||||
this._moreDocsPane = null;
|
||||
this._docsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) {
|
||||
@ -795,6 +802,12 @@ Dash.prototype = {
|
||||
}
|
||||
}));
|
||||
|
||||
this._docDisplay.connect('changed', Lang.bind(this, function () {
|
||||
this._docsSection.header.setMoreLinkVisible(
|
||||
this._docDisplay.actor.get_children().length > 0);
|
||||
}));
|
||||
this._docDisplay.emit('changed');
|
||||
|
||||
this.sectionArea.append(this._docsSection.actor, Big.BoxPackFlags.EXPAND);
|
||||
|
||||
/***** Search Results *****/
|
||||
|
@ -302,7 +302,7 @@ DashDocDisplayItem.prototype = {
|
||||
shellWorkspaceLaunch: function () {
|
||||
this._info.launch();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Class used to display two column recent documents in the dash
|
||||
@ -436,5 +436,9 @@ DashDocDisplay.prototype = {
|
||||
let display = new DashDocDisplayItem(docInfo);
|
||||
this.actor.add_actor(display.actor);
|
||||
}
|
||||
this.emit('changed');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(DashDocDisplay.prototype);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user