Skip to content

Commit f7dcaad

Browse files
committed
Improve and fix Settings App icons
Set a blank icon for missing apps. Scale up small icons
1 parent b3e8a6c commit f7dcaad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

qubesmanager/appmenu_select.py

100755100644
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def fill_apps_list(self, template=None):
139139
icon = QtGui.QIcon(icon_path)
140140
qpixmap = icon.pixmap(QtCore.QSize(512, 512))
141141
qimage = QtGui.QImage(qpixmap)
142+
if qimage.size().width() < 48 or qimage.size().height() < 48:
143+
qimage = qimage.scaled(48, 48)
142144
qimage = tint_qimage(qimage, self.vm.label.color)
143145
qpixmap = QtGui.QPixmap(qimage)
144146
icon = QtGui.QIcon(qpixmap)
@@ -162,6 +164,13 @@ def fill_apps_list(self, template=None):
162164

163165
for app in whitelist:
164166
item = AppListWidgetItem.from_ident(app)
167+
if item.icon().isNull():
168+
qpixmap = QtGui.QPixmap(48, 48)
169+
c = QtGui.QColor(0)
170+
c.setAlpha(0)
171+
qpixmap.fill(c)
172+
icon = QtGui.QIcon(qpixmap)
173+
item.setIcon(icon)
165174
self.app_list.selected_list.addItem(item)
166175

167176
self.app_list.available_list.sortItems()

0 commit comments

Comments
 (0)