- const QSizeF label_size(
- _text_size.width() + View::LabelPadding.width() * 2,
- ceilf((_text_size.height() + View::LabelPadding.height() * 2) / 2) * 2);
- const float label_arrow_length = label_size.height() / 2;
- return QRectF(
- right - label_arrow_length - label_size.width() - 0.5,
- y + 0.5f - label_size.height() / 2,
- label_size.width(), label_size.height());
+void Trace::populate_popup_form(QWidget *parent, QFormLayout *form)
+{
+ QLineEdit *const name_edit = new QLineEdit(parent);
+ name_edit->setText(channel_->name());
+ connect(name_edit, SIGNAL(textChanged(const QString&)),
+ this, SLOT(on_nameedit_changed(const QString&)));
+ form->addRow(tr("Name"), name_edit);
+
+ add_colour_option(parent, form);
+}
+
+void Trace::set_name(QString name)
+{
+ channel_->set_name(name);
+}
+
+void Trace::set_colour(QColor colour)
+{
+ channel_->set_colour(colour);
+}
+
+void Trace::on_name_changed(const QString &text)
+{
+ /* This event handler is called by SignalBase when the name was changed there */
+ (void)text;
+
+ if (owner_) {
+ owner_->extents_changed(true, false);
+ owner_->row_item_appearance_changed(true, false);
+ }
+}
+
+void Trace::on_colour_changed(const QColor &colour)
+{
+ /* This event handler is called by SignalBase when the colour was changed there */
+ (void)colour;
+
+ if (owner_)
+ owner_->row_item_appearance_changed(true, true);
+}
+
+void Trace::on_popup_closed()
+{
+ popup_ = nullptr;
+ popup_form_ = nullptr;
+}
+
+void Trace::on_nameedit_changed(const QString &name)
+{
+ /* This event handler notifies SignalBase that the name changed */
+ set_name(name);
+}
+
+void Trace::on_colouredit_changed(const QColor &colour)
+{
+ /* This event handler notifies SignalBase that the colour changed */
+ set_colour(colour);