-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gui.py #218
base: master
Are you sure you want to change the base?
Update gui.py #218
Changes from 1 commit
c9f1206
010ff9b
96abbdf
379d840
3c5cb94
ec64320
b7778af
9ab1389
fccb0f7
871b5d0
03a54f4
1dd886a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2119,15 +2119,15 @@ class TableEditableItem(Widget, _MixinTextualWidget): | |
"""item widget for the TableRow.""" | ||
|
||
@decorate_constructor_parameter_types([str]) | ||
def __init__(self, text='', text_align='left', **kwargs): | ||
def __init__(self, text='', text_style={}, **kwargs): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mutable functions args (dict in signature) are not a good idea There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. If you have your hands already on this, could you change it to None and assign |
||
""" | ||
Args: | ||
text (str): | ||
kwargs: See Widget.__init__() | ||
""" | ||
super(TableEditableItem, self).__init__(**kwargs) | ||
self.type = 'td' | ||
self.editInput = TextInput(style={'text-align': text_align}) | ||
self.editInput = TextInput(style=text_style) | ||
self.append(self.editInput) | ||
self.editInput.set_on_change_listener(self.onchange) | ||
self.get_text = self.editInput.get_text | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more proficient way to do styling would be to use css stylesheet. Otherwise we should add a style parameter for each widget in a container, like TableItem in Tables, ListItem in ListView and so on... Doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to use separate stylesheets, because at the moment, there is no documentation about it ;-)
If it means that the whole original stylesheet has to be copied, I don't think it's a good idea...