diff options
| author | pboutill | 2011-10-25 10:25:15 +0000 |
|---|---|---|
| committer | pboutill | 2011-10-25 10:25:15 +0000 |
| commit | 3d15fc36309eb9bd6bef72ebac260b78b11e23f3 (patch) | |
| tree | 75deaa023767d350dc575abdfd2a417cd80886fb /ide/utils | |
| parent | f3d29cafda385f23e191f210565d2798467be0e3 (diff) | |
Icons in CoqIdE preference panel
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14590 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'ide/utils')
| -rw-r--r-- | ide/utils/configwin.ml | 4 | ||||
| -rw-r--r-- | ide/utils/configwin.mli | 8 | ||||
| -rw-r--r-- | ide/utils/configwin_ihm.ml | 19 | ||||
| -rw-r--r-- | ide/utils/configwin_types.ml | 4 |
4 files changed, 22 insertions, 13 deletions
diff --git a/ide/utils/configwin.ml b/ide/utils/configwin.ml index 05bf54eb17..3ff607991e 100644 --- a/ide/utils/configwin.ml +++ b/ide/utils/configwin.ml @@ -27,8 +27,8 @@ type parameter_kind = Configwin_types.parameter_kind type configuration_structure = Configwin_types.configuration_structure = - Section of string * parameter_kind list - | Section_list of string * configuration_structure list + Section of string * GtkStock.id option * parameter_kind list + | Section_list of string * GtkStock.id option * configuration_structure list type return_button = Configwin_types.return_button = diff --git a/ide/utils/configwin.mli b/ide/utils/configwin.mli index bbfb7a0425..c5fbf39a01 100644 --- a/ide/utils/configwin.mli +++ b/ide/utils/configwin.mli @@ -32,10 +32,10 @@ type parameter_kind;; (** This type represents the structure of the configuration window. *) type configuration_structure = - | Section of string * parameter_kind list - (** label of the section, parameters *) - | Section_list of string * configuration_structure list - (** label of the section, list of the sub sections *) + | Section of string * GtkStock.id option * parameter_kind list + (** label of the section, icon, parameters *) + | Section_list of string * GtkStock.id option * configuration_structure list + (** label of the section, icon, list of the sub sections *) ;; (** To indicate what button pushed the user when the window is closed. *) diff --git a/ide/utils/configwin_ihm.ml b/ide/utils/configwin_ihm.ml index 5290b4456c..fbfa887fbd 100644 --- a/ide/utils/configwin_ihm.ml +++ b/ide/utils/configwin_ihm.ml @@ -928,6 +928,7 @@ class configuration_box (tt : GData.tooltips) conf_struct = let main_box = GPack.hbox () in let columns = new GTree.column_list in + let icon_col = columns#add GtkStock.conv in let label_col = columns#add Gobject.Data.string in let box_col = columns#add Gobject.Data.caml in let () = columns#lock () in @@ -943,6 +944,10 @@ class configuration_box (tt : GData.tooltips) conf_struct = let menu_box = GPack.vbox ~packing:pane#pack2 () in + let renderer = (GTree.cell_renderer_pixbuf [], ["stock-id", icon_col]) in + let col = GTree.view_column ~renderer () in + let _ = view#append_column col in + let renderer = (GTree.cell_renderer_text [], ["text", label_col]) in let col = GTree.view_column ~renderer () in let _ = view#append_column col in @@ -1010,16 +1015,20 @@ class configuration_box (tt : GData.tooltips) conf_struct = | None -> tree#append () | Some parent -> tree#append ~parent () in - let (label, apply) = match conf_struct with - | Section (label, param_list) -> + let (label, icon, apply) = match conf_struct with + | Section (label, icon, param_list) -> let params = List.map (make_param box) param_list in let apply () = List.iter (fun param -> param#apply) params in - (label, apply) - | Section_list (label, struct_list) -> + (label, icon, apply) + | Section_list (label, icon, struct_list) -> let apply () = () in - (label, apply) + (label, icon, apply) in let () = tree#set new_iter label_col label in + let () = match icon with + | None -> () + | Some icon -> tree#set new_iter icon_col icon + in let () = tree#set new_iter box_col box in apply in diff --git a/ide/utils/configwin_types.ml b/ide/utils/configwin_types.ml index 90d5756b8f..5e2b1e7c2e 100644 --- a/ide/utils/configwin_types.ml +++ b/ide/utils/configwin_types.ml @@ -263,8 +263,8 @@ type parameter_kind = (** This type represents the structure of the configuration window. *) type configuration_structure = - | Section of string * parameter_kind list (** label of the section, parameters *) - | Section_list of string * configuration_structure list (** label of the section, list of the sub sections *) + | Section of string * GtkStock.id option * parameter_kind list (** label of the section, icon, parameters *) + | Section_list of string * GtkStock.id option * configuration_structure list (** label of the section, list of the sub sections *) ;; (** To indicate what button was pushed by the user when the window is closed. *) |
