mirror of git://sigrok.org/pulseview
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:
parent
ef6cbaa211
commit
499f68de03
|
@ -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));
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue