Do not show "More" next to "Recent Docs" if there are no docs (bug #582037)

This commit is contained in:
Siegfried-Angel Gevatter Pujals 2009-09-25 20:54:40 +02:00
parent 3ffc510be7
commit 36b11ee8c7
2 changed files with 21 additions and 4 deletions

View File

@ -506,6 +506,13 @@ SectionHeader.prototype = {
this.backLink.actor.hide(); this.backLink.actor.hide();
}, },
setMoreLinkVisible : function(visible) {
if (visible)
this.moreLink.actor.show();
else
this.moreLink.actor.hide();
},
setCountText : function(countText) { setCountText : function(countText) {
if (countText == "") { if (countText == "") {
this.countText.hide(); this.countText.hide();
@ -782,8 +789,8 @@ Dash.prototype = {
this._docsSection = new Section(_("RECENT DOCUMENTS")); this._docsSection = new Section(_("RECENT DOCUMENTS"));
let docDisplay = new DocDisplay.DashDocDisplay(); this._docDisplay = new DocDisplay.DashDocDisplay();
this._docsSection.content.append(docDisplay.actor, Big.BoxPackFlags.EXPAND); this._docsSection.content.append(this._docDisplay.actor, Big.BoxPackFlags.EXPAND);
this._moreDocsPane = null; this._moreDocsPane = null;
this._docsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) { 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); this.sectionArea.append(this._docsSection.actor, Big.BoxPackFlags.EXPAND);
/***** Search Results *****/ /***** Search Results *****/

View File

@ -302,7 +302,7 @@ DashDocDisplayItem.prototype = {
shellWorkspaceLaunch: function () { shellWorkspaceLaunch: function () {
this._info.launch(); this._info.launch();
} }
} };
/** /**
* Class used to display two column recent documents in the dash * Class used to display two column recent documents in the dash
@ -436,5 +436,9 @@ DashDocDisplay.prototype = {
let display = new DashDocDisplayItem(docInfo); let display = new DashDocDisplayItem(docInfo);
this.actor.add_actor(display.actor); this.actor.add_actor(display.actor);
} }
this.emit('changed');
} }
} };
Signals.addSignalMethods(DashDocDisplay.prototype);