Skip to content

Commit

Permalink
WTrackProperty/WTracktext: unset hover state when menu is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Dec 25, 2023
1 parent e86e8e6 commit af102fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ void WTrackProperty::contextMenuEvent(QContextMenuEvent* event) {
m_pTrackMenu->loadTrack(m_pCurrentTrack, m_group);
// Create the right-click menu
m_pTrackMenu->popup(event->globalPos());
// Unset the hover state manually (stuck state is probably a Qt bug)
// TODO(ronso0) Test whether this is still required with Qt6
QEvent lev = QEvent(QEvent::Leave);
qApp->sendEvent(this, &lev);
update();
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/widget/wtracktext.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "widget/wtracktext.h"

#include <QApplication>

#include "control/controlobject.h"
#include "moc_wtracktext.cpp"
#include "track/track.h"
#include "util/dnd.h"
Expand Down Expand Up @@ -101,6 +104,11 @@ void WTrackText::contextMenuEvent(QContextMenuEvent* event) {
ensureTrackMenuIsCreated();
m_pTrackMenu->loadTrack(m_pCurrentTrack, m_group);
m_pTrackMenu->popup(event->globalPos());
// Unset the hover state manually (stuck state is probably a Qt bug)
// TODO(ronso0) Test whether this is still required with Qt6
QEvent lev = QEvent(QEvent::Leave);
qApp->sendEvent(this, &lev);
update();
}
}

Expand Down

0 comments on commit af102fc

Please sign in to comment.