Skip to content
  • Georges Basile Stavracas Neto's avatar
    switcherList: Stop using Shell.GenericContainer · c6cea277
    Georges Basile Stavracas Neto authored
    This commit removes all the uses of Shell.GenericContainer from
    SwitcherPopup.SwitcherList. Compared to the other patches, this
    one was specially trickier to get right, and a few invasive
    changes needed to be done.
    
    The most noticeable one is that the allocation of the items is
    done entirely by St.BoxLayout -- we don't manually allocate them
    anymore. To make it work, get_preferred_width() had to calculate
    the correct value. It now assumes that:
    
     * Minimum width: the minimum width of the widest child.
     * Natural width: the minimum width of the StBoxLayout (use it
       instead of the natural width to force the labels to ellipsize
       when too long.)
    
    The AppIcon class became a St.Widget subclass as well, to override
    get_preferred_width() and be able to keep the squared shape.
    
    Besides that, add a new SwitcherButton class to reimplement squared
    icons without having to resort to hacks in the size allocation
    machinery. This class has a single vfunc override to ensure that it
    is squared when the SwitcherList is.
    
    The arrows indicating multiple windows are now in this._list
    actor to the SwitcherPopup itself, since this._list automatically
    manages its own children now.
    
    At last, adapt (but preserve) the hack in CyclerPopup.
    
    GNOME/gnome-shell!153
    c6cea277