-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add ruler to display column numbers #573
Conversation
d7cbfd6
to
cb1e8e5
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.
When I use dark theme, the column bar text remains black. I'm not using dark mode in the OS (Win 11).
|
I was able to get focus into the ruler and type stuff: see screenshot. Note that clicking back in the main text window caused the ruler to be redrawn correctly, so it isn't a big issue. |
Tracked the focus in ruler issue down - it's the event "ButtonRelease-2".
|
The coloring update should be fixed now. There is still a border around the ruler (which is a layout issue, not a padding issue, but it's prominent and distracting in dark theme, at least for me). Will look at the border separately. |
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.
Seems OK now in my limited testing. Note when Windows "Color mode" is set to "Dark", then GG2 theme "Default" still appears the same as "Light", don't know if this is expected.
This is fixed, thanks for the pointer!
This is fixed; now
This was a regression bug I introduced while laying out the grid; I added a This did uncover another bug, which is that the ruler doesn't dynamically resize when the font size changes. I'll look into that.
This misalign was also caused by the previously-mentioned |
This is fixed. |
Seems reasonable to me; added that. |
Okay, added all of these. |
@rtonsing - unfortunately, that is just how tkinter behaves. On Macs, "Default" follows the system theme, but not on Windows or Linux. If it had, I probably wouldn't have bothered with themes at all :) |
That's fixed; or at least it's now the same as line numbers. Further improvement is for #353 (IMHO).
I was able to reproduce the behavior. I don't fully understand the cause, but I theorize that with It probably wouldn't affect anyone but devs and testers. But we could work around it by adding a |
The intent is that it looks the same as the line numbers, in all the different modes. Are you seeing that they differ, in that mode? |
I see that @windymilla already answered this; so I will disregard as it's an expected behavior. |
Squashed and rebased. |
Forgot to mention in the comments anywhere, but the border was fixed along the way too ( |
Also just thought, if you remove the borderthickness, you may need to add 2 pixel extra x-padding, to make it 5 in total. |
That isn't how
Although it does mean the setting isn't loaded from the prefs file, that is the same as the first time the user runs the program. So, if we are seeing odd behavior with |
We could, although as noted above, we shouldn't generally need it. If we want to persist a setting when testing across several runs, then don't specify |
Assuming that was GG2 Dark mode (not OS Dark mode & GG2 default) then it's possible that the style for a Text widget is different on Macs and Windows. The default border width on Windows seems to be 2. It also says here in the section on borderwidth:
So, safest that you're setting it explicitly to zero, but explains why you didn't see it previously. |
Sorry @rtonsing - misclicked. Didn't mean to re-request a review. |
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!
Adds a ruler along the top of each text view to display column numbers, highlighting current column number. Adds a user preference to prefs panel (defaulting False) for control of this feature. Fixes DistributedProofreaders#61
Revisiting the "misalignment" between main text and peer, it's still there. But it appears to be that two-pixel issue. Or rather, on macOS, all themes. I'm questioning if it really matters a whole lot. Each text block is internally consistent, and if someone wants to see both the beginning and end of a long line using the split screen, I don't think top-to-bottom alignment is going to matter a lick.
For the weirdness, maybe occasionally when you think you're using a two-finger tap, you're actually only getting a one-finger tap? I had very predictable results with shift-click (i.e. one-finger tap), and shift-(two-finger-tap), as well as, predictably, shift-ctrl-click. I did have an external mouse handy, and shift-right-click worked just fine. |
Adds a ruler along the top of each text view to display column numbers, highlighting current column number.
Adds a user preference to prefs panel (defaulting False) for control of this feature.
Fixes #61
Testing Notes
@windymilla when I use the Dark theme the colors are broken. Maybe you can tell me why? I haven't been able to find that one. It does work in Default theme when the OS dark mode is adjusted (at least on Mac). And the Light theme works.