def draw(self):
        """Draw the icons in the widget."""
        self.drawer.clear(self.background or self.bar.background)
        xoffset = 0
        for i in sorted(self.progs.keys()):
            self.drawer.ctx.save()
            self.drawer.ctx.translate(xoffset, 0)
            self.icons_offsets[i] = xoffset + self.padding
            name = self.progs[i]["name"]
            icon_width = self.icons_widths[name]
            if isinstance(self.surfaces[name], base._TextBox):
                # display the name if no icon was found and no default icon
                textbox = self.surfaces[name]
                textbox.layout.draw(
                    self.padding + textbox.actual_padding,
                    int((self.bar.height - textbox.layout.height) / 2.0) + 1,
                )
            else:
                # display an icon
                # Translate to vertically centre the icon
                self.drawer.ctx.translate(0, self._icon_padding + self.padding_y)
                self.drawer.ctx.set_source(self.surfaces[name])
                self.drawer.ctx.paint()

            self.drawer.ctx.restore()

            xoffset += icon_width + self.padding

        self.drawer.draw(offsetx=self.offset, offsety=self.offsety, width=self.width)
Draw the icons in the widget.
libqtile/widget/launchbar.py