Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 30e63b57 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

enlarge/reduce font with Ctrl + or -

parent ac08b166
...@@ -887,8 +887,47 @@ let exit_function ?(destroy=false) () = ...@@ -887,8 +887,47 @@ let exit_function ?(destroy=false) () =
(* View menu *) (* View menu *)
(*************) (*************)
let modifiable_font_views = ref [goals_view#misc]
let font_family = "Monospace"
let font_size = ref 10
let change_font () =
(*
Tools.resize_images (!Colors.font_size * 2 - 4);
*)
let f =
Pango.Font.from_string (font_family ^ " " ^ string_of_int !font_size)
in
List.iter (fun v -> v#modify_font f) !modifiable_font_views
let enlarge_font () =
incr font_size;
change_font ();
(*
GConfig.save ()
*)
()
let reduce_font () =
decr font_size;
change_font ();
(*
GConfig.save ()
*)
()
let view_menu = factory#add_submenu "_View" let view_menu = factory#add_submenu "_View"
let view_factory = new GMenu.factory view_menu ~accel_group let view_factory = new GMenu.factory view_menu ~accel_group
let (_ : GMenu.menu_item) =
view_factory#add_item ~key:GdkKeysyms._plus
~callback:enlarge_font "Enlarge font"
let (_ : GMenu.menu_item) =
view_factory#add_item ~key:GdkKeysyms._minus
~callback:reduce_font "Reduce font"
let (_ : GMenu.image_menu_item) = let (_ : GMenu.image_menu_item) =
view_factory#add_image_item ~key:GdkKeysyms._E view_factory#add_image_item ~key:GdkKeysyms._E
~label:"Expand all" ~callback:(fun () -> goals_view#expand_all ()) () ~label:"Expand all" ~callback:(fun () -> goals_view#expand_all ()) ()
...@@ -1152,6 +1191,7 @@ let task_view = ...@@ -1152,6 +1191,7 @@ let task_view =
~height:gconfig.task_height ~height:gconfig.task_height
() ()
let () = modifiable_font_views := task_view#misc :: !modifiable_font_views
let () = task_view#source_buffer#set_language why_lang let () = task_view#source_buffer#set_language why_lang
let () = task_view#set_highlight_current_line true let () = task_view#set_highlight_current_line true
...@@ -1180,6 +1220,7 @@ let source_view = ...@@ -1180,6 +1220,7 @@ let source_view =
(* (*
source_view#misc#modify_font_by_name font_name; source_view#misc#modify_font_by_name font_name;
*) *)
let () = modifiable_font_views := source_view#misc :: !modifiable_font_views
let () = source_view#source_buffer#set_language None let () = source_view#source_buffer#set_language None
let () = source_view#set_highlight_current_line true let () = source_view#set_highlight_current_line true
(* (*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment