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

Center text in spreadsheet vertical headers #18738

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

hyarion
Copy link
Contributor

@hyarion hyarion commented Dec 26, 2024

There seem to be a de facto standard in spreadsheet applications to center text both in column and row headers, however in qt, default seem to be to left align row header text.

This PR changes the alignment so it matches other spreadsheet applications such as google sheets, excel, numbers, excel, open office (even lotus 1-2-3 for windows).

As mentioned in this other PR comment, centering text needs to be done in code rather than in style sheets. By doing it in code, it is also fixes it in Classic.

Before (classic 1.0):
image

Before (classic 1.1.0dev head+qt6-this modification):
image

After (classic 1.1.0dev head+qt6+this modification):
image

@github-actions github-actions bot added the Mod: Spreadsheet Related to the Spreadsheet Workbench label Dec 26, 2024
@xtemp09
Copy link
Contributor

xtemp09 commented Dec 26, 2024

Of course, this is not connected to this PR, but I ought to add ― the screenshots provided use different style(sheet)s and the newer is flatter and more vapid.

@MisterMakerNL
Copy link
Contributor

Nice!
Did you checked if the numbers aren't cut off. Although 10k cells is probably a bit overkill for Freecad spreadsheet.

@hyarion
Copy link
Contributor Author

hyarion commented Dec 28, 2024

@xtemp09 I've now added a screenshot from current head

@hyarion
Copy link
Contributor Author

hyarion commented Dec 28, 2024

@MisterMakerNL

Nice! Did you checked if the numbers aren't cut off. Although 10k cells is probably a bit overkill for Freecad spreadsheet.

This uses text alignment to center the numbers so there's no cutoff:
image

@luzpaz
Copy link
Contributor

luzpaz commented Dec 28, 2024

@hyarion this is awesome. Do you mind --amending the commit to prepend Spreadsheet: to it ?

@hyarion hyarion force-pushed the center-spreadsheet-row-headers branch from 37014c7 to b27eff3 Compare December 28, 2024 22:55
@hyarion hyarion force-pushed the center-spreadsheet-row-headers branch from b27eff3 to 0c1b468 Compare December 28, 2024 22:56
@hyarion
Copy link
Contributor Author

hyarion commented Dec 28, 2024

@luzpaz done

@yorikvanhavre yorikvanhavre merged commit af1aa40 into FreeCAD:main Jan 6, 2025
9 checks passed
@hyarion hyarion deleted the center-spreadsheet-row-headers branch January 6, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Spreadsheet Related to the Spreadsheet Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants