Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c87d9f40
Kaydet (Commit)
c87d9f40
authored
Eyl 23, 2018
tarafından
Tal Einat
Kaydeden (comit)
Miss Islington (bot)
Eyl 23, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34548: IDLE: use configured theme colors in TextView (GH-9008)
https://bugs.python.org/issue34548
üst
24b447ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
colorizer.py
Lib/idlelib/colorizer.py
+7
-4
textview.py
Lib/idlelib/textview.py
+4
-5
2018-09-22-20-25-07.bpo-34548.7pBzjg.rst
...NEWS.d/next/IDLE/2018-09-22-20-25-07.bpo-34548.7pBzjg.rst
+1
-0
No files found.
Lib/idlelib/colorizer.py
Dosyayı görüntüle @
c87d9f40
...
...
@@ -31,11 +31,12 @@ def make_pat():
prog
=
re
.
compile
(
make_pat
(),
re
.
S
)
idprog
=
re
.
compile
(
r"\s+(\w+)"
,
re
.
S
)
def
color_config
(
text
):
# Called from htest, Editor, and Turtle Demo.
'''Set color opit
ons of Text widget.
def
color_config
(
text
):
"""Set color opti
ons of Text widget.
Should be called whenever ColorDelegator is called.
'''
If ColorDelegator is used, this should be called first.
"""
# Called from htest, TextFrame, Editor, and Turtledemo.
# Not automatic because ColorDelegator does not know 'text'.
theme
=
idleConf
.
CurrentTheme
()
normal_colors
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)
...
...
@@ -50,6 +51,7 @@ def color_config(text): # Called from htest, Editor, and Turtle Demo.
inactiveselectbackground
=
select_colors
[
'background'
],
# new in 8.5
)
class
ColorDelegator
(
Delegator
):
def
__init__
(
self
):
...
...
@@ -285,6 +287,7 @@ def _color_delegator(parent): # htest #
d
=
ColorDelegator
()
p
.
insertfilter
(
d
)
if
__name__
==
"__main__"
:
from
unittest
import
main
main
(
'idlelib.idle_test.test_colorizer'
,
verbosity
=
2
,
exit
=
False
)
...
...
Lib/idlelib/textview.py
Dosyayı görüntüle @
c87d9f40
...
...
@@ -5,6 +5,8 @@ from tkinter import Toplevel, Text
from
tkinter.ttk
import
Frame
,
Scrollbar
,
Button
from
tkinter.messagebox
import
showerror
from
idlelib.colorizer
import
color_config
class
TextFrame
(
Frame
):
"Display text with scrollbar."
...
...
@@ -18,12 +20,9 @@ class TextFrame(Frame):
super
()
.
__init__
(
parent
)
self
[
'relief'
]
=
'sunken'
self
[
'height'
]
=
700
# TODO: get fg/bg from theme.
self
.
bg
=
'#ffffff'
self
.
fg
=
'#000000'
self
.
text
=
text
=
Text
(
self
,
wrap
=
'word'
,
highlightthickness
=
0
,
fg
=
self
.
fg
,
bg
=
self
.
bg
)
self
.
text
=
text
=
Text
(
self
,
wrap
=
'word'
,
highlightthickness
=
0
)
color_config
(
text
)
self
.
scroll
=
scroll
=
Scrollbar
(
self
,
orient
=
'vertical'
,
takefocus
=
False
,
command
=
text
.
yview
)
text
[
'yscrollcommand'
]
=
scroll
.
set
...
...
Misc/NEWS.d/next/IDLE/2018-09-22-20-25-07.bpo-34548.7pBzjg.rst
0 → 100644
Dosyayı görüntüle @
c87d9f40
Use configured color theme for read-only text views.
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