Skip to content

Commit 9cd7bec

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

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

qubesmanager/appmenu_select.py

100755100644
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ def fill_apps_list(self, template=None):
140140
qpixmap = icon.pixmap(QtCore.QSize(512, 512))
141141
qimage = QtGui.QImage(qpixmap)
142142
qimage = tint_qimage(qimage, self.vm.label.color)
143+
if (
144+
qimage.size().width() < 48
145+
or qimage.size().height() < 48
146+
):
147+
qimage = qimage.scaled(48, 48)
143148
qpixmap = QtGui.QPixmap(qimage)
144149
icon = QtGui.QIcon(qpixmap)
145150
else:
@@ -162,6 +167,13 @@ def fill_apps_list(self, template=None):
162167

163168
for app in whitelist:
164169
item = AppListWidgetItem.from_ident(app)
170+
if item.icon().isNull():
171+
qpixmap = QtGui.QPixmap(48, 48)
172+
color = QtGui.QColor(0)
173+
color.setAlpha(0)
174+
qpixmap.fill(color)
175+
icon = QtGui.QIcon(qpixmap)
176+
item.setIcon(icon)
165177
self.app_list.selected_list.addItem(item)
166178

167179
self.app_list.available_list.sortItems()

0 commit comments

Comments
 (0)