- 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());
+ // Repopulate the popup
+ popup_form_ = new QFormLayout(popup_);
+ popup_->setLayout(popup_form_);
+ populate_popup_form(popup_, popup_form_);
+}
+
+void Trace::populate_popup_form(QWidget *parent, QFormLayout *form)
+{
+ QLineEdit *const name_edit = new QLineEdit(parent);
+ name_edit->setText(name_);
+ connect(name_edit, SIGNAL(textChanged(const QString&)),
+ this, SLOT(on_text_changed(const QString&)));
+ form->addRow(tr("Name"), name_edit);
+
+ add_colour_option(parent, form);
+}
+
+void Trace::on_popup_closed()
+{
+ popup_ = NULL;
+ popup_form_ = NULL;
+}
+
+void Trace::on_text_changed(const QString &text)
+{
+ set_name(text);
+
+ if (owner_)
+ owner_->extents_changed(true, false);
+}
+
+void Trace::on_colour_changed(const QColor &colour)
+{
+ set_colour(colour);
+
+ if (owner_)
+ owner_->row_item_appearance_changed(true, false);