PopupMenu.PopupBaseMenuItem How to Align the buttons Horizontal

I am trying to create gnome-shell-extension,

item = new PopupMenu.PopupBaseMenuItem({ reactive: false, can_focus: false });

by above code, the created Buttons are not aligned. How to align them. Need help.

In the above pic, there are 8 Buttons, when we change settings in dconf editor, they reduce or increase, how can then be aligned center all the time?

@andyholmes can you help with this please?

Have you taken a look at the x-align property?

Hi, thanks for your reply. I am getting error Unrecognized parameter "x_align"

Thanks for your pinging. It made me review the code again. I was looking at wrong code. The issue is resolved from another function() in the code.

_createActionButton(iconName, accessibleName) {
        let icon = new St.Button({ reactive: true,
                                   can_focus: true,
                                   track_hover: true,
                                   accessible_name: accessibleName,
                                   x_expand: true,
                                   style_class: 'system-menu-action' });
        icon.child = new St.Icon({ icon_name: iconName, icon_size: 16 });
        return icon;
    }

x_expand above solved it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.