-
Notifications
You must be signed in to change notification settings - Fork 821
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
Issue #4624 add page numbers #4693
Issue #4624 add page numbers #4693
Conversation
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.
First, thanks a lot for this PR! This is a very nice (and long overdue) feature.
I went through a couple of files (not all of them yet) and I have some comments, mainly about the implementation of drawStyle#
functions. Could you have a look, and make the requested changes? (also in drawStyle2
and drawStyle3
, although I did not repeat the comments therein)
Hi, thank you for the feedback about this PR. I have gone through all the change requests and tried to implement them or leave a comment. Those, I'm not sure about, I left unresolved. I hope the changes suit you well. |
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.
Thanks, this is a nice feature. I did a quick skim through the code, will do a more detailed review after some of @bhennion's comments are also addressed.
40c3e90
to
b780889
Compare
I think I have implemented all requested changes. But now for some reason the clang format pipeline fails, and I can't figure out what is causing this. |
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.
There are still some magic constants that should be defined (altogether) somewhere, with a descriptive name.
About the clang check: which version of clang-format did you use?
The check uses clang-format 17, which I think is not really stable. We should change that.
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.
LGTM!!
Thanks a lot for the very nice feature and for accommodating all our requests!
Ah, if you rebase onto latest master, the clang-format check should be working properly (and hopefully validate this PR). Then I'll squash and merge this! |
c590d04
to
596ff69
Compare
Ok now clang-format is also passing, just had to add some more commits for formatting. Looks like my local formatter was not setup correctly. Thank you for your reviews and suggestions on how to improve the code. |
Interesting. The cppreference says that
and the last listed file indeed includes a definition of Similarly via
we get a definition of |
I think the root problem is that |
8729fb1
to
f85e518
Compare
I just did that via #4743. Merging in 24 hours unless an obstruction is raised (or the pipeline complains). |
OK, now all the issues should be fixed. Sorry about the late intervention yesterday. |
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 tried it out again, and I found issues. I took the screen shot with GDK_SCALE=2 to make the problem more appearent, but they also occur without it.
- Style 1: The bottom of the numbers get truncated.
- Style 2: The numbers are not centered in the circle. We'd also need to adapt the circle for numbers with several digits. One idea is to make it oblong (i.e. like a rectangle with two half-disks on the sides)
- Style 3: Same problem here. Moreover, the grey frame is missplaced by a couple pixels (we should not be seeing a black line between the page and the frame)
For some reason, I cannot reproduce the first issue with the truncated page numbers, neither with GDK_SCALE=2 nor without. |
It appears all the time. It seems to go away for the number of a given page if I change the page's size. |
Do you mean changing the page zoom |
The paper format |
Regarding the issue with the truncated page numbers. I think I found what was causing this. It was that the page preview widget were never properly resized to handle the additional number at the bottom. I have fixed this now. But when the style is changed in the preferences, it does not immediately update the widget size. In that case, it can be that either the widget is displayed too large or the page number is truncated until the sidebar is redrawn and layouted the next time. A solution would be to always layout the sidebar immediately after the preferences were saved. |
I had a couple minutes to test this this morning. Most of the issues seen gone. The truncated page numbers seem fixed as well. You are mentioning another minor issue though: I agree the layout should be updated whenever the setting is changed. I'll try to have a look at the code later today. |
The layout issue after changing styles in the preferences should be fixed now. |
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.
Sorry for the delay.
I disagree with your solution for updating the sidebar when the parameter is changed in Settings. See below. (you can start by reverting your last commit)
d897b3e
to
6e2b526
Compare
6e2b526
to
01d0b85
Compare
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.
LGTM!!
Thanks a lot for the hard work! |
Hi, I would like to submit this pull request.
I have implemented that the page numbers are displayed on the sidebar for the page previews.
This is the first time I'm doing a pull request. I hope that I have done everything right, otherwise please let me know.
Related issue: (#4624)