Skip to content

Instantly share code, notes, and snippets.

@mwgamera
Created September 21, 2016 04:37
Show Gist options
  • Save mwgamera/974044bc9f6a403d0bd943fa6afb60a5 to your computer and use it in GitHub Desktop.
Save mwgamera/974044bc9f6a403d0bd943fa6afb60a5 to your computer and use it in GitHub Desktop.
Prettier checkboxes for Zim based on shapes from Symbola font.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
=== modified file 'zim/gui/__init__.py'
--- zim/gui/__init__.py 2016-04-07 17:09:43 +0000
+++ zim/gui/__init__.py 2016-09-20 00:02:46 +0000
@@ -120,9 +120,12 @@
factory = gtk.IconFactory()
factory.add_default()
for dir in data_dirs(('pixmaps')):
- for file in dir.list('*.png'):
- # not all installs have svg support, so only check png for now..
- name = 'zim-'+file[:-4] # e.g. checked-box.png -> zim-checked-box
+ files = dir.list('*.svg')
+ files.extend(dir.list('*.png'))
+ for file in files:
+ name = 'zim-'+file[:-4]
+ if factory.lookup(name) != None:
+ continue
icon_theme = gtk.icon_theme_get_default()
try:
pixbuf = icon_theme.load_icon(name, 24, 0)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment