diff options
| author | Pierre-Marie Pédrot | 2015-02-15 18:17:04 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2015-02-15 18:17:04 +0100 |
| commit | d7691de7184b4cdcfd48fd762011569cde5523c5 (patch) | |
| tree | 9c9e14226b070fc2a5cf4c216c4f8c634de20855 /ide | |
| parent | eed12bddc3e6f6f9192c909a8b8f82859080f3a1 (diff) | |
| parent | aed3c876d422f4dcc0296fd4949148c697f37b1d (diff) | |
Merge branch 'v8.5'
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/MacOS/Info.plist.template | 2 | ||||
| -rw-r--r-- | ide/ideutils.ml | 9 | ||||
| -rw-r--r-- | ide/preferences.ml | 36 | ||||
| -rw-r--r-- | ide/preferences.mli | 1 | ||||
| -rw-r--r-- | ide/tags.ml | 24 | ||||
| -rw-r--r-- | ide/tags.mli | 10 |
6 files changed, 67 insertions, 15 deletions
diff --git a/ide/MacOS/Info.plist.template b/ide/MacOS/Info.plist.template index fd80c83969..e224e81204 100644 --- a/ide/MacOS/Info.plist.template +++ b/ide/MacOS/Info.plist.template @@ -66,7 +66,7 @@ <key>CFBundleGetInfoString</key> <string>Coq_vVERSION</string> <key>NSHumanReadableCopyright</key> - <string>Copyright 1999-2014, The Coq Development Team INRIA - CNRS - LIX - LRI - PPS</string> + <string>Copyright 1999-2015, The Coq Development Team INRIA - CNRS - LIX - LRI - PPS</string> <key>CFBundleHelpBookFolder</key> <string>share/doc/coq/html/</string> <key>CFAppleHelpAnchor</key> diff --git a/ide/ideutils.ml b/ide/ideutils.ml index a869442696..84ef8f40db 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -243,7 +243,14 @@ let coqtop_path () = let i = Str.search_backward (Str.regexp_string "coqide") prog pos in String.blit "coqtop" 0 prog i 6; - if Sys.file_exists prog then prog else "coqtop" + if Sys.file_exists prog then prog + else + let in_macos_bundle = + Filename.concat + (Filename.dirname prog) + (Filename.concat "../Resources/bin" (Filename.basename prog)) + in if Sys.file_exists in_macos_bundle then in_macos_bundle + else "coqtop" with Not_found -> "coqtop" in file diff --git a/ide/preferences.ml b/ide/preferences.ml index 25712f951b..9a4fde2f6e 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -144,6 +144,7 @@ type pref = mutable processing_color : string; mutable processed_color : string; mutable error_color : string; + mutable error_fg_color : string; mutable dynamic_word_wrap : bool; mutable show_line_number : bool; @@ -220,10 +221,11 @@ let current = { vertical_tabs = false; opposite_tabs = false; - background_color = "cornsilk"; - processed_color = "light green"; - processing_color = "light blue"; - error_color = "#FFCCCC"; + background_color = Tags.default_color; + processed_color = Tags.default_processed_color; + processing_color = Tags.default_processing_color; + error_color = Tags.default_error_color; + error_fg_color = Tags.default_error_fg_color; dynamic_word_wrap = false; show_line_number = false; @@ -296,6 +298,7 @@ let save_pref () = add "processing_color" [p.processing_color] ++ add "processed_color" [p.processed_color] ++ add "error_color" [p.error_color] ++ + add "error_fg_color" [p.error_fg_color] ++ add "dynamic_word_wrap" [string_of_bool p.dynamic_word_wrap] ++ add "show_line_number" [string_of_bool p.show_line_number] ++ add "auto_indent" [string_of_bool p.auto_indent] ++ @@ -382,6 +385,7 @@ let load_pref () = set_hd "processing_color" (fun v -> np.processing_color <- v); set_hd "processed_color" (fun v -> np.processed_color <- v); set_hd "error_color" (fun v -> np.error_color <- v); + set_hd "error_fg_color" (fun v -> np.error_fg_color <- v); set_bool "dynamic_word_wrap" (fun v -> np.dynamic_word_wrap <- v); set_bool "show_line_number" (fun v -> np.show_line_number <- v); set_bool "auto_indent" (fun v -> np.auto_indent <- v); @@ -466,10 +470,15 @@ let configure ?(apply=(fun () -> ())) () = ~text:"Background color of errors" ~packing:(table#attach ~expand:`X ~left:0 ~top:3) () in + let error_fg_label = GMisc.label + ~text:"Foreground color of errors" + ~packing:(table#attach ~expand:`X ~left:0 ~top:4) () + in let () = background_label#set_xalign 0. in let () = processed_label#set_xalign 0. in let () = processing_label#set_xalign 0. in let () = error_label#set_xalign 0. in + let () = error_fg_label#set_xalign 0. in let background_button = GButton.color_button ~color:(Tags.color_of_string (current.background_color)) ~packing:(table#attach ~left:1 ~top:0) () @@ -486,15 +495,19 @@ let configure ?(apply=(fun () -> ())) () = ~color:(Tags.get_error_color ()) ~packing:(table#attach ~left:1 ~top:3) () in + let error_fg_button = GButton.color_button + ~color:(Tags.get_error_fg_color ()) + ~packing:(table#attach ~left:1 ~top:4) () + in let reset_button = GButton.button ~label:"Reset" ~packing:box#pack () in let reset_cb () = - background_button#set_color (Tags.color_of_string "cornsilk"); - processing_button#set_color (Tags.color_of_string "light blue"); - processed_button#set_color (Tags.color_of_string "light green"); - error_button#set_color (Tags.color_of_string "#FFCCCC"); + background_button#set_color Tags.(color_of_string default_color); + processing_button#set_color Tags.(color_of_string default_processing_color); + processed_button#set_color Tags.(color_of_string default_processed_color); + error_button#set_color Tags.(color_of_string default_error_color); in let _ = reset_button#connect#clicked ~callback:reset_cb in let label = "Color configuration" in @@ -503,7 +516,12 @@ let configure ?(apply=(fun () -> ())) () = current.processing_color <- Tags.string_of_color processing_button#color; current.processed_color <- Tags.string_of_color processed_button#color; current.error_color <- Tags.string_of_color error_button#color; - !refresh_editor_hook () + current.error_fg_color <- Tags.string_of_color error_fg_button#color; + !refresh_editor_hook (); + Tags.set_processing_color processing_button#color; + Tags.set_processed_color processed_button#color; + Tags.set_error_color error_button#color; + Tags.set_error_fg_color error_fg_button#color in custom ~label box callback true in diff --git a/ide/preferences.mli b/ide/preferences.mli index 1b52d20a4c..ab12e4c7ba 100644 --- a/ide/preferences.mli +++ b/ide/preferences.mli @@ -71,6 +71,7 @@ type pref = mutable processing_color : string; mutable processed_color : string; mutable error_color : string; + mutable error_fg_color : string; mutable dynamic_word_wrap : bool; mutable show_line_number : bool; diff --git a/ide/tags.ml b/ide/tags.ml index 04ad9a519c..079cf94853 100644 --- a/ide/tags.ml +++ b/ide/tags.ml @@ -13,15 +13,23 @@ let make_tag (tt:GText.tag_table) ~name prop = tt#add new_tag#as_tag; new_tag -let processed_color = ref "light green" -let processing_color = ref "light blue" -let error_color = ref "#FFCCCC" +(* These work fine for colorblind people too *) +let default_processed_color = "light green" +let default_processing_color = "light blue" +let default_error_color = "#FFCCCC" +let default_error_fg_color = "red" +let default_color = "cornsilk" + +let processed_color = ref default_processed_color +let processing_color = ref default_processing_color +let error_color = ref default_error_color +let error_fg_color = ref default_error_fg_color module Script = struct let table = GText.tag_table () let comment = make_tag table ~name:"comment" [] - let error = make_tag table ~name:"error" [`UNDERLINE `SINGLE ; `FOREGROUND "red"] + let error = make_tag table ~name:"error" [`UNDERLINE `SINGLE ; `FOREGROUND !error_fg_color] let error_bg = make_tag table ~name:"error_bg" [`BACKGROUND !error_color] let to_process = make_tag table ~name:"to_process" [`BACKGROUND !processing_color] let processed = make_tag table ~name:"processed" [`BACKGROUND !processed_color] @@ -94,3 +102,11 @@ let set_error_color clr = let s = string_of_color clr in error_color := s; Script.error_bg#set_property (`BACKGROUND s) + +let get_error_fg_color () = color_of_string !error_fg_color + +let set_error_fg_color clr = + let s = string_of_color clr in + error_fg_color := s; + Script.error#set_property (`FOREGROUND s) + diff --git a/ide/tags.mli b/ide/tags.mli index 9c3261d66d..e68015c991 100644 --- a/ide/tags.mli +++ b/ide/tags.mli @@ -53,3 +53,13 @@ val set_processing_color : Gdk.color -> unit val get_error_color : unit -> Gdk.color val set_error_color : Gdk.color -> unit + +val get_error_fg_color : unit -> Gdk.color +val set_error_fg_color : Gdk.color -> unit + +val default_processed_color : string +val default_processing_color : string +val default_error_color : string +val default_error_fg_color : string +val default_color : string + |
