Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
18c44cc0
Commit
18c44cc0
authored
Oct 20, 2018
by
Cheryl Sabella
Committed by
Terry Jan Reedy
Oct 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585)
(cherry picked from commit
a96c96f5
)
parent
b53edb12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
Lib/idlelib/FileList.py
Lib/idlelib/FileList.py
+2
-0
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+2
-0
Lib/idlelib/run.py
Lib/idlelib/run.py
+14
-0
Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst
...NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst
+1
-0
No files found.
Lib/idlelib/FileList.py
View file @
18c44cc0
...
...
@@ -107,8 +107,10 @@ class FileList:
def
_test
():
from
idlelib.EditorWindow
import
fixwordbreaks
from
idlelib.run
import
fix_scaling
import
sys
root
=
Tk
()
fix_scaling
(
root
)
fixwordbreaks
(
root
)
root
.
withdraw
()
flist
=
FileList
(
root
)
...
...
Lib/idlelib/PyShell.py
View file @
18c44cc0
...
...
@@ -1552,6 +1552,8 @@ def main():
# start editor and/or shell windows:
root
=
Tk
(
className
=
"Idle"
)
root
.
withdraw
()
from
idlelib.run
import
fix_scaling
fix_scaling
(
root
)
# set application icon
icondir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'Icons'
)
...
...
Lib/idlelib/run.py
View file @
18c44cc0
...
...
@@ -155,6 +155,7 @@ def show_socket_error(err, address):
import
Tkinter
import
tkMessageBox
root
=
Tkinter
.
Tk
()
fix_scaling
(
root
)
root
.
withdraw
()
if
err
.
args
[
0
]
==
61
:
# connection refused
msg
=
"IDLE's subprocess can't connect to %s:%d. This may be due "
\
...
...
@@ -240,6 +241,19 @@ def exit():
capture_warnings
(
False
)
sys
.
exit
(
0
)
def
fix_scaling
(
root
):
"""Scale fonts on HiDPI displays."""
import
tkFont
scaling
=
float
(
root
.
tk
.
call
(
'tk'
,
'scaling'
))
if
scaling
>
1.4
:
for
name
in
tkFont
.
names
(
root
):
font
=
tkFont
.
Font
(
root
=
root
,
name
=
name
,
exists
=
True
)
size
=
int
(
font
[
'size'
])
if
size
<
0
:
font
[
'size'
]
=
int
(
round
(
-
0.75
*
size
))
class
MyRPCServer
(
rpc
.
RPCServer
):
def
handle_error
(
self
,
request
,
client_address
):
...
...
Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst
0 → 100644
View file @
18c44cc0
Default fonts now are scaled on HiDPI displays.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment