Show fullsize cover on doubleclick in edit tag dialog
This commit is contained in:
@@ -211,6 +211,8 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
|
|||||||
ui_->tags_art->installEventFilter(this);
|
ui_->tags_art->installEventFilter(this);
|
||||||
ui_->tags_art->setAcceptDrops(true);
|
ui_->tags_art->setAcceptDrops(true);
|
||||||
|
|
||||||
|
ui_->summary_art->installEventFilter(this);
|
||||||
|
|
||||||
// Add the next/previous buttons
|
// Add the next/previous buttons
|
||||||
previous_button_ = new QPushButton(IconLoader::Load("go-previous"), tr("Previous"), this);
|
previous_button_ = new QPushButton(IconLoader::Load("go-previous"), tr("Previous"), this);
|
||||||
next_button_ = new QPushButton(IconLoader::Load("go-next"), tr("Next"), this);
|
next_button_ = new QPushButton(IconLoader::Load("go-next"), tr("Next"), this);
|
||||||
@@ -300,12 +302,20 @@ bool EditTagDialog::eventFilter(QObject *o, QEvent *e) {
|
|||||||
|
|
||||||
if (o == ui_->tags_art) {
|
if (o == ui_->tags_art) {
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::MouseButtonRelease:
|
case QEvent::MouseButtonRelease:{
|
||||||
|
QMouseEvent *mouse_event = static_cast<QMouseEvent*>(e);
|
||||||
|
if (mouse_event && mouse_event->button() == Qt::RightButton) {
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
cover_menu_->popup(static_cast<QMouseEvent*>(e)->globalPosition().toPoint());
|
cover_menu_->popup(mouse_event->globalPosition().toPoint());
|
||||||
#else
|
#else
|
||||||
cover_menu_->popup(static_cast<QMouseEvent*>(e)->globalPos());
|
cover_menu_->popup(static_cast<QMouseEvent*>(e)->globalPos());
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case QEvent::MouseButtonDblClick:
|
||||||
|
ShowCover();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::DragEnter: {
|
case QEvent::DragEnter: {
|
||||||
@@ -331,6 +341,15 @@ bool EditTagDialog::eventFilter(QObject *o, QEvent *e) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (o == ui_->summary_art) {
|
||||||
|
switch (e->type()) {
|
||||||
|
case QEvent::MouseButtonDblClick:
|
||||||
|
ShowCover();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user