Skip to content

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

Merged
merged 3 commits into from
Sep 27, 2017
Merged

Conversation

alixdamman
Copy link
Contributor

No description provided.

…) and resizeAxesRowToContents() methods + synchronized view_axes with view_x/ylabels in ArrayEditorWidget
# no need to call resizeSection on view_ylabels (see synchronization lines in init)
self.view_axes.horizontalHeader().resizeSection(column, width)

def resizeDataColumnToContents(self, column):
Copy link
Collaborator

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)

# 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):
Copy link
Collaborator

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?

# no need to call resizeSection on view_xlabels (see synchronization lines in init)
self.view_axes.verticalHeader().resizeSection(row, height)

def resizeDataRowToContents(self, row):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem


def resizeColumnToContents(self, column):
def resizeAxesColumnToContents(self, column):
Copy link
Collaborator

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?

@@ -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')
Copy link
Collaborator

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')

Copy link
Collaborator

@gdementen gdementen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs changelog

@alixdamman alixdamman merged commit e94a5ed into larray-project:master Sep 27, 2017
@alixdamman alixdamman deleted the autoresize_43 branch September 27, 2017 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants