diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-02-22 10:22:40 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-22 10:22:40 -0500 |
commit | 855f4eeaa3dd370145c737ad8303c5b5abc029ea (patch) | |
tree | da8f5c50da53150d3b587e3e83cb2a4bd713b97e | |
parent | 0c4b06bd4bd6d86f42186fec1e423c8e80e33964 (diff) |
trace-graph: Set marker A with just clicking mouse
Make the click without moving the mouse set Marker A.
The click with shift sets Marker B.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-graph.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/trace-graph.c b/trace-graph.c index c99d167..6ed7851 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -777,11 +777,14 @@ static void button_press(struct graph_info *ginfo, gint x, guint state) | |||
777 | ginfo->line_time = convert_x_to_time(ginfo, x); | 777 | ginfo->line_time = convert_x_to_time(ginfo, x); |
778 | 778 | ||
779 | if (state & GDK_SHIFT_MASK) { | 779 | if (state & GDK_SHIFT_MASK) { |
780 | ginfo->show_marka = FALSE; | ||
781 | ginfo->show_markb = FALSE; | 780 | ginfo->show_markb = FALSE; |
782 | clear_line(ginfo, convert_time_to_x(ginfo, ginfo->marka_time)); | ||
783 | clear_line(ginfo, convert_time_to_x(ginfo, ginfo->markb_time)); | 781 | clear_line(ginfo, convert_time_to_x(ginfo, ginfo->markb_time)); |
784 | update_marka(ginfo, x); | 782 | /* We only update A if it hasn't been made yet */ |
783 | if (!ginfo->marka_time) { | ||
784 | ginfo->show_marka = FALSE; | ||
785 | clear_line(ginfo, convert_time_to_x(ginfo, ginfo->marka_time)); | ||
786 | update_marka(ginfo, x); | ||
787 | } | ||
785 | } else | 788 | } else |
786 | ginfo->zoom = TRUE; | 789 | ginfo->zoom = TRUE; |
787 | 790 | ||
@@ -1488,6 +1491,7 @@ static void activate_zoom(struct graph_info *ginfo, gint x) | |||
1488 | 1491 | ||
1489 | static void button_release(struct graph_info *ginfo, gint x) | 1492 | static void button_release(struct graph_info *ginfo, gint x) |
1490 | { | 1493 | { |
1494 | gint old_x; | ||
1491 | 1495 | ||
1492 | if (!ginfo->line_active) | 1496 | if (!ginfo->line_active) |
1493 | return; | 1497 | return; |
@@ -1504,6 +1508,18 @@ static void button_release(struct graph_info *ginfo, gint x) | |||
1504 | 1508 | ||
1505 | clear_info_box(ginfo); | 1509 | clear_info_box(ginfo); |
1506 | 1510 | ||
1511 | /* If button is released at same location, set A (without shift) */ | ||
1512 | if (ginfo->zoom && | ||
1513 | x >= ginfo->press_x-1 && x <= ginfo->press_x+1) { | ||
1514 | old_x = convert_time_to_x(ginfo, ginfo->marka_time); | ||
1515 | ginfo->show_marka = TRUE; | ||
1516 | update_marka(ginfo, x); | ||
1517 | clear_line(ginfo, old_x); | ||
1518 | if (ginfo->markb_time) | ||
1519 | update_label_time(ginfo->delta_label, | ||
1520 | ginfo->markb_time - ginfo->marka_time); | ||
1521 | } | ||
1522 | |||
1507 | activate_zoom(ginfo, x); | 1523 | activate_zoom(ginfo, x); |
1508 | } | 1524 | } |
1509 | 1525 | ||