From 43e141c5bcc0a9745f89061c94fe953c15e8d5c0 Mon Sep 17 00:00:00 2001 From: Cyprien Mangin Date: Tue, 20 Jun 2017 12:48:22 +0200 Subject: Default colors for CoqIDE are actually applied. This fixes bug #5380 in particular. More generally, tags were not updated to the correct default value if the corresponding line in the configuration file was missing. --- ide/preferences.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ide') diff --git a/ide/preferences.ml b/ide/preferences.ml index 8559533de..56bf91a09 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -407,11 +407,15 @@ let opposite_tabs = let background_color = new preference ~name:["background_color"] ~init:"cornsilk" ~repr:Repr.(string) +let attach_tag (pref : string preference) (tag : GText.tag) f = + tag#set_property (f pref#get); + pref#connect#changed (fun c -> tag#set_property (f c)) + let attach_bg (pref : string preference) (tag : GText.tag) = - pref#connect#changed (fun c -> tag#set_property (`BACKGROUND c)) + attach_tag pref tag (fun c -> `BACKGROUND c) let attach_fg (pref : string preference) (tag : GText.tag) = - pref#connect#changed (fun c -> tag#set_property (`FOREGROUND c)) + attach_tag pref tag (fun c -> `FOREGROUND c) let processing_color = new preference ~name:["processing_color"] ~init:"light blue" ~repr:Repr.(string) -- cgit v1.2.3