about with the supported package types icons

This commit is contained in:
Vinicius Moreira
2019-10-15 13:03:27 -03:00
parent c7c4728e16
commit b9ce2d977f

View File

@@ -1,8 +1,10 @@
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel
from glob import glob
from bauh import __version__, __app_name__
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel, QWidget, QHBoxLayout
from bauh import __version__, __app_name__, ROOT_DIR
from bauh.view.util import resource
PROJECT_URL = 'https://github.com/vinifmor/' + __app_name__
@@ -29,6 +31,21 @@ class AboutDialog(QDialog):
layout.addWidget(QLabel(''))
available_gems = [f for f in glob('{}/gems/*'.format(ROOT_DIR)) if not f.endswith('.py')]
available_gems.sort()
gems_widget = QWidget()
gems_widget.setLayout(QHBoxLayout())
for gem_path in available_gems:
icon = QLabel()
pxmap = QPixmap(gem_path + '/resources/img/{}.png'.format(gem_path.split('/')[-1]))
icon.setPixmap(pxmap.scaled(24, 24, Qt.KeepAspectRatio, Qt.SmoothTransformation))
gems_widget.layout().addWidget(icon)
layout.addWidget(gems_widget)
layout.addWidget(QLabel(''))
line_desc = QLabel(self)
line_desc.setStyleSheet('font-size: 12px; font-weight: bold;')
line_desc.setText(locale_keys['about.info.desc'])