Toggle the info pane when clicking the info icon (#587550)

Now clicking on the information icon of the same item a second
time will hide the details pane. Clicking it another time will
show it again, etc.

This is achieved by adding a 'toggle-details' signal which
switches the visibility of the details pane.

Other than the necessary changes, function _selectIndex (in
genericDisplay.js) has been restructured a bit to avoid
duplicating checks.
This commit is contained in:
Siegfried-Angel Gevatter Pujals
2009-07-29 19:35:11 +02:00
parent 119516424d
commit 77c92d75d5
2 changed files with 37 additions and 14 deletions

View File

@@ -505,6 +505,9 @@ Dash.prototype = {
this._detailsContent.remove_all();
this._detailsContent.append(this._docDisplay.selectedItemDetails, Big.BoxPackFlags.NONE);
}));
this._docDisplay.connect('toggle-details', Lang.bind(this, function(docDisplay) {
this._toggleDetails();
}));
this._resultsDocsSection.display.connect('selected', Lang.bind(this, function(resultsDocDisplay) {
this._docDisplay.unsetSelected();
this._resultsAppsSection.display.unsetSelected();
@@ -512,6 +515,9 @@ Dash.prototype = {
this._detailsContent.remove_all();
this._detailsContent.append(this._resultsDocsSection.display.selectedItemDetails, Big.BoxPackFlags.NONE);
}));
this._resultsDocsSection.display.connect('toggle-details', Lang.bind(this, function(resultsDocDisplay) {
this._toggleDetails();
}));
this._resultsAppsSection.display.connect('selected', Lang.bind(this, function(resultsAppDisplay) {
this._docDisplay.unsetSelected();
this._resultsDocsSection.display.unsetSelected();
@@ -696,6 +702,13 @@ Dash.prototype = {
this.emit('panes-removed');
},
_toggleDetails: function() {
if (this._detailsShowing())
this._hideDetails();
else
this._showDetails();
},
_detailsShowing: function() {
return this._detailsPane.visible;
},