gnome-shell-extension-reference
gnome-shell-extension-reference copied to clipboard
Need more detail about PopupImageMenuItem
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.
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});