messageTray: Remove support for images in notifications
The design says they are no longer a thing. https://bugzilla.gnome.org/show_bug.cgi?id=744815
This commit is contained in:
@ -507,7 +507,6 @@ const Notification = new Lang.Class({
|
||||
this._titleFitsInBannerMode = true;
|
||||
this._spacing = 0;
|
||||
this._scrollPolicy = Gtk.PolicyType.AUTOMATIC;
|
||||
this._imageBin = null;
|
||||
this._soundName = null;
|
||||
this._soundFile = null;
|
||||
this._soundPlayed = false;
|
||||
@ -611,10 +610,7 @@ const Notification = new Lang.Class({
|
||||
this._actionArea = null;
|
||||
this._buttonBox = null;
|
||||
}
|
||||
if (params.clear)
|
||||
this.unsetImage();
|
||||
|
||||
if (!this._scrollArea && !this._actionArea && !this._imageBin)
|
||||
if (!this._scrollArea && !this._actionArea)
|
||||
this._table.remove_style_class_name('multi-line-notification');
|
||||
|
||||
if (params.gicon) {
|
||||
@ -791,45 +787,11 @@ const Notification = new Lang.Class({
|
||||
|
||||
_updateLastColumnSettings: function() {
|
||||
if (this._scrollArea)
|
||||
this._table.child_set(this._scrollArea, { col: this._imageBin ? 2 : 1,
|
||||
col_span: this._imageBin ? 1 : 2 });
|
||||
this._table.child_set(this._scrollArea, { col: 1,
|
||||
col_span: 2 });
|
||||
if (this._actionArea)
|
||||
this._table.child_set(this._actionArea, { col: this._imageBin ? 2 : 1,
|
||||
col_span: this._imageBin ? 1 : 2 });
|
||||
},
|
||||
|
||||
setImage: function(image) {
|
||||
this.unsetImage();
|
||||
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
this._imageBin = new St.Bin({ opacity: 230,
|
||||
child: image,
|
||||
visible: this.expanded });
|
||||
|
||||
this._table.add_style_class_name('multi-line-notification');
|
||||
this._table.add_style_class_name('notification-with-image');
|
||||
this._addBannerBody();
|
||||
this._updateLastColumnSettings();
|
||||
this._table.add(this._imageBin, { row: 1,
|
||||
col: 1,
|
||||
row_span: 2,
|
||||
x_expand: false,
|
||||
y_expand: false,
|
||||
x_fill: false,
|
||||
y_fill: false });
|
||||
},
|
||||
|
||||
unsetImage: function() {
|
||||
if (this._imageBin) {
|
||||
this._table.remove_style_class_name('notification-with-image');
|
||||
this._table.remove_actor(this._imageBin);
|
||||
this._imageBin = null;
|
||||
this._updateLastColumnSettings();
|
||||
if (!this._scrollArea && !this._actionArea)
|
||||
this._table.remove_style_class_name('multi-line-notification');
|
||||
}
|
||||
this._table.child_set(this._actionArea, { col: 1,
|
||||
col_span: 2 });
|
||||
},
|
||||
|
||||
addButton: function(button, callback) {
|
||||
@ -1061,8 +1023,6 @@ const Notification = new Lang.Class({
|
||||
this.actor.remove_style_class_name('notification-unexpanded');
|
||||
|
||||
// Show additional content that we keep hidden in banner mode
|
||||
if (this._imageBin)
|
||||
this._imageBin.show();
|
||||
if (this._actionArea)
|
||||
this._actionArea.show();
|
||||
if (this._scrollArea)
|
||||
@ -1101,8 +1061,6 @@ const Notification = new Lang.Class({
|
||||
this.expanded = false;
|
||||
|
||||
// Hide additional content that we keep hidden in banner mode
|
||||
if (this._imageBin)
|
||||
this._imageBin.hide();
|
||||
if (this._actionArea)
|
||||
this._actionArea.hide();
|
||||
if (this._scrollArea)
|
||||
|
Reference in New Issue
Block a user