Skip to content
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

[selection-] hide selection markers when cols are hidden #2362

Closed
wants to merge 1 commit into from

Conversation

midichef
Copy link
Contributor

When rows are selected and all columns are hidden, the selection markers are still drawn, next to the blank sheet. This PR checks for visible columns before drawing the symbol.

Copy link
Owner

@saulpw saulpw left a comment

Choose a reason for hiding this comment

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

Does it matter whether the selection markers are shown in this degenerate case? It seems like the user might still want to know which rows were selected even if they can't see any data from the rows.

@midichef
Copy link
Contributor Author

midichef commented May 17, 2024

The selection markers become misleading, once the last column disappears. Their vertical offset, which is usually 1, but could be any integer, becomes 0 when the header disappears with the last column, when self.nHeaderRows becomes 0.

return max(len(col.name.split('\n')) for col in vcols) if vcols else 0

y = headerRow + numHeaderRows

So I think it's better not to show the markers at all.

saulpw added a commit that referenced this pull request May 17, 2024
saulpw added a commit that referenced this pull request May 17, 2024
@saulpw
Copy link
Owner

saulpw commented May 17, 2024

Okay, I made the minimum number of header rows 1, and when there are no unhidden columns, it shows a basic Column that just stringifies the row. I think this is more useful behavior than constructing a perfectly null interface for this case.

@saulpw saulpw closed this May 17, 2024
@midichef midichef deleted the selection_hidden branch May 25, 2024 09:43
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.

None yet

2 participants