Commit 352a03bc authored by MARCHE Claude's avatar MARCHE Claude
Browse files

saved height and width in IDE config file

parent 51d8e8a1
...@@ -6,12 +6,14 @@ type t = ...@@ -6,12 +6,14 @@ type t =
{ mutable window_width : int; { mutable window_width : int;
mutable window_height : int; mutable window_height : int;
mutable tree_width : int; mutable tree_width : int;
mutable task_height : int;
} }
let default = let default =
{ window_width = 1024; { window_width = 1024;
window_height = 768; window_height = 768;
tree_width = 512; tree_width = 512;
task_height = 384;
} }
let conf_file = Filename.concat (Rc.get_home_dir ()) ".whyide.conf" let conf_file = Filename.concat (Rc.get_home_dir ()) ".whyide.conf"
...@@ -23,6 +25,7 @@ let save_config config = ...@@ -23,6 +25,7 @@ let save_config config =
fprintf fmt "width = %d@\n" config.window_width; fprintf fmt "width = %d@\n" config.window_width;
fprintf fmt "height = %d@\n" config.window_height; fprintf fmt "height = %d@\n" config.window_height;
fprintf fmt "tree_width = %d@\n" config.tree_width; fprintf fmt "tree_width = %d@\n" config.tree_width;
fprintf fmt "task_height = %d@\n" config.task_height;
fprintf fmt "@."; fprintf fmt "@.";
close_out ch close_out ch
...@@ -31,6 +34,7 @@ let load_main c (key, value) = ...@@ -31,6 +34,7 @@ let load_main c (key, value) =
| "width" -> c.window_width <- Rc.int value | "width" -> c.window_width <- Rc.int value
| "height" -> c.window_height <- Rc.int value | "height" -> c.window_height <- Rc.int value
| "tree_width" -> c.tree_width <- Rc.int value | "tree_width" -> c.tree_width <- Rc.int value
| "task_height" -> c.task_height <- Rc.int value
| s -> | s ->
eprintf "Warning: ignore unknown key [%s] in whyide config file@." s eprintf "Warning: ignore unknown key [%s] in whyide config file@." s
......
...@@ -4,6 +4,7 @@ type t = ...@@ -4,6 +4,7 @@ type t =
{ mutable window_width : int; { mutable window_width : int;
mutable window_height : int; mutable window_height : int;
mutable tree_width : int; mutable tree_width : int;
mutable task_height : int;
} }
val read_config : unit -> t val read_config : unit -> t
......
...@@ -410,6 +410,11 @@ let scrollview = ...@@ -410,6 +410,11 @@ let scrollview =
~packing:hp#add () ~packing:hp#add ()
let () = scrollview#set_shadow_type `ETCHED_OUT let () = scrollview#set_shadow_type `ETCHED_OUT
let (_ : GtkSignal.id) =
scrollview#misc#connect#size_allocate
~callback:
(fun {Gtk.width=w;Gtk.height=_h} ->
gconfig.Gconfig.tree_width <- w)
let goals_model,filter_model,goals_view = Model.create ~packing:scrollview#add () let goals_model,filter_model,goals_view = Model.create ~packing:scrollview#add ()
...@@ -806,11 +811,18 @@ let scrolled_task_view = GBin.scrolled_window ...@@ -806,11 +811,18 @@ let scrolled_task_view = GBin.scrolled_window
~hpolicy: `AUTOMATIC ~vpolicy: `AUTOMATIC ~hpolicy: `AUTOMATIC ~vpolicy: `AUTOMATIC
~packing:vp#add () ~packing:vp#add ()
let (_ : GtkSignal.id) =
scrolled_task_view#misc#connect#size_allocate
~callback:
(fun {Gtk.width=_w;Gtk.height=h} ->
gconfig.Gconfig.task_height <- h)
let task_view = let task_view =
GSourceView2.source_view GSourceView2.source_view
~editable:false ~editable:false
~show_line_numbers:true ~show_line_numbers:true
~packing:scrolled_task_view#add ~height:500 ~width:650 ~packing:scrolled_task_view#add
~height:gconfig.Gconfig.task_height
() ()
let () = task_view#source_buffer#set_language lang let () = task_view#source_buffer#set_language lang
...@@ -863,7 +875,8 @@ let source_view = ...@@ -863,7 +875,8 @@ let source_view =
~show_line_numbers:true ~show_line_numbers:true
~right_margin_position:80 ~show_right_margin:true ~right_margin_position:80 ~show_right_margin:true
(* ~smart_home_end:true *) (* ~smart_home_end:true *)
~packing:scrolled_source_view#add ~height:500 ~width:650 ~packing:scrolled_source_view#add
(* ~height:500 ~width:650 *)
() ()
(* (*
......
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