Focus on hover on a St.Bin inside a St.BoxLayout


I’ve got a box layout in GS top panel.
Inside this box, I have some bins (with icon).

How can I achieve these conditions:

  • no highlight on box hover ;
  • highlight any bin on hover.

I know that the new GS background highlight and the focus-only-on-one-object makes this not natural but…

The Frippery panel favorites extension sorta does half of this — it doesn’t suppress the box highlight, but it does add extra hover-highlighting to the elements inside it. (My mouse was over the speaker icon, in this screenshot:)


The individual icons are implemented as St.Button()s with both an St.Label() and an St.Icon() set, not St.Bin()s, but they’re all inside an St.BoxLayout() as you specified.

The extension code is downloadable from the link above, or by installing from e.g.o and looking in $HOME/.local/share/gnome-shell/extensions/

But basically, it looks like this is the meat of it:

class PanelLauncher {
    constructor(app) { = new St.Button({ style_class: 'panel-button',
                                     reactive: true });
        let gicon = app.app_info.get_icon();
        let icon = new St.Icon({ gicon: gicon,
                                 style_class: 'panel-launcher-icon'});;

        this.label = new St.Label({ style_class: 'panel-launcher-label'});
        this.label.hide(); = this.label;'notify::hover',
                this._onHoverChanged.bind(this)); = 207;
    _onHoverChanged(actor) {
        actor.opacity = actor.hover ? 255 : 207;

The styling on the label also seems to be involved in showing the hover effect:

.panel-launcher-label {
    border-radius: 7px;
    padding: 4px 12px;
    background-color: rgba(24,24,24,0.8);
    color: white;
    text-align: center;
    -y-offset: 6px;

Oh, hang on — whoops. Re-reading the code, I think the St.Label() is actually the tooltip for each icon. So it’s totally unrelated to the hover highlighting.

Thanks anyway.
I’ve solved my problem in another way with manual highlight code:
(that’s the GS dash in panel, nothing more).

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