diff options
| author | tassaron | 2017-08-01 17:57:39 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-01 17:57:39 -0400 |
| commit | 3c1b52205f183e9a2c943c5f666ed2c01db3aaf5 (patch) | |
| tree | 0b92d6d2a1a21b87bd9f2f19181da15c09a1408b /src/toolkit | |
| parent | a472246dab69d0676c3c78ecd61659e432c960b4 (diff) | |
component class now tracks colorwidgets
so adding new color-selection widgets is now simple
Diffstat (limited to 'src/toolkit')
| -rw-r--r-- | src/toolkit/common.py | 19 | ||||
| -rw-r--r-- | src/toolkit/frame.py | 6 |
2 files changed, 3 insertions, 22 deletions
diff --git a/src/toolkit/common.py b/src/toolkit/common.py index db278c0..eba57d9 100644 --- a/src/toolkit/common.py +++ b/src/toolkit/common.py @@ -74,25 +74,6 @@ def disableWhenOpeningProject(func): return decorator -def pickColor(): - ''' - Use color picker to get color input from the user, - and return this as an RGB string and QPushButton stylesheet. - In a subclass apply stylesheet to any color selection widgets - ''' - dialog = QtWidgets.QColorDialog() - dialog.setOption(QtWidgets.QColorDialog.ShowAlphaChannel, True) - color = dialog.getColor() - if color.isValid(): - RGBstring = '%s,%s,%s' % ( - str(color.red()), str(color.green()), str(color.blue())) - btnStyle = "QPushButton{background-color: %s; outline: none;}" \ - % color.name() - return RGBstring, btnStyle - else: - return None, None - - def rgbFromString(string): '''Turns an RGB string like "255, 255, 255" into a tuple''' try: diff --git a/src/toolkit/frame.py b/src/toolkit/frame.py index f42d4c9..c007188 100644 --- a/src/toolkit/frame.py +++ b/src/toolkit/frame.py @@ -42,9 +42,9 @@ class PaintColor(QtGui.QColor): super().__init__(b, g, r, a) -def scale(scale, width, height, returntype=None): - width = (float(width) / 100.0) * float(scale) - height = (float(height) / 100.0) * float(scale) +def scale(scalePercent, width, height, returntype=None): + width = (float(width) / 100.0) * float(scalePercent) + height = (float(height) / 100.0) * float(scalePercent) if returntype == str: return (str(math.ceil(width)), str(math.ceil(height))) elif returntype == int: |
