(* Force a repaint of the drawing area. *)
let drawing_area_repaint () =
- debug "drawing_area_repaint\n%!";
GtkBase.Widget.queue_draw da#as_widget
in
kill_tooltip ()
| Some (colour, pkg, total, increm) ->
(* Update 'current' which points to the currently moused package. *)
- set_current (Some (StringMap.find pkg.nevra depsmap));
+ let dep = StringMap.find pkg.nevra depsmap in
+ set_current (Some dep);
+
+ let deps_of_string deps =
+ String.concat "\n "
+ (List.sort (List.map (fun d -> d.pkg.nevra) deps))
+ in
(* The only way to make the tooltip follow the mouse is to
* kill the whole tooltips object and recreate it each time ...
*)
kill_tooltip ();
let tt = GData.tooltips ~delay:100 () in
- (* Tooltip text is the same as txt1. *)
+ (* Tooltip text is the same as txt1 + extra. *)
let text = sprintf "%s
Package: %.1f%% %s (%Ld bytes)
Incremental: %.1f%% %s (%Ld bytes)
Total: %.1f%% %s (%Ld bytes)" pkg.nevra
(display_percent pkg.size top_total) (display_size pkg.size) pkg.size
-(display_percent increm top_total) (display_size increm) increm
-(display_percent total top_total) (display_size total) total in
+ (display_percent increm top_total) (display_size increm) increm
+ (display_percent total top_total) (display_size total) total in
+ let text = if dep.parents = [] then text else text ^ sprintf "
+Required by:
+ %s"
+ (deps_of_string dep.parents) in
+ let text = if dep.children = [] then text else text ^ sprintf "
+Requires:
+ %s"
+ (deps_of_string dep.children) in
tt#set_tip ~text (da :> GObj.widget);
tt#enable ();
tooltips := Some tt