From 1f27f3d9e2df9052197c10eab8c4ccfecd5a5dae Mon Sep 17 00:00:00 2001 From: ppedrot Date: Wed, 2 May 2012 19:07:52 +0000 Subject: Better style handling in CoqIDE git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15273 85f007b7-540e-0410-9357-904b9bb8a0f7 --- ide/preferences.ml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ide/preferences.ml') diff --git a/ide/preferences.ml b/ide/preferences.ml index b976eba3d..2ad2cc802 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -75,6 +75,7 @@ let inputenc_of_string s = (** Hooks *) let refresh_font_hook = ref (fun () -> ()) +let refresh_style_hook = ref (fun () -> ()) let refresh_background_color_hook = ref (fun () -> ()) let refresh_toolbar_hook = ref (fun () -> ()) let auto_complete_hook = ref (fun x -> ()) @@ -546,8 +547,12 @@ let configure ?(apply=(fun () -> ())) () = in let source_style = - combo "Highlighting style" - ~f:(fun s -> current.source_style <- s) ~new_allowed:false + let f s = + current.source_style <- s; + !refresh_style_hook () + in + combo "Highlighting style:" + ~f ~new_allowed:false style_manager#style_scheme_ids current.source_style in @@ -687,11 +692,11 @@ let configure ?(apply=(fun () -> ())) () = let cmds = [Section("Fonts", Some `SELECT_FONT, [config_font]); - Section("Colors", Some `SELECT_COLOR, [config_color]); + Section("Colors", Some `SELECT_COLOR, [config_color;source_style]); Section("Files", Some `DIRECTORY, [global_auto_revert;global_auto_revert_delay; auto_save; auto_save_delay; (* auto_save_name*) - encodings;source_style; + encodings; ]); Section("Project", Some (`STOCK "gtk-page-setup"), [project_file_name;read_project; -- cgit v1.2.3