St: drop StClickable, add some functionality to StButton

For historical reasons, we had both StClickable and StButton, which
were nearly identical. StButton was more widely-used, so keep that and
port all StClickable users to that.

https://bugzilla.gnome.org/show_bug.cgi?id=640583
This commit is contained in:
Dan Winship
2011-01-25 16:22:00 -05:00
parent c256fa9b9f
commit c86a977564
13 changed files with 244 additions and 526 deletions

View File

@ -24,10 +24,10 @@ SearchResult.prototype = {
_init: function(provider, metaInfo, terms) {
this.provider = provider;
this.metaInfo = metaInfo;
this.actor = new St.Clickable({ style_class: 'search-result',
reactive: true,
x_align: St.Align.START,
y_fill: true });
this.actor = new St.Button({ style_class: 'search-result',
reactive: true,
x_align: St.Align.START,
y_fill: true });
this.actor._delegate = this;
let content = provider.createResultActor(metaInfo, terms);
@ -69,7 +69,7 @@ SearchResult.prototype = {
Main.overview.toggle();
},
_onResultClicked: function(actor, event) {
_onResultClicked: function(actor) {
this.activate();
},
@ -221,23 +221,23 @@ SearchResults.prototype = {
},
_createOpenSearchProviderButton: function(provider) {
let clickable = new St.Clickable({ style_class: 'dash-search-button',
reactive: true,
x_fill: true,
y_align: St.Align.MIDDLE });
let button = new St.Button({ style_class: 'dash-search-button',
reactive: true,
x_fill: true,
y_align: St.Align.MIDDLE });
let bin = new St.Bin({ x_fill: false,
x_align:St.Align.MIDDLE });
clickable.connect('clicked', Lang.bind(this, function() {
button.connect('clicked', Lang.bind(this, function() {
this._openSearchSystem.activateResult(provider.id);
}));
let title = new St.Label({ text: provider.name,
style_class: 'dash-search-button-label' });
bin.set_child(title);
clickable.set_child(bin);
provider.actor = clickable;
button.set_child(bin);
provider.actor = button;
this._searchProvidersBox.add(clickable);
this._searchProvidersBox.add(button);
},
createProviderMeta: function(provider) {