aboutsummaryrefslogtreecommitdiff
path: root/src/toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'src/toolkit')
-rw-r--r--src/toolkit/frame.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/toolkit/frame.py b/src/toolkit/frame.py
index ca2a054..b66e037 100644
--- a/src/toolkit/frame.py
+++ b/src/toolkit/frame.py
@@ -41,15 +41,33 @@ class PaintColor(QtGui.QColor):
super().__init__(b, g, r, a)
+def defaultSize(framefunc):
+ '''Makes width/height arguments optional'''
+ def decorator(*args):
+ if len(args) < 2:
+ newArgs = list(args)
+ if len(args) == 0 or len(args) == 1:
+ height = int(core.Core.settings.value("outputHeight"))
+ newArgs.append(height)
+ if len(args) == 0:
+ width = int(core.Core.settings.value("outputWidth"))
+ newArgs.insert(0, width)
+ args = tuple(newArgs)
+ return framefunc(*args)
+ return decorator
+
+
def FloodFrame(width, height, RgbaTuple):
return Image.new("RGBA", (width, height), RgbaTuple)
+@defaultSize
def BlankFrame(width, height):
'''The base frame used by each component to start drawing.'''
return FloodFrame(width, height, (0, 0, 0, 0))
+@defaultSize
def Checkerboard(width, height):
'''
A checkerboard to represent transparency to the user.