Commit ca605554 authored by Bruno Guillaume's avatar Bruno Guillaume

Fix graph display (remove event box)

parent cc297ce7
......@@ -1042,26 +1042,14 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkScrolledWindow" id="graph_top">
<widget class="GtkScrolledWindow" id="graph_view_top">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkViewport" id="viewport12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkEventBox" id="graph_view_top">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
<placeholder/>
</child>
</widget>
</child>
......@@ -1164,26 +1152,14 @@
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="graph_bottom">
<widget class="GtkScrolledWindow" id="graph_view_bottom">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkViewport" id="viewport11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkEventBox" id="graph_view_bottom">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
<placeholder/>
</child>
</widget>
<packing>
......
......@@ -841,28 +841,28 @@ let init () =
let cpt = ref 0 in
let _ = GMain.Timeout.add ~ms:50 ~callback:(fun () -> cpt := 0; true) in
let _ = grew_window#graph_bottom#hadjustment#connect#value_changed
let _ = grew_window#graph_view_bottom#hadjustment#connect#value_changed
~callback:
(fun () ->
if (!cpt<1 && grew_window#synchronize#active)
then
begin
let percent = ((grew_window#graph_bottom#hadjustment#value +. (grew_window#graph_bottom#hadjustment#page_size /. 2.)) /. grew_window#graph_bottom#hadjustment#upper) in
let value = percent *. grew_window#graph_top#hadjustment#upper -. (grew_window#graph_top#hadjustment#page_size /. 2.) in
let percent = ((grew_window#graph_view_bottom#hadjustment#value +. (grew_window#graph_view_bottom#hadjustment#page_size /. 2.)) /. grew_window#graph_view_bottom#hadjustment#upper) in
let value = percent *. grew_window#graph_view_top#hadjustment#upper -. (grew_window#graph_view_top#hadjustment#page_size /. 2.) in
incr cpt;
grew_window#graph_top#hadjustment#set_value value;
grew_window#graph_view_top#hadjustment#set_value value;
end
) in
let _ = grew_window#graph_top#hadjustment#connect#value_changed
let _ = grew_window#graph_view_top#hadjustment#connect#value_changed
~callback:
(fun () ->
if (!cpt<1 && grew_window#synchronize#active)
then
(let percent = ((grew_window#graph_top#hadjustment#value +. (grew_window#graph_top#hadjustment#page_size /. 2.)) /. grew_window#graph_top#hadjustment#upper) in
let value = percent *. grew_window#graph_bottom#hadjustment#upper -. (grew_window#graph_bottom#hadjustment#page_size /. 2.) in
(let percent = ((grew_window#graph_view_top#hadjustment#value +. (grew_window#graph_view_top#hadjustment#page_size /. 2.)) /. grew_window#graph_view_top#hadjustment#upper) in
let value = percent *. grew_window#graph_view_bottom#hadjustment#upper -. (grew_window#graph_view_bottom#hadjustment#page_size /. 2.) in
incr cpt;
grew_window#graph_bottom#hadjustment#set_value value;
grew_window#graph_view_bottom#hadjustment#set_value value;
)
) in
......@@ -946,10 +946,10 @@ let init () =
end in
(* Listen to right click in graph view *)
let _ = grew_window#graph_view_top#event#add [`BUTTON_PRESS] in
let _ = grew_window#graph_view_top#event#connect#button_press ~callback: (contextual_menu Top) in
let _ = grew_window#graph_view_bottom#event#add [`BUTTON_PRESS] in
let _ = grew_window#graph_view_bottom#event#connect#button_press ~callback: (contextual_menu Bottom) in
(* let _ = grew_window#graph_view_top#event#add [`BUTTON_PRESS] in
let _ = grew_window#graph_view_top#event#connect#button_press ~callback: (contextual_menu Top) in *)
(* let _ = grew_window#graph_view_bottom#event#add [`BUTTON_PRESS] in
let _ = grew_window#graph_view_bottom#event#connect#button_press ~callback: (contextual_menu Bottom) in *)
(* Really start the gui *)
grew_window#check_widgets ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment