| 869 | } |
| 870 | |
| 871 | void DsoSignal::paint_fore(QPainter &p, int left, int right, QColor fore, QColor back) |
| 872 | { |
| 873 | if (!_show) |
| 874 | return; |
| 875 | |
| 876 | assert(_view); |
| 877 | |
| 878 | fore.setAlpha(View::BackAlpha); |
| 879 | QPen pen(fore); |
| 880 | pen.setStyle(Qt::DotLine); |
| 881 | p.setPen(pen); |
| 882 | p.drawLine(left, get_zero_vpos(), right, get_zero_vpos()); |
| 883 | |
| 884 | fore.setAlpha(View::ForeAlpha); |
| 885 | if(enabled()) { |
| 886 | const QPointF mouse_point = _view->hover_point(); |
| 887 | const QRectF label_rect = get_trig_rect(left, right); |
| 888 | const bool hover = label_rect.contains(mouse_point); |
| 889 | |
| 890 | // Paint the trig line |
| 891 | const QPointF points[] = { |
| 892 | QPointF(right, ratio2pos(get_trig_vrate())), |
| 893 | label_rect.topLeft(), |
| 894 | label_rect.topRight(), |
| 895 | label_rect.bottomRight(), |
| 896 | label_rect.bottomLeft() |
| 897 | }; |
| 898 | |
| 899 | p.setPen(Qt::transparent); |
| 900 | p.setBrush(_colour); |
| 901 | p.drawPolygon(points, countof(points)); |
| 902 | |
| 903 | p.setPen(fore); |
| 904 | const QPointF arrow_points[] = { |
| 905 | QPoint(label_rect.left(), label_rect.center().y()), |
| 906 | QPoint(label_rect.left(), label_rect.center().y()-1), |
| 907 | QPoint(label_rect.left(), label_rect.center().y()+1), |
| 908 | QPoint(label_rect.left(), label_rect.center().y()-2), |
| 909 | QPoint(label_rect.left(), label_rect.center().y()+2), |
| 910 | QPoint(label_rect.left(), label_rect.center().y()-3), |
| 911 | QPoint(label_rect.left(), label_rect.center().y()+3), |
| 912 | QPoint(label_rect.left(), label_rect.center().y()-4), |
| 913 | QPoint(label_rect.left(), label_rect.center().y()+4), |
| 914 | QPoint(label_rect.left()-1, label_rect.center().y()-3), |
| 915 | QPoint(label_rect.left()-1, label_rect.center().y()+3), |
| 916 | QPoint(label_rect.left()+1, label_rect.center().y()-3), |
| 917 | QPoint(label_rect.left()+1, label_rect.center().y()+3), |
| 918 | QPoint(label_rect.left()-1, label_rect.center().y()-2), |
| 919 | QPoint(label_rect.left()-1, label_rect.center().y()+2), |
| 920 | QPoint(label_rect.left()+1, label_rect.center().y()-2), |
| 921 | QPoint(label_rect.left()+1, label_rect.center().y()+2), |
| 922 | QPoint(label_rect.left()-2, label_rect.center().y()-2), |
| 923 | QPoint(label_rect.left()-2, label_rect.center().y()+2), |
| 924 | QPoint(label_rect.left()+2, label_rect.center().y()-2), |
| 925 | QPoint(label_rect.left()+2, label_rect.center().y()+2), |
| 926 | }; |
| 927 | if (hover || selected()) |
| 928 | p.drawPoints(arrow_points, countof(arrow_points)); |
nothing calls this directly
no test coverage detected