Browse Source

update Gooey program icon and fix OSX task bar rendering

pull/473/head
Kiehl 5 years ago
committed by Chris
parent
commit
ca7ff29212
4 changed files with 10 additions and 3 deletions
  1. 10
      gooey/gui/containers/application.py
  2. 2
      gooey/gui/image_repository.py
  3. 1
      gooey/gui/util/freeze.py
  4. BIN
      gooey/images/program_icon.png

10
gooey/gui/containers/application.py

@ -5,6 +5,7 @@ Primary orchestration and control point for Gooey.
import sys
import wx
from wx.adv import TaskBarIcon
from gooey.gui import cli
from gooey.gui import events
@ -187,7 +188,14 @@ class GooeyApplication(wx.Frame):
self.SetSizer(sizer)
self.console.Hide()
self.Layout()
self.SetIcon(wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_ICO))
# Program Icon (Windows)
icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG)
self.SetIcon(icon)
# OSX needs to have its taskbar icon explicitly set
# bizarrely, wx requires the TaskBarIcon to be attached to the Frame
# as instance data (self.). Otherwise, it will not render correctly.
self.taskbarIcon = TaskBarIcon(iconType=wx.adv.TBI_DOCK)
self.taskbarIcon.SetIcon(icon)

2
gooey/gui/image_repository.py

@ -12,7 +12,7 @@ from gooey.gui.util.freeze import getResourcePath
from gooey.util.functional import merge
filenames = {
'programIcon': 'program_icon.ico',
'programIcon': 'program_icon.png',
'successIcon': 'success_icon.png',
'runningIcon': 'running_icon.png',
'loadingIcon': 'loading_icon.gif',

1
gooey/gui/util/freeze.py

@ -45,4 +45,3 @@ def localResourcePath(path):
return os.path.join(basedir or sys.executable, path)
else:
return os.path.join(os.getcwd(), path)

BIN
gooey/images/program_icon.png

Before After
Width: 416  |  Height: 412  |  Size: 14 KiB
Loading…
Cancel
Save