mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
further work on dynamic config changes;
editor font
This commit is contained in:
parent
314bae50b9
commit
b1585417d1
2 changed files with 16 additions and 2 deletions
|
@ -159,8 +159,12 @@ class EditorWindow:
|
||||||
vbar.pack(side=RIGHT, fill=Y)
|
vbar.pack(side=RIGHT, fill=Y)
|
||||||
|
|
||||||
text['yscrollcommand'] = vbar.set
|
text['yscrollcommand'] = vbar.set
|
||||||
|
fontWeight='normal'
|
||||||
|
if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
|
||||||
|
fontWeight='bold'
|
||||||
text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
|
text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
|
||||||
idleConf.GetOption('main','EditorWindow','font-size')))
|
idleConf.GetOption('main','EditorWindow','font-size'),
|
||||||
|
fontWeight))
|
||||||
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
|
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
|
||||||
text.pack(side=TOP, fill=BOTH, expand=1)
|
text.pack(side=TOP, fill=BOTH, expand=1)
|
||||||
text.focus_set()
|
text.focus_set()
|
||||||
|
@ -478,6 +482,16 @@ class EditorWindow:
|
||||||
self.color = self.ColorDelegator()
|
self.color = self.ColorDelegator()
|
||||||
self.per.insertfilter(self.color)
|
self.per.insertfilter(self.color)
|
||||||
|
|
||||||
|
def ResetFont(self):
|
||||||
|
#this function is called from configDialog.py
|
||||||
|
#to update the text widgets' font if it is changed
|
||||||
|
fontWeight='normal'
|
||||||
|
if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
|
||||||
|
fontWeight='bold'
|
||||||
|
self.text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
|
||||||
|
idleConf.GetOption('main','EditorWindow','font-size'),
|
||||||
|
fontWeight))
|
||||||
|
|
||||||
def saved_change_hook(self):
|
def saved_change_hook(self):
|
||||||
short = self.short_title()
|
short = self.short_title()
|
||||||
long = self.long_title()
|
long = self.long_title()
|
||||||
|
|
|
@ -939,7 +939,6 @@ class ConfigDialog(Toplevel):
|
||||||
type='bool',default=1))
|
type='bool',default=1))
|
||||||
##currently set theme
|
##currently set theme
|
||||||
currentOption=idleConf.CurrentTheme()
|
currentOption=idleConf.CurrentTheme()
|
||||||
print 'current option',currentOption
|
|
||||||
##load available theme option menus
|
##load available theme option menus
|
||||||
if self.themeIsBuiltin.get(): #default theme selected
|
if self.themeIsBuiltin.get(): #default theme selected
|
||||||
itemList=idleConf.GetSectionList('default','highlight')
|
itemList=idleConf.GetSectionList('default','highlight')
|
||||||
|
@ -1096,6 +1095,7 @@ class ConfigDialog(Toplevel):
|
||||||
winInstances=self.parent.instanceDict.keys()
|
winInstances=self.parent.instanceDict.keys()
|
||||||
for instance in winInstances:
|
for instance in winInstances:
|
||||||
instance.ResetColorizer()
|
instance.ResetColorizer()
|
||||||
|
instance.ResetFont()
|
||||||
|
|
||||||
def Cancel(self):
|
def Cancel(self):
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue