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 | |
| 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
| -rw-r--r-- | ide/preferences.ml | 14 | ||||
| -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 |
5 files changed, 29 insertions, 20 deletions
diff --git a/ide/preferences.ml b/ide/preferences.ml index 8d7723bb07..3f2c69acd2 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -586,30 +586,30 @@ let configure ?(apply=(fun () -> ())) () = (* ATTENTION !!!!! L'onglet Fonts doit etre en premier pour eviter un bug !!!! (shame on Benjamin) *) let cmds = - [Section("Fonts", + [Section("Fonts", Some `SELECT_FONT, [config_font]); - Section("Files", + Section("Files", Some `DIRECTORY, [global_auto_revert;global_auto_revert_delay; auto_save; auto_save_delay; (* auto_save_name*) encodings; ]); - Section("Project", + Section("Project", Some (`STOCK "gtk-page-setup"), [project_file_name;read_project; ]); (* Section("Appearance", config_appearance); *) - Section("Externals", + Section("Externals", None, [cmd_coqc;cmd_make;cmd_coqmakefile; cmd_coqdoc; cmd_print; cmd_editor; cmd_browse;doc_url;library_url]); - Section("Tactics Wizard", + Section("Tactics Wizard", None, [automatic_tactics]); - Section("Shortcuts", + Section("Shortcuts", Some `PREFERENCES, [modifiers_valid; modifier_for_tactics; modifier_for_templates; modifier_for_display; modifier_for_navigation]); - Section("Misc", + Section("Misc", Some `ADD, misc)] in (* 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. *) |
