Skip to content

Commit

Permalink
New, retina and dark mode compatible icon. Fix #48. Fix #41.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Wenzel committed Nov 6, 2014
1 parent b0b8d63 commit 9fe270c
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 18 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -57,10 +57,13 @@ Acknowledgments
---------------
Thanks to:

* David Vignoni for his [upload icon][icon].
* [Linh Pham Thi Dieu][linh] for his [upload icon][iconnew] (current versions of UpShot).
* David Vignoni for his [upload icon][iconold] (early versions of UpShot).
* Jason Costello for [Slate][slate], the website theme that upshot.it uses.

[icon]: http://www.iconfinder.com/icondetails/1858/32/
[linh]: http://linhpham.me/#works
[iconnew]: https://www.iconfinder.com/icons/284001/cloud_upload_icon
[iconold]: http://www.iconfinder.com/icondetails/1858/32/
[slate]: https://github.com/jsncostello/slate


Expand Down
2 changes: 1 addition & 1 deletion fabfile.py
Expand Up @@ -81,7 +81,7 @@ def decorated(*args, **kwargs):
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
install_requires=['pyobjc'],
install_requires=['pyobjc-core'],
)

# Some cleanup.
Expand Down
2 changes: 1 addition & 1 deletion lib/updater.py
Expand Up @@ -14,7 +14,7 @@ class SparkleUpdater(NSObject):
"""

def init(self):
super(SparkleUpdater, self).init()
#super(SparkleUpdater, self).init()

# Load Sparkle framework.
bundle_path = os.path.join(
Expand Down
Binary file modified resources/UpShot.icns
Binary file not shown.
Binary file removed resources/icon16-off.png
Binary file not shown.
Binary file removed resources/icon16.png
Binary file not shown.
Binary file added resources/status-off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/status-off@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/status@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified upshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 10 additions & 14 deletions upshot.py
Expand Up @@ -49,9 +49,9 @@

class Upshot(NSObject):
"""OS X status bar icon."""
image_paths = {
'icon16': 'icon16.png',
'icon16-off': 'icon16-off.png',
icon_paths = {
'icon_on': 'status', # Refers to resources/<name>.png and <name>@2x.png
'icon_off': 'status-off',
}
images = {}
statusitem = None
Expand Down Expand Up @@ -96,11 +96,11 @@ def build_menu(self):
self.statusitem = statusbar.statusItemWithLength_(NSVariableStatusItemLength)

# Set statusbar icon and color/grayscale mode.
for tag, img in self.image_paths.items():
self.images[tag] = NSImage.alloc().initByReferencingFile_(img)
self.images[tag].setTemplate_(
utils.get_pref('iconset') == 'grayscale')
self.statusitem.setImage_(self.images['icon16'])
for tag, img in self.icon_paths.items():
# Automatically pick named file as 1x or 2x based on Retina.
self.images[tag] = NSImage.imageNamed_(img)
self.images[tag].setTemplate_(True)
self.statusitem.setImage_(self.images['icon_on'])

self.statusitem.setHighlightMode_(1)
self.statusitem.setToolTip_('Upshot Screenshot Sharing')
Expand Down Expand Up @@ -163,13 +163,9 @@ def update_menu(self):
if self.statusitem is None:
return

# Apply iconset
self.images['icon16'].setTemplate_(
utils.get_pref('iconset') == 'grayscale')

running = (self.observer is not None)
self.statusitem.setImage_(self.images['icon16' if running else
'icon16-off'])
self.statusitem.setImage_(self.images['icon_on' if running else
'icon_off'])

if utils.get_pref('dropboxid'): # Runnable.
self.menuitems['stop'].setHidden_(not running)
Expand Down

0 comments on commit 9fe270c

Please sign in to comment.