- p.setBrush(_colour);
-
- const QColor colour = get_colour();
-
- compute_text_size(p);
- const QRectF label_rect = get_label_rect(y, right);
-
- // Paint the label
- const QPointF points[] = {
- label_rect.topLeft(),
- label_rect.topRight(),
- QPointF(right, y),
- label_rect.bottomRight(),
- label_rect.bottomLeft()
- };
-
- const QPointF highlight_points[] = {
- QPointF(label_rect.left() + 1, label_rect.top() + 1),
- QPointF(label_rect.right(), label_rect.top() + 1),
- QPointF(right - 1, y),
- QPointF(label_rect.right(), label_rect.bottom() - 1),
- QPointF(label_rect.left() + 1, label_rect.bottom() - 1)
- };
-
- if (_selected) {
- p.setPen(QPen(QApplication::palette().brush(
- QPalette::Highlight), LabelHighlightRadius,
- Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
- p.setBrush(Qt::transparent);
- p.drawPolygon(points, countof(points));
+ name_widget_ = new QComboBox(parent);
+ name_widget_->setEditable(true);
+ name_widget_->setCompleter(nullptr);
+
+ for (unsigned int i = 0; i < countof(ChannelNames); i++)
+ name_widget_->insertItem(i, ChannelNames[i]);
+
+ const int index = name_widget_->findText(base_->name(), Qt::MatchExactly);
+
+ if (index == -1) {
+ name_widget_->insertItem(0, base_->name());
+ name_widget_->setCurrentIndex(0);
+ } else {
+ name_widget_->setCurrentIndex(index);