'Loads layout icons.'

def _setup_images(self):

    for layout_name in self._get_layout_names():
        icon_file_path = self.find_icon_file_path(layout_name)
        if (icon_file_path is None):
            logger.warning('No    icon    found    for    layout    "{}"'.format(layout_name))
            icon_file_path = self.find_icon_file_path('unknown')
        try:
            img = cairocffi.ImageSurface.create_from_png(icon_file_path)
        except (cairocffi.Error, IOError) as e:
            self.icons_loaded = False
            logger.exception('Failed    to    load    icon    from    file    "{}",    error    was:    {}'.format(icon_file_path, e.message))
            return
        input_width = img.get_width()
        input_height = img.get_height()
        sp = (input_height / (self.bar.height - 1))
        width = (input_width / sp)
        if (width > self.length):
            self.length = (int(width) + (self.actual_padding * 2))
        imgpat = cairocffi.SurfacePattern(img)
        scaler = cairocffi.Matrix()
        scaler.scale(sp, sp)
        scaler.scale(self.scale, self.scale)
        factor = ((1 - (1 / self.scale)) / 2)
        scaler.translate(((- width) * factor), ((- width) * factor))
        scaler.translate((self.actual_padding * (-1)), 0)
        imgpat.set_matrix(scaler)
        imgpat.set_filter(cairocffi.FILTER_BEST)
        self.surfaces[layout_name] = imgpat
    self.icons_loaded = True
