TimeMarker: Automatically deselect item when popup closes

If this is not done, the item remains selected and the user has to manually deselect it, which is bothersome.
This commit is contained in:
Soeren Apel 2023-10-18 01:35:44 +02:00
parent ef6cbaa211
commit 499f68de03
2 changed files with 9 additions and 0 deletions

View File

@ -184,6 +184,8 @@ pv::widgets::Popup* TimeMarker::create_popup(QWidget *parent)
popup->set_position(parent->mapToGlobal(
drag_point(parent->rect())), Popup::Bottom);
connect(popup, SIGNAL(closed()), this, SLOT(on_popup_closed()));
QFormLayout *const form = new QFormLayout(popup);
popup->setLayout(form);
@ -198,6 +200,11 @@ pv::widgets::Popup* TimeMarker::create_popup(QWidget *parent)
return popup;
}
void TimeMarker::on_popup_closed()
{
select(false);
}
void TimeMarker::on_value_changed(const pv::util::Timestamp& value)
{
set_time(view_.ruler()->get_absolute_time_from_ruler_time(value));

View File

@ -128,6 +128,8 @@ public:
virtual pv::widgets::Popup* create_popup(QWidget *parent) override;
private Q_SLOTS:
void on_popup_closed();
void on_value_changed(const pv::util::Timestamp& value);
protected: