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

gh-122392: Fix the wrong size of the Path Browser vertical spacing for IDLE (#122392) #124975

Merged
merged 9 commits into from
Oct 7, 2024

Conversation

Xiaokang2022
Copy link
Contributor

@Xiaokang2022 Xiaokang2022 commented Oct 4, 2024

The Path Browser vertical interval size was originally set to 20, but this caused display issues (such as overlapping) on some devices. Actually, we should calculate the size, and giving a fixed value will not solve the problem in all cases.

But no matter what the value is, the elements in the first row will not use it, so we can get the size of this value through the elements in the first row after the first row is drawn, and assign the value to the corresponding variable for the subsequent elements to use.

After testing, this solution worked very well on my device (Windows10 22H2 1920x1080).

Copy link

cpython-cla-bot bot commented Oct 4, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Oct 4, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

See additional new comment on issue.

Lib/idlelib/tree.py Outdated Show resolved Hide resolved
Lib/idlelib/tree.py Outdated Show resolved Hide resolved
Lib/idlelib/tree.py Outdated Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Oct 4, 2024

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Xiaokang2022
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Oct 4, 2024

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@terryjreedy
Copy link
Member

@serhiy-storchaka, @ned-deily, @ronaldoussoren: I am pretty sure that this should work on linux/macOS, but would any of you like to test before I merge? Open IDLE, select File => pathbrowser, open /Lib, the underscores and descenders on pyg should be complete (they likely would not have been before if you have a high-def screen). If normal screen, the space between folder icons should be about the same size as the icons.

@Xiaokang2022
Copy link
Contributor Author

I tested it on Arch Linux and it looks like this:

2024-10-05_14-37

@Xiaokang2022
Copy link
Contributor Author

Xiaokang2022 commented Oct 5, 2024

Hello, @terryjreedy

Regarding your second comment from the above review, I think there may be something wrong with some. Tonight, after I looked through the source code in the past, I found that the reason for the value of 17 here may be caused by you missing it in a change from 10 years ago. (9a6f8e1)

c5305b8ae15aa0b1c15fb4d59a1781f8

So I think my previous code might be correct. Of course, there may be some problems that I have not taken into account, and if so, please forgive me and point them out.

Lib/idlelib/tree.py Outdated Show resolved Hide resolved
@terryjreedy
Copy link
Member

Good digging. I could think that if 17 has not resulted in a report, maybe it was OK. But people mostly do not report glitches. Better safe than sorry.

@terryjreedy
Copy link
Member

I intend to merge this after 3.13.0 is released, which is scheduled to be within a day.

@terryjreedy terryjreedy added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Oct 7, 2024
@terryjreedy terryjreedy merged commit c5df1cb into python:main Oct 7, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks @Xiaokang2022 for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2024
…22392) (pythonGH-124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

(cherry picked from commit c5df1cb)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2024
…22392) (pythonGH-124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

(cherry picked from commit c5df1cb)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 7, 2024

GH-125061 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 7, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 7, 2024

GH-125062 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 7, 2024
terryjreedy added a commit that referenced this pull request Oct 7, 2024
GH-124975) (#125062)

gh-122392: IDLE - Fix overlapping lines in browsers (GH-122392) (GH-124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

(cherry picked from commit c5df1cb)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy added a commit that referenced this pull request Oct 7, 2024
GH-124975) (#125061)

gh-122392: IDLE - Fix overlapping lines in browsers (GH-122392) (GH-124975)

Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------

(cherry picked from commit c5df1cb)

Co-authored-by: Zhikang Yan <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
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