Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Char.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-01-30 23:32:43 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-01-30 23:32:43 (GMT)
commitf3f438af59c69b584d84b27f103f9392fc8185f8 (patch)
tree808556779f0d70312625b6d50277371bbf19b880 /Char.py
parent56cea3b5c6361c7958e1c27182fcf117470a1861 (diff)
...
Diffstat (limited to 'Char.py')
-rw-r--r--Char.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/Char.py b/Char.py
index 23da9b7..d335a85 100644
--- a/Char.py
+++ b/Char.py
@@ -19,12 +19,18 @@ from gettext import gettext as _
import Theme
import Document
+def load():
+ custom = THEMES[-1]
+
+ for i in range(Theme.TAPE_COUNT):
+ custom.origs[i] = Document.tape_orig(i)
+ custom.thumbs[i] = Document.tape_thumb(i)
+
class Char:
def __init__(self, name, file, dir, custom):
self.name = name
self.pixbuf = Theme.pixbuf(file, Theme.THUMB_SIZE)
self.custom = custom
- self.loaded = False
self.thumbs = {}
self.origs = {}
self.files = []
@@ -34,15 +40,6 @@ class Char:
else:
self.files = sorted(glob.glob(Theme.path(dir + '/*')))
- def change(self):
- if not self.custom or self.loaded:
- return
- self.loaded = True
-
- for i in range(Theme.TAPE_COUNT):
- self.origs[i] = Document.orig(i)
- self.thumbs[i] = Document.thumb(i)
-
def thumb(self, index = None):
if index == None:
return self.pixbuf
@@ -66,10 +63,9 @@ class Char:
if pix == None:
if self.custom:
- pix = Theme.choose_pixbuf(lambda t, file: Theme.pixbuf(file))
+ pix = Theme.choose(lambda t, file: Theme.pixbuf(file))
if pix:
- self.thumbs[index] = pix.scale_simple(Theme.THUMB_SIZE,
- Theme.THUMB_SIZE, gtk.gdk.INTERP_BILINEAR)
+ self.thumbs[index] = Theme.scale(pix)
self.origs[index] = pix
else:
if index < len(self.files):