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
a96c96f5
Commit
a96c96f5
authored
Sep 21, 2017
by
Serhiy Storchaka
Committed by
GitHub
Sep 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-31500: IDLE: Scale default fonts on HiDPI displays. (#3639)
parent
3d1e2ab5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
0 deletions
+20
-0
Lib/idlelib/filelist.py
Lib/idlelib/filelist.py
+2
-0
Lib/idlelib/pyshell.py
Lib/idlelib/pyshell.py
+4
-0
Lib/idlelib/run.py
Lib/idlelib/run.py
+13
-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 @
a96c96f5
...
...
@@ -113,8 +113,10 @@ class FileList:
def
_test
():
from
idlelib.editor
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 @
a96c96f5
...
...
@@ -12,6 +12,8 @@ import tkinter.messagebox as tkMessageBox
if
TkVersion
<
8.5
:
root
=
Tk
()
# otherwise create root in main
root
.
withdraw
()
from
idlelib.run
import
fix_scaling
fix_scaling
(
root
)
tkMessageBox
.
showerror
(
"Idle Cannot Start"
,
"Idle requires tcl/tk 8.5+, not %s."
%
TkVersion
,
parent
=
root
)
...
...
@@ -1457,6 +1459,8 @@ def main():
NoDefaultRoot
()
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 @
a96c96f5
...
...
@@ -184,6 +184,7 @@ def show_socket_error(err, address):
import
tkinter
from
tkinter.messagebox
import
showerror
root
=
tkinter
.
Tk
()
fix_scaling
(
root
)
root
.
withdraw
()
msg
=
f"IDLE's subprocess can't connect to
{
address
[
0
]
}
:
{
address
[
1
]
}
.
\
n
"
\
f"Fatal OSError #
{
err
.
errno
}
:
{
err
.
strerror
}
.
\
n
"
\
...
...
@@ -277,6 +278,18 @@ def exit():
sys
.
exit
(
0
)
def
fix_scaling
(
root
):
"""Scale fonts on HiDPI displays."""
import
tkinter.font
scaling
=
float
(
root
.
tk
.
call
(
'tk'
,
'scaling'
))
if
scaling
>
1.4
:
for
name
in
tkinter
.
font
.
names
(
root
):
font
=
tkinter
.
font
.
Font
(
root
=
root
,
name
=
name
,
exists
=
True
)
size
=
int
(
font
[
'size'
])
if
size
<
0
:
font
[
'size'
]
=
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 @
a96c96f5
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