diff options
| author | tassaron | 2017-06-22 22:23:04 -0400 |
|---|---|---|
| committer | tassaron | 2017-06-22 22:23:04 -0400 |
| commit | 3c903794e3588560f2b9d342214009d55a675d5a (patch) | |
| tree | 8b1b1a55343d2489b90c14020d5b174db5c7d7ea /components/text.py | |
| parent | 49cda1bf3aa1800459d1085496291bec90ae6a5a (diff) | |
more commandline component options
commandline options that existed before the redesign are now back
Diffstat (limited to 'components/text.py')
| -rw-r--r-- | components/text.py | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/components/text.py b/components/text.py index 536a9ba..2375dcd 100644 --- a/components/text.py +++ b/components/text.py @@ -149,12 +149,28 @@ class Component(__base__.Component): self.page.lineEdit_textColor.setText(RGBstring) self.page.pushButton_textColor.setStyleSheet(btnStyle) - def commandHelp(self, arg): - print('Enter a string to use as centred white text. ' - 'Use quotes around the string to escape spaces.') + def commandHelp(self): + print('Enter a string to use as centred white text:') + print(' "title=User Error"') + print('Specify a text color:\n color=255,255,255') + print('Set custom x, y position:\n x=500 y=500') def command(self, arg): - if not arg.startswith('preset='): - self.title = arg - return True + if not arg.startswith('preset=') and '=' in arg: + key, arg = arg.split('=', 1) + if key == 'color': + self.page.lineEdit_textColor.setText(arg) + return + elif key == 'size': + self.page.spinBox_fontSize.setValue(int(arg)) + return + elif key == 'x': + self.page.spinBox_xTextAlign.setValue(int(arg)) + return + elif key == 'y': + self.page.spinBox_yTextAlign.setValue(int(arg)) + return + elif key == 'title': + self.page.lineEdit_title.setText(arg) + return super().command(arg) |
