diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-07-04 14:38:48 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-07-04 14:52:37 +0200 |
commit | 8155ba54ae39dd71c6b8ddff2b2b7353dde9aff8 (patch) | |
tree | 94b2b61cd034873c537b7991cdbe6312fdad2fb3 /ide/preferences.ml | |
parent | 3e0334dd48b5d0b03046d0aff1a82867dc98d656 (diff) | |
parent | e0ad7ac11b97f089fa862d2e34409e0a1d77d3a1 (diff) |
Merge branch 'v8.6'
Diffstat (limited to 'ide/preferences.ml')
-rw-r--r-- | ide/preferences.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ide/preferences.ml b/ide/preferences.ml index 95c03b9fc..7c251f79c 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 ~callback:(fun c -> tag#set_property (f c)) + let attach_bg (pref : string preference) (tag : GText.tag) = - pref#connect#changed ~callback:(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 ~callback:(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) |