From: Andrea Asperti Date: Tue, 5 Oct 2010 14:58:25 +0000 (+0000) Subject: Font resizing and syntax highlighting re-activated for the browser and X-Git-Tag: make_still_working~2808 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=f03ff6e69b44a4e89b92b21251cce9d247c4a4e4;p=helm.git Font resizing and syntax highlighting re-activated for the browser and sequent windows. --- diff --git a/matita/matita/matitaGtkMisc.ml b/matita/matita/matitaGtkMisc.ml index 772f17a41..23b427c5a 100644 --- a/matita/matita/matitaGtkMisc.ml +++ b/matita/matita/matitaGtkMisc.ml @@ -420,4 +420,16 @@ let escape_pango_markup text = text ;; - +let matita_lang = + let source_language_manager = + GSourceView2.source_language_manager ~default:true in + source_language_manager#set_search_path + (BuildTimeConf.runtime_base_dir :: + source_language_manager#search_path); + match source_language_manager#language "grafite" with + | None -> + HLog.error(sprintf "can't load a language file for \"grafite\" in %s" + BuildTimeConf.runtime_base_dir); + assert false + | Some x -> x +;; diff --git a/matita/matita/matitaGtkMisc.mli b/matita/matita/matitaGtkMisc.mli index adea6961d..6c10ba664 100644 --- a/matita/matita/matitaGtkMisc.mli +++ b/matita/matita/matitaGtkMisc.mli @@ -152,3 +152,5 @@ val utf8_parsed_text: string -> Stdpp.location -> string * int val utf8_string_length: string -> int val escape_pango_markup: string -> string + +val matita_lang: GSourceView2.source_language diff --git a/matita/matita/matitaGui.ml b/matita/matita/matitaGui.ml index 59f5c687f..417a758b7 100644 --- a/matita/matita/matitaGui.ml +++ b/matita/matita/matitaGui.ml @@ -887,18 +887,8 @@ class gui () = else raise exn); (* script *) let _ = - let source_language_manager = - GSourceView2.source_language_manager ~default:true in - source_language_manager#set_search_path - (BuildTimeConf.runtime_base_dir :: - source_language_manager#search_path); - match source_language_manager#language "grafite" with - | None -> - HLog.warn(sprintf "can't load a language file for \"grafite\" in %s" - BuildTimeConf.runtime_base_dir) - | Some x as matita_lang -> - source_buffer#set_language matita_lang; - source_buffer#set_highlight_syntax true + source_buffer#set_language (Some MatitaGtkMisc.matita_lang); + source_buffer#set_highlight_syntax true in let disableSave () = (s())#assignFileName None; diff --git a/matita/matita/matitaMathView.ml b/matita/matita/matitaMathView.ml index 770d2a83a..3f538ac45 100644 --- a/matita/matita/matitaMathView.ml +++ b/matita/matita/matitaMathView.ml @@ -183,7 +183,9 @@ object (self) method has_selection = (assert false : bool) method strings_of_selection = (assert false : (paste_kind * string) list) - method update_font_size = (assert false : unit) + method update_font_size = + self#misc#modify_font_by_name + (sprintf "%s %d" BuildTimeConf.script_font !current_font_size) method set_href_callback = (function _ -> () : (string -> unit) option -> unit) method private set_cic_info = (function _ -> () : (Cic.conjecture option * (Cic.id, Cic.term) Hashtbl.t * (Cic.id, Cic.hypothesis) Hashtbl.t * @@ -200,6 +202,11 @@ object (self) self#misc#modify_font_by_name (sprintf "%s %d" BuildTimeConf.script_font font_size) + initializer + self#set_font_size !current_font_size; + self#source_buffer#set_language (Some MatitaGtkMisc.matita_lang); + self#source_buffer#set_highlight_syntax true + (* MATITA1.0 inherit GMathViewAux.multi_selection_math_view obj