-
Notifications
You must be signed in to change notification settings - Fork 2
fix #43 (autoresize) #81
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
Conversation
…) and resizeAxesRowToContents() methods + synchronized view_axes with view_x/ylabels in ArrayEditorWidget
larray_editor/arraywidget.py
Outdated
# no need to call resizeSection on view_ylabels (see synchronization lines in init) | ||
self.view_axes.horizontalHeader().resizeSection(column, width) | ||
|
||
def resizeDataColumnToContents(self, column): |
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.
rename to resize_xlabels_column_to_contents because this works first on the view_xlabels not view_data?
- to be consistent with resizeAxes... which works on view_axes
- to respect python naming conventions (this is not an overridden method name)
larray_editor/arraywidget.py
Outdated
# must be connected to view_labels.horizontalHeader().sectionHandleDoubleClicked signal | ||
width = max(self.view_xlabels.horizontalHeader().sectionSize(column), | ||
self.view_data.sizeHintForColumn(column)) | ||
# no need to call resizeSection on view_data (see synchronization lines in init) | ||
self.view_xlabels.horizontalHeader().resizeSection(column, width) | ||
|
||
def resizeRowToContents(self, row): | ||
def resizeAxesRowToContents(self, row): |
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.
rename to resize_axes_row_to_contents?
larray_editor/arraywidget.py
Outdated
# no need to call resizeSection on view_xlabels (see synchronization lines in init) | ||
self.view_axes.verticalHeader().resizeSection(row, height) | ||
|
||
def resizeDataRowToContents(self, row): |
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.
idem
larray_editor/arraywidget.py
Outdated
|
||
def resizeColumnToContents(self, column): | ||
def resizeAxesColumnToContents(self, column): |
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.
rename to resize_axes_column_to_contents?
larray_editor/api.py
Outdated
@@ -339,12 +339,13 @@ def restore_display_hook(): | |||
[ '', 1664780726569649730, -9196963249083393206, -7664327348053294350]]) | |||
|
|||
# test autoresizing | |||
arr8 = la.zeros('a=a_long_label,another_long_label') | |||
arr8 = la.zeros('a=a_long_label,another_long_label; b=this_is_a_label,this_is_another_one') |
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.
it would be nice to give meaningful names to those arrays: either what do they test, or what is their "special" characteristic, eg:
>>> test_column_resize1 = la.zeros('a=a_long_label,another_long_label; b=this_is_a_label,this_is_another_one')
>>> # or
>>> long_labels = la.zeros('a=a_long_label,another_long_label; b=this_is_a_label,this_is_another_one')
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.
needs changelog
No description provided.