messageList: Directly take an GioIcon as image for a message
There is pretty much no value gained by allowing to use any actor to display an image, so just don't allow it since it simplifies the code and CSS. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
This commit is contained in:

committed by
Florian Müllner

parent
cb1b54b954
commit
ffaec5615a
@ -475,13 +475,13 @@ export const Message = GObject.registerClass({
|
||||
});
|
||||
vbox.add_child(this._actionBin);
|
||||
|
||||
this._iconBin = new St.Bin({
|
||||
style_class: 'message-icon-bin',
|
||||
this._icon = new St.Icon({
|
||||
style_class: 'message-icon',
|
||||
y_expand: true,
|
||||
y_align: Clutter.ActorAlign.START,
|
||||
visible: false,
|
||||
});
|
||||
hbox.add_child(this._iconBin);
|
||||
hbox.add_child(this._icon);
|
||||
|
||||
const contentBox = new St.BoxLayout({
|
||||
style_class: 'message-content',
|
||||
@ -523,9 +523,15 @@ export const Message = GObject.registerClass({
|
||||
this.emit('close');
|
||||
}
|
||||
|
||||
setIcon(actor) {
|
||||
this._iconBin.child = actor;
|
||||
this._iconBin.visible = actor != null;
|
||||
setIcon(icon) {
|
||||
this._icon.gicon = icon;
|
||||
|
||||
if (icon instanceof Gio.ThemedIcon)
|
||||
this._icon.add_style_class_name('message-themed-icon');
|
||||
else
|
||||
this._icon.remove_style_class_name('message-themed-icon');
|
||||
|
||||
this._icon.visible = !!icon;
|
||||
}
|
||||
|
||||
get datetime() {
|
||||
|
Reference in New Issue
Block a user