| 635 | } |
| 636 | |
| 637 | void MeasureDock::update_dist() |
| 638 | { |
| 639 | auto &cursor_list = _view.get_cursorList(); |
| 640 | |
| 641 | QColor bkColor = AppConfig::Instance().GetStyleColor(); |
| 642 | |
| 643 | auto mode_rows = get_mode_rows(); |
| 644 | |
| 645 | for (auto &inf : mode_rows->_dist_row_list) |
| 646 | { |
| 647 | if (inf.start_bt == NULL) |
| 648 | break; |
| 649 | |
| 650 | if (inf.cursor1 != -1) { |
| 651 | if (inf.cursor1 > (int)cursor_list.size()) { |
| 652 | inf.start_bt->setText(""); |
| 653 | inf.cursor1 = -1; |
| 654 | } |
| 655 | } |
| 656 | set_cursor_btn_color(inf.start_bt); |
| 657 | |
| 658 | if (inf.cursor2 != -1) { |
| 659 | if (inf.cursor2 > (int)cursor_list.size()) { |
| 660 | inf.end_bt->setText(""); |
| 661 | inf.cursor2 = -1; |
| 662 | } |
| 663 | } |
| 664 | set_cursor_btn_color(inf.end_bt); |
| 665 | |
| 666 | if (inf.cursor1 != -1 && inf.cursor2 != -1) { |
| 667 | int64_t delta = _view.get_cursor_samples(inf.cursor1-1) - |
| 668 | _view.get_cursor_samples(inf.cursor2-1); |
| 669 | QString delta_text = _view.get_cm_delta(inf.cursor1-1, inf.cursor2-1) + |
| 670 | "/" + QString::number(delta); |
| 671 | if (delta < 0) |
| 672 | delta_text.replace('+', '-'); |
| 673 | inf.r_label->setText(delta_text); |
| 674 | } |
| 675 | else { |
| 676 | inf.r_label->setText(" "); |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | void MeasureDock::update_edge() |
| 682 | { |
nothing calls this directly
no test coverage detected