aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2018-11-11 13:26:37 +0100
committerHugo Herbelin2018-11-11 15:44:10 +0100
commit35a11a5567d660e545ad39c03b9bef39c26380ba (patch)
tree61b24dbedb220be58369c1028e9c1e1a4f024a83
parent3ccc9a89de9a2d5b81dae82c7815ba077f998135 (diff)
CoqIDE: ensure that the configuration box is not hidden by the main window.
We do it by passing the name of the main window in the "parent" option. Formerly, the window could be hidden but nevertheless blocking any action on the main window. With the change, it can be moved aside, but never hidden by the main window. Tested on MacOS X.
-rw-r--r--ide/configwin.ml4
-rw-r--r--ide/configwin.mli1
-rw-r--r--ide/configwin_ihm.ml5
-rw-r--r--ide/configwin_ihm.mli1
-rw-r--r--ide/coqide.ml2
-rw-r--r--ide/preferences.ml4
-rw-r--r--ide/preferences.mli2
7 files changed, 11 insertions, 8 deletions
diff --git a/ide/configwin.ml b/ide/configwin.ml
index 69e8b647ae..24be721631 100644
--- a/ide/configwin.ml
+++ b/ide/configwin.ml
@@ -46,6 +46,6 @@ let modifiers = Configwin_ihm.modifiers
let edit
?(apply=(fun () -> ()))
- title ?width ?height
+ title ?parent ?width ?height
conf_struct_list =
- Configwin_ihm.edit ~with_apply: true ~apply title ?width ?height conf_struct_list
+ Configwin_ihm.edit ~with_apply: true ~apply title ?parent ?width ?height conf_struct_list
diff --git a/ide/configwin.mli b/ide/configwin.mli
index 7616e471db..0ee77d69b5 100644
--- a/ide/configwin.mli
+++ b/ide/configwin.mli
@@ -158,6 +158,7 @@ val custom : ?label: string -> GPack.box -> (unit -> unit) -> bool -> parameter_
val edit :
?apply: (unit -> unit) ->
string ->
+ ?parent:GWindow.window ->
?width:int ->
?height:int ->
configuration_structure list ->
diff --git a/ide/configwin_ihm.ml b/ide/configwin_ihm.ml
index d16efa603d..a6a3d52a38 100644
--- a/ide/configwin_ihm.ml
+++ b/ide/configwin_ihm.ml
@@ -662,12 +662,13 @@ class configuration_box (tt : GData.tooltips) conf_struct =
to configure the various parameters. *)
let edit ?(with_apply=true)
?(apply=(fun () -> ()))
- title ?width ?height
+ title ?parent ?width ?height
conf_struct =
let dialog = GWindow.dialog
~position:`CENTER
~modal: true ~title: title
- ?height ?width
+ ~type_hint:`DIALOG
+ ?parent ?height ?width
()
in
let tooltips = GData.tooltips () in
diff --git a/ide/configwin_ihm.mli b/ide/configwin_ihm.mli
index c867ad9127..94a3f12b39 100644
--- a/ide/configwin_ihm.mli
+++ b/ide/configwin_ihm.mli
@@ -60,6 +60,7 @@ val edit :
?with_apply:bool ->
?apply:(unit -> unit) ->
string ->
+ ?parent:GWindow.window ->
?width:int ->
?height:int ->
configuration_structure list ->
diff --git a/ide/coqide.ml b/ide/coqide.ml
index 60ba9b5351..933ae322c7 100644
--- a/ide/coqide.ml
+++ b/ide/coqide.ml
@@ -1009,7 +1009,7 @@ let build_ui () =
item "Preferences" ~accel:"<Ctrl>comma" ~stock:`PREFERENCES
~callback:(fun _ ->
begin
- try Preferences.configure ~apply:refresh_notebook_pos ()
+ try Preferences.configure ~apply:refresh_notebook_pos w
with _ -> flash_info "Cannot save preferences"
end;
reset_revert_timer ());
diff --git a/ide/preferences.ml b/ide/preferences.ml
index 6dc922c225..045d650c1c 100644
--- a/ide/preferences.ml
+++ b/ide/preferences.ml
@@ -688,7 +688,7 @@ let pmodifiers ?(all = false) name p = modifiers
name
(str_to_mod_list p#get)
-let configure ?(apply=(fun () -> ())) () =
+let configure ?(apply=(fun () -> ())) parent =
let cmd_coqtop =
string
~f:(fun s -> cmd_coqtop#set (if s = "AUTO" then None else Some s))
@@ -1068,7 +1068,7 @@ let configure ?(apply=(fun () -> ())) () =
(*
Format.printf "before edit: current.text_font = %s@." (Pango.Font.to_string current.text_font);
*)
- let x = edit ~apply "Customizations" cmds in
+ let x = edit ~apply "Customizations" ~parent cmds in
(*
Format.printf "after edit: current.text_font = %s@." (Pango.Font.to_string current.text_font);
*)
diff --git a/ide/preferences.mli b/ide/preferences.mli
index dd2976efc2..7ed6a40bdb 100644
--- a/ide/preferences.mli
+++ b/ide/preferences.mli
@@ -107,7 +107,7 @@ val diffs : string preference
val save_pref : unit -> unit
val load_pref : unit -> unit
-val configure : ?apply:(unit -> unit) -> unit -> unit
+val configure : ?apply:(unit -> unit) -> GWindow.window -> unit
val stick : 'a preference ->
(#GObj.widget as 'obj) -> ('a -> unit) -> unit