aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2018-11-19 16:00:53 +0100
committerVincent Laporte2019-03-19 08:40:19 +0000
commitd0054c9d632e13b631697523239af27d3f7ae7b4 (patch)
tree4504dc1eaeca72f21d7708c385980d8680fc3b84
parent153b68664adb03dde1325bdb77fa371d5aa8ff7e (diff)
CoqIDE: Replacing deprecated color_of_string with color_parse.
-rw-r--r--ide/preferences.ml10
-rw-r--r--ide/tags.ml10
-rw-r--r--ide/tags.mli3
-rw-r--r--ide/wg_Command.ml2
4 files changed, 6 insertions, 19 deletions
diff --git a/ide/preferences.ml b/ide/preferences.ml
index ee274b7001..11e27c3570 100644
--- a/ide/preferences.ml
+++ b/ide/preferences.ml
@@ -575,7 +575,7 @@ object (self)
| None -> set#set_active true
| Some c ->
set#set_active false;
- but#set_color (Tags.color_of_string c)
+ but#set_color (Gdk.Color.color_parse c)
in
track tag.tag_bg_color bg_color bg_unset;
track tag.tag_fg_color fg_color fg_unset;
@@ -587,7 +587,7 @@ object (self)
method tag =
let get but set =
if set#active then None
- else Some (Tags.string_of_color but#color)
+ else Some (Gdk.Color.color_to_string but#color)
in
{
tag_bg_color = get bg_color bg_unset;
@@ -707,15 +707,15 @@ let configure ?(apply=(fun () -> ())) parent =
in
let () = label#set_xalign 0. in
let button = GButton.color_button
- ~color:(Tags.color_of_string pref#get)
+ ~color:(Gdk.Color.color_parse pref#get)
~packing:(table#attach ~left:1 ~top:i) ()
in
let _ = button#connect#color_set ~callback:begin fun () ->
- pref#set (Tags.string_of_color button#color)
+ pref#set (Gdk.Color.color_to_string button#color)
end in
let reset _ =
pref#reset ();
- button#set_color Tags.(color_of_string pref#get)
+ button#set_color (Gdk.Color.color_parse pref#get)
in
let _ = reset_button#connect#clicked ~callback:reset in
()
diff --git a/ide/tags.ml b/ide/tags.ml
index e919a64278..e9dbcb9e67 100644
--- a/ide/tags.ml
+++ b/ide/tags.ml
@@ -48,13 +48,3 @@ struct
let warning = make_tag table ~name:"warning" [`FOREGROUND "orange"]
let item = make_tag table ~name:"item" [`WEIGHT `BOLD]
end
-
-let string_of_color clr =
- let r = Gdk.Color.red clr in
- let g = Gdk.Color.green clr in
- let b = Gdk.Color.blue clr in
- Printf.sprintf "#%04X%04X%04X" r g b
-
-let color_of_string s =
- let colormap = Gdk.Color.get_system_colormap () in
- Gdk.Color.alloc ~colormap (`NAME s)
diff --git a/ide/tags.mli b/ide/tags.mli
index 3194f87971..1df934fddf 100644
--- a/ide/tags.mli
+++ b/ide/tags.mli
@@ -41,6 +41,3 @@ sig
val warning : GText.tag
val item : GText.tag
end
-
-val string_of_color : Gdk.color -> string
-val color_of_string : string -> Gdk.color
diff --git a/ide/wg_Command.ml b/ide/wg_Command.ml
index 06281d6287..57e467f5dd 100644
--- a/ide/wg_Command.ml
+++ b/ide/wg_Command.ml
@@ -163,7 +163,7 @@ object(self)
frame#visible
method private refresh_color clr =
- let clr = Tags.color_of_string clr in
+ let clr = Gdk.Color.color_parse clr in
let iter (_,view,_) = view#misc#modify_base [`NORMAL, `COLOR clr] in
List.iter iter views