@@ -261,7 +261,7 @@ def create_page_highlight(self):
261
261
"""Return frame of widgets for Highlighting tab.
262
262
263
263
Tk Variables:
264
- colour : Color of selected target.
264
+ color : Color of selected target.
265
265
builtin_theme: Menu variable for built-in theme.
266
266
custom_theme: Menu variable for custom theme.
267
267
fg_bg_toggle: Toggle for foreground/background color.
@@ -276,11 +276,11 @@ def create_page_highlight(self):
276
276
277
277
Methods [attachment]:
278
278
load_theme_cfg: Load current highlight colors.
279
- get_colour : Invoke colorchooser [button_set_colour ].
280
- set_colour_sample_binding : Call set_colour_sample [fg_bg_toggle].
279
+ get_color : Invoke colorchooser [button_set_color ].
280
+ set_color_sample_binding : Call set_color_sample [fg_bg_toggle].
281
281
set_highlight_target: set fg_bg_toggle, set_color_sample().
282
- set_colour_sample : Set frame background to target.
283
- on_new_colour_set : Set new color and add option.
282
+ set_color_sample : Set frame background to target.
283
+ on_new_color_set : Set new color and add option.
284
284
paint_theme_sample: Recolor sample.
285
285
get_new_theme_name: Get from popup.
286
286
create_new_theme: Combine theme with changes and save.
@@ -293,8 +293,8 @@ def create_page_highlight(self):
293
293
frame
294
294
frame_custom: LabelFrame
295
295
(*)text_highlight_sample: Text
296
- (*)frame_colour_set : Frame
297
- button_set_colour : Button
296
+ (*)frame_color_set : Frame
297
+ button_set_color : Button
298
298
(*)opt_menu_highlight_target: DynOptionMenu - highlight_target
299
299
frame_fg_bg_toggle: Frame
300
300
(*)radio_fg: Radiobutton - fg_bg_toggle
@@ -329,7 +329,7 @@ def create_page_highlight(self):
329
329
self .builtin_theme = StringVar (parent )
330
330
self .custom_theme = StringVar (parent )
331
331
self .fg_bg_toggle = BooleanVar (parent )
332
- self .colour = StringVar (parent )
332
+ self .color = StringVar (parent )
333
333
self .is_builtin_theme = BooleanVar (parent )
334
334
self .highlight_target = StringVar (parent )
335
335
@@ -374,20 +374,20 @@ def tem(event, elem=element):
374
374
text .tag_bind (
375
375
self .theme_elements [element ][0 ], '<ButtonPress-1>' , tem )
376
376
text .config (state = DISABLED )
377
- self .frame_colour_set = Frame (frame_custom , relief = SOLID , borderwidth = 1 )
377
+ self .frame_color_set = Frame (frame_custom , relief = SOLID , borderwidth = 1 )
378
378
frame_fg_bg_toggle = Frame (frame_custom )
379
- button_set_colour = Button (
380
- self .frame_colour_set , text = 'Choose Colour for :' ,
381
- command = self .get_colour , highlightthickness = 0 )
379
+ button_set_color = Button (
380
+ self .frame_color_set , text = 'Choose Color for :' ,
381
+ command = self .get_color , highlightthickness = 0 )
382
382
self .opt_menu_highlight_target = DynOptionMenu (
383
- self .frame_colour_set , self .highlight_target , None ,
383
+ self .frame_color_set , self .highlight_target , None ,
384
384
highlightthickness = 0 ) #, command=self.set_highlight_targetBinding
385
385
self .radio_fg = Radiobutton (
386
386
frame_fg_bg_toggle , variable = self .fg_bg_toggle , value = 1 ,
387
- text = 'Foreground' , command = self .set_colour_sample_binding )
387
+ text = 'Foreground' , command = self .set_color_sample_binding )
388
388
self .radio_bg = Radiobutton (
389
389
frame_fg_bg_toggle , variable = self .fg_bg_toggle , value = 0 ,
390
- text = 'Background' , command = self .set_colour_sample_binding )
390
+ text = 'Background' , command = self .set_color_sample_binding )
391
391
self .fg_bg_toggle .set (1 )
392
392
button_save_custom_theme = Button (
393
393
frame_custom , text = 'Save as New Custom Theme' ,
@@ -414,11 +414,11 @@ def tem(event, elem=element):
414
414
frame_custom .pack (side = LEFT , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
415
415
frame_theme .pack (side = LEFT , padx = 5 , pady = 5 , fill = Y )
416
416
#frame_custom
417
- self .frame_colour_set .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = X )
417
+ self .frame_color_set .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = X )
418
418
frame_fg_bg_toggle .pack (side = TOP , padx = 5 , pady = 0 )
419
419
self .text_highlight_sample .pack (
420
420
side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
421
- button_set_colour .pack (side = TOP , expand = TRUE , fill = X , padx = 8 , pady = 4 )
421
+ button_set_color .pack (side = TOP , expand = TRUE , fill = X , padx = 8 , pady = 4 )
422
422
self .opt_menu_highlight_target .pack (
423
423
side = TOP , expand = TRUE , fill = X , padx = 8 , pady = 3 )
424
424
self .radio_fg .pack (side = LEFT , anchor = E )
@@ -694,7 +694,7 @@ def attach_var_callbacks(self):
694
694
self .font_name .trace_add ('write' , self .var_changed_font )
695
695
self .font_bold .trace_add ('write' , self .var_changed_font )
696
696
self .space_num .trace_add ('write' , self .var_changed_space_num )
697
- self .colour .trace_add ('write' , self .var_changed_colour )
697
+ self .color .trace_add ('write' , self .var_changed_color )
698
698
self .builtin_theme .trace_add ('write' , self .var_changed_builtin_theme )
699
699
self .custom_theme .trace_add ('write' , self .var_changed_custom_theme )
700
700
self .is_builtin_theme .trace_add ('write' , self .var_changed_is_builtin_theme )
@@ -712,7 +712,7 @@ def remove_var_callbacks(self):
712
712
"Remove callbacks to prevent memory leaks."
713
713
for var in (
714
714
self .font_size , self .font_name , self .font_bold ,
715
- self .space_num , self .colour , self .builtin_theme ,
715
+ self .space_num , self .color , self .builtin_theme ,
716
716
self .custom_theme , self .is_builtin_theme , self .highlight_target ,
717
717
self .keybinding , self .builtin_keys , self .custom_keys ,
718
718
self .are_keys_builtin , self .win_width , self .win_height ,
@@ -738,9 +738,9 @@ def var_changed_space_num(self, *params):
738
738
value = self .space_num .get ()
739
739
changes .add_option ('main' , 'Indent' , 'num-spaces' , value )
740
740
741
- def var_changed_colour (self , * params ):
741
+ def var_changed_color (self , * params ):
742
742
"Process change to color choice."
743
- self .on_new_colour_set ()
743
+ self .on_new_color_set ()
744
744
745
745
def var_changed_builtin_theme (self , * params ):
746
746
"""Process new builtin theme selection.
@@ -1099,31 +1099,31 @@ def delete_custom_theme(self):
1099
1099
self .activate_config_changes ()
1100
1100
self .set_theme_type ()
1101
1101
1102
- def get_colour (self ):
1102
+ def get_color (self ):
1103
1103
"""Handle button to select a new color for the target tag.
1104
1104
1105
1105
If a new color is selected while using a builtin theme, a
1106
1106
name must be supplied to create a custom theme.
1107
1107
1108
1108
Attributes accessed:
1109
1109
highlight_target
1110
- frame_colour_set
1110
+ frame_color_set
1111
1111
is_builtin_theme
1112
1112
1113
1113
Attributes updated:
1114
- colour
1114
+ color
1115
1115
1116
1116
Methods:
1117
1117
get_new_theme_name
1118
1118
create_new_theme
1119
1119
"""
1120
1120
target = self .highlight_target .get ()
1121
- prev_colour = self .frame_colour_set .cget ('bg' )
1122
- rgbTuplet , colour_string = tkColorChooser .askcolor (
1123
- parent = self , title = 'Pick new colour for : ' + target ,
1124
- initialcolor = prev_colour )
1125
- if colour_string and (colour_string != prev_colour ):
1126
- # User didn't cancel and they chose a new colour .
1121
+ prev_color = self .frame_color_set .cget ('bg' )
1122
+ rgbTuplet , color_string = tkColorChooser .askcolor (
1123
+ parent = self , title = 'Pick new color for : ' + target ,
1124
+ initialcolor = prev_color )
1125
+ if color_string and (color_string != prev_color ):
1126
+ # User didn't cancel and they chose a new color .
1127
1127
if self .is_builtin_theme .get (): # Current theme is a built-in.
1128
1128
message = ('Your changes will be saved as a new Custom Theme. '
1129
1129
'Enter a name for your new Custom Theme below.' )
@@ -1132,20 +1132,20 @@ def get_colour(self):
1132
1132
return
1133
1133
else : # Create new custom theme based on previously active theme.
1134
1134
self .create_new_theme (new_theme )
1135
- self .colour .set (colour_string )
1135
+ self .color .set (color_string )
1136
1136
else : # Current theme is user defined.
1137
- self .colour .set (colour_string )
1137
+ self .color .set (color_string )
1138
1138
1139
- def on_new_colour_set (self ):
1139
+ def on_new_color_set (self ):
1140
1140
"Display sample of new color selection on the dialog."
1141
- new_colour = self .colour .get ()
1142
- self .frame_colour_set .config (bg = new_colour ) # Set sample.
1141
+ new_color = self .color .get ()
1142
+ self .frame_color_set .config (bg = new_color ) # Set sample.
1143
1143
plane = 'foreground' if self .fg_bg_toggle .get () else 'background'
1144
1144
sample_element = self .theme_elements [self .highlight_target .get ()][0 ]
1145
- self .text_highlight_sample .tag_config (sample_element , ** {plane :new_colour })
1145
+ self .text_highlight_sample .tag_config (sample_element , ** {plane :new_color })
1146
1146
theme = self .custom_theme .get ()
1147
1147
theme_element = sample_element + '-' + plane
1148
- changes .add_option ('highlight' , theme , theme_element , new_colour )
1148
+ changes .add_option ('highlight' , theme , theme_element , new_color )
1149
1149
1150
1150
def get_new_theme_name (self , message ):
1151
1151
"Return name of new theme from query popup."
@@ -1258,7 +1258,7 @@ def set_highlight_target(self):
1258
1258
fg_bg_toggle
1259
1259
1260
1260
Methods:
1261
- set_colour_sample
1261
+ set_color_sample
1262
1262
1263
1263
Called from:
1264
1264
var_changed_highlight_target
@@ -1272,17 +1272,17 @@ def set_highlight_target(self):
1272
1272
self .radio_fg .config (state = NORMAL )
1273
1273
self .radio_bg .config (state = NORMAL )
1274
1274
self .fg_bg_toggle .set (1 )
1275
- self .set_colour_sample ()
1275
+ self .set_color_sample ()
1276
1276
1277
- def set_colour_sample_binding (self , * args ):
1277
+ def set_color_sample_binding (self , * args ):
1278
1278
"""Change color sample based on foreground/background toggle.
1279
1279
1280
1280
Methods:
1281
- set_colour_sample
1281
+ set_color_sample
1282
1282
"""
1283
- self .set_colour_sample ()
1283
+ self .set_color_sample ()
1284
1284
1285
- def set_colour_sample (self ):
1285
+ def set_color_sample (self ):
1286
1286
"""Set the color of the frame background to reflect the selected target.
1287
1287
1288
1288
Instance variables accessed:
@@ -1292,13 +1292,13 @@ def set_colour_sample(self):
1292
1292
text_highlight_sample
1293
1293
1294
1294
Attributes updated:
1295
- frame_colour_set
1295
+ frame_color_set
1296
1296
"""
1297
- # Set the colour sample area.
1297
+ # Set the color sample area.
1298
1298
tag = self .theme_elements [self .highlight_target .get ()][0 ]
1299
1299
plane = 'foreground' if self .fg_bg_toggle .get () else 'background'
1300
- colour = self .text_highlight_sample .tag_cget (tag , plane )
1301
- self .frame_colour_set .config (bg = colour )
1300
+ color = self .text_highlight_sample .tag_cget (tag , plane )
1301
+ self .frame_color_set .config (bg = color )
1302
1302
1303
1303
def paint_theme_sample (self ):
1304
1304
"""Apply the theme colors to each element tag in the sample text.
@@ -1313,7 +1313,7 @@ def paint_theme_sample(self):
1313
1313
text_highlight_sample: Set the tag elements to the theme.
1314
1314
1315
1315
Methods:
1316
- set_colour_sample
1316
+ set_color_sample
1317
1317
1318
1318
Called from:
1319
1319
var_changed_builtin_theme
@@ -1326,19 +1326,19 @@ def paint_theme_sample(self):
1326
1326
theme = self .custom_theme .get ()
1327
1327
for element_title in self .theme_elements :
1328
1328
element = self .theme_elements [element_title ][0 ]
1329
- colours = idleConf .GetHighlight (theme , element )
1329
+ colors = idleConf .GetHighlight (theme , element )
1330
1330
if element == 'cursor' : # Cursor sample needs special painting.
1331
- colours ['background' ] = idleConf .GetHighlight (
1331
+ colors ['background' ] = idleConf .GetHighlight (
1332
1332
theme , 'normal' , fgBg = 'bg' )
1333
1333
# Handle any unsaved changes to this theme.
1334
1334
if theme in changes ['highlight' ]:
1335
1335
theme_dict = changes ['highlight' ][theme ]
1336
1336
if element + '-foreground' in theme_dict :
1337
- colours ['foreground' ] = theme_dict [element + '-foreground' ]
1337
+ colors ['foreground' ] = theme_dict [element + '-foreground' ]
1338
1338
if element + '-background' in theme_dict :
1339
- colours ['background' ] = theme_dict [element + '-background' ]
1340
- self .text_highlight_sample .tag_config (element , ** colours )
1341
- self .set_colour_sample ()
1339
+ colors ['background' ] = theme_dict [element + '-background' ]
1340
+ self .text_highlight_sample .tag_config (element , ** colors )
1341
+ self .set_color_sample ()
1342
1342
1343
1343
def help_source_selected (self , event ):
1344
1344
"Handle event for selecting additional help."
0 commit comments