Updated menu icons

This commit is contained in:
itdominator 2021-11-20 23:43:45 -06:00
parent 4819e0de8c
commit 708b50e3bb
2 changed files with 18 additions and 9 deletions

View File

@ -76,7 +76,7 @@ class Signals(CPUDrawMixin, MainMenuMixin, TaskbarMixin, GridMixin):
# Program Menu Parts # Program Menu Parts
self.menuWindow = self.builder.get_object("menuWindow") self.menuWindow = self.builder.get_object("menuWindow")
self.menuWindow.set_keep_above(True); self.menuWindow.set_keep_above(True);
self.showIcons = False self.showIcons = True
self.iconFactory = Icon(self.settings) self.iconFactory = Icon(self.settings)
self.grpDefault = "Accessories" self.grpDefault = "Accessories"

View File

@ -59,7 +59,6 @@ class MainMenuMixin:
self.generateListView() self.generateListView()
@threaded
def generateListView(self): def generateListView(self):
widget = self.builder.get_object("programListBttns") widget = self.builder.get_object("programListBttns")
@ -72,15 +71,25 @@ class MainMenuMixin:
title = obj[0] title = obj[0]
dirPath = obj[1] dirPath = obj[1]
if self.showIcons: if self.showIcons:
image = self.iconFactory.parseDesktopFiles(dirPath) # .get_pixbuf() self.update_view(widget, title, dirPath)
self.addToProgramListView(widget, title, image)
else: else:
self.addToProgramListViewAsText(widget, title) self.update_view(widget, title, dirPath)
@threaded @threaded
def addToProgramListView(self, widget, title, icon): def update_view(self, widget, title, dirPath):
image = self.iconFactory.parseDesktopFiles(dirPath) # .get_pixbuf()
if self.showIcons:
glib.idle_add(self.addToProgramListView, (widget, title, image,))
else:
glib.idle_add(self.addToProgramListViewAsText, (widget, title, image,))
def addToProgramListView(self, data):
widget, title, img = data
icon = gtk.Image().new_from_pixbuf(img)
button = gtk.Button(label=title) button = gtk.Button(label=title)
button.set_image(icon) button.set_image(icon)
button.connect("clicked", self.executeProgram) button.connect("clicked", self.executeProgram)
@ -96,10 +105,10 @@ class MainMenuMixin:
label.set_size_request(640, 64) label.set_size_request(640, 64)
button.show_all() button.show_all()
glib.idle_add(widget.add, (button)) widget.add(button)
@threaded def addToProgramListViewAsText(self, data):
def addToProgramListViewAsText(self, widget, title): widget, title, icon = data
button = gtk.Button(label=title) button = gtk.Button(label=title)
button.connect("clicked", self.executeProgram) button.connect("clicked", self.executeProgram)