Et2LinkAppSelect: Use configured app link icon instead of always using navbar

This commit is contained in:
nathan 2023-01-25 15:14:14 -07:00
parent 62bc77a4d2
commit e4e0610a41

View File

@ -105,7 +105,7 @@ export class Et2LinkAppSelect extends SlotMixin(Et2Select)
super.connectedCallback(); super.connectedCallback();
// Set icon // Set icon
this.querySelector(":scope > [slot='prefix']").setAttribute("src", this.value + "/navbar"); this.querySelector(":scope > [slot='prefix']").setAttribute("src", this.egw().link_get_registry(this.value, 'icon') ?? this.value + "/navbar");
if(!this.value) if(!this.value)
{ {
@ -176,7 +176,7 @@ export class Et2LinkAppSelect extends SlotMixin(Et2Select)
_handleChange(e) _handleChange(e)
{ {
// Set icon // Set icon
this.querySelector(":scope > [slot='prefix']").setAttribute("src", this.value + "/navbar"); this.querySelector(":scope > [slot='prefix']").setAttribute("src", this.egw().link_get_registry(this.value, 'icon'));
// update preference // update preference
let appname = ""; let appname = "";
@ -235,7 +235,7 @@ export class Et2LinkAppSelect extends SlotMixin(Et2Select)
_iconTemplate(appname) _iconTemplate(appname)
{ {
let url = appname ? this.egw().image('navbar', appname) : ""; let url = appname ? this.egw().link_get_registry(appname, 'icon') : "";
return html` return html`
<et2-image style="width: var(--icon-width)" slot="prefix" src="${url}"></et2-image>`; <et2-image style="width: var(--icon-width)" slot="prefix" src="${url}"></et2-image>`;
} }