Improve marker selecting

This commit is contained in:
Thomas Wilshaw
2021-10-22 22:15:54 +01:00
parent 3840c5158d
commit f3e025c729
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -110,8 +110,12 @@ void Marker::paintEvent(QPaintEvent *event)
void Marker::mousePressEvent(QMouseEvent* e)
{
if (e->button() == Qt::LeftButton) {
static_cast<SeekableWidget*>(parent())->SeekToScreenPoint(e->pos().x() + this->x());
// Only select if clicking on the icon and not the label
if (e->pos().x() > 7) {
return;
}
if (e->button() == Qt::LeftButton || e->button() == Qt::RightButton) {
static_cast<SeekableWidget*>(parent())->SeekToScreenPoint(this->x() + 4);
if (!active_) {
if (e->modifiers() != Qt::ShiftModifier) {
static_cast<SeekableWidget *>(parent())->DeselectAllMarkers();
@@ -166,7 +170,6 @@ void Marker::SetColor(int c)
void Marker::SetName(QString s)
{
name_ = s;
qDebug() << name_;
update();
}
+1 -1
View File
@@ -237,7 +237,7 @@ void SeekableWidget::updateMarkerPositions()
{
foreach (TimelineMarker* marker, marker_map_.keys()) {
Marker *m = marker_map_.value(marker);
m->move(TimeToScreen(marker->time().in()), text_height_);
m->move(TimeToScreen(marker->time().in())-2, text_height_);
}
}