[notifications] Make the whole notification clickable

It is not obvious that only the icon is clickable to activate the
default action - in fact, with the area being that tiny, many don't
even know that notifications can be clicked.
Just extend the clickable area to the whole notification.

https://bugzilla.gnome.org/show_bug.cgi?id=613932
This commit is contained in:
Florian Müllner 2010-06-13 16:17:35 +02:00
parent b237cf9a63
commit e287aa10e3

View File

@ -99,6 +99,13 @@ Notification.prototype = {
this.actor = new St.Table({ name: 'notification',
reactive: true });
this.actor.connect('style-changed', Lang.bind(this, this._styleChanged));
this.actor.connect('button-release-event', Lang.bind(this,
function (actor, event) {
if (!this._actionArea ||
!this._actionArea.contains(event.get_source()))
this.source.clicked();
}));
this.update(title, banner, true);
Main.overview.connect('showing', Lang.bind(this,
@ -136,18 +143,12 @@ Notification.prototype = {
}
this._icon = this.source.createIcon(ICON_SIZE);
this._icon.reactive = true;
this.actor.add(this._icon, { row: 0,
col: 0,
x_expand: false,
y_expand: false,
y_fill: false });
this._icon.connect('button-release-event', Lang.bind(this,
function () {
this.source.clicked();
}));
// The first line should have the title, followed by the
// banner text, but ellipsized if they won't both fit. We can't
// make St.Table or St.BoxLayout do this the way we want (don't