gnome-shell-extension-reference icon indicating copy to clipboard operation
gnome-shell-extension-reference copied to clipboard

Need more detail about PopupImageMenuItem

Open eexpress opened this issue 3 years ago • 1 comments

I test the PopupImageMenuItem, below is work.

let item0 = new PopupMenu.PopupImageMenuItem('xxxx', stock_icon.icon_name);

But I want do some adjust, so I write like this, but it fail. I can not found document about PopupImageMenuItem. https://gjs-docs.gnome.org/ no help.

let item0 = new PopupMenu.PopupImageMenuItem({text: 'xxxx', icon_name: stock_icon.icon_name, style_class: 'big_text', icon_size: 32});

plz help.

eexpress avatar Dec 28 '21 08:12 eexpress

It's a couple of years later, but now there's https://gjs.guide/ which has more documentation on writing in an extension context.

Specifically, for PopupImageMenuItem, its constructor is documented as taking three arguments: text, icon, and params. So instead of your code you'd call it as,

let item0 = new PopupMenu.PopupImageMenuItem(
    'xxxx', stock_icon.icon_name, {style_class: 'big_text', icon_size: 32});

ferdnyc avatar Nov 26 '23 04:11 ferdnyc