mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Enabled context menut and double click for opening in comic info view.
This commit is contained in:
parent
b983de8888
commit
bd78b6f504
@ -81,8 +81,9 @@ void InfoComicsView::setModel(ComicModel *model)
|
|||||||
ctxt->setContextProperty("backgroundImage", QUrl());
|
ctxt->setContextProperty("backgroundImage", QUrl());
|
||||||
|
|
||||||
ctxt->setContextProperty("comicsSelection", selectionHelper->selectionModel());
|
ctxt->setContextProperty("comicsSelection", selectionHelper->selectionModel());
|
||||||
/*ctxt->setContextProperty("contextMenuHelper",this);
|
ctxt->setContextProperty("contextMenuHelper",this);
|
||||||
ctxt->setContextProperty("comicsSelectionHelper", this);
|
ctxt->setContextProperty("currentIndexHelper", this);
|
||||||
|
/*ctxt->setContextProperty("comicsSelectionHelper", this);
|
||||||
ctxt->setContextProperty("comicRatingHelper", this);
|
ctxt->setContextProperty("comicRatingHelper", this);
|
||||||
ctxt->setContextProperty("dummyValue", true);
|
ctxt->setContextProperty("dummyValue", true);
|
||||||
ctxt->setContextProperty("dragManager", this);*/
|
ctxt->setContextProperty("dragManager", this);*/
|
||||||
@ -188,3 +189,13 @@ void InfoComicsView::droppedFiles(const QList<QUrl> &urls, Qt::DropAction action
|
|||||||
emit copyComicsToCurrentFolder(droppedFiles);
|
emit copyComicsToCurrentFolder(droppedFiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InfoComicsView::requestedContextMenu(const QPoint &point)
|
||||||
|
{
|
||||||
|
emit customContextMenuViewRequested(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfoComicsView::selectedItem(int index)
|
||||||
|
{
|
||||||
|
emit selected(index);
|
||||||
|
}
|
||||||
|
@ -39,6 +39,10 @@ protected slots:
|
|||||||
bool canDropUrls(const QList<QUrl> & urls, Qt::DropAction action);
|
bool canDropUrls(const QList<QUrl> & urls, Qt::DropAction action);
|
||||||
void droppedFiles(const QList<QUrl> & urls, Qt::DropAction action);
|
void droppedFiles(const QList<QUrl> & urls, Qt::DropAction action);
|
||||||
|
|
||||||
|
void requestedContextMenu(const QPoint & point);
|
||||||
|
|
||||||
|
void selectedItem(int index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QToolBar * toolbar;
|
QToolBar * toolbar;
|
||||||
QObject *flow;
|
QObject *flow;
|
||||||
|
@ -6,6 +6,8 @@ import QtGraphicalEffects 1.0
|
|||||||
import com.yacreader.ComicModel 1.0
|
import com.yacreader.ComicModel 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: main
|
||||||
|
|
||||||
property url backgroundImageURL;
|
property url backgroundImageURL;
|
||||||
|
|
||||||
property real backgroundBlurRadius : 100; //85;
|
property real backgroundBlurRadius : 100; //85;
|
||||||
@ -163,8 +165,23 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|
||||||
onClicked: {
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onDoubleClicked: {
|
||||||
list.currentIndex = index;
|
list.currentIndex = index;
|
||||||
|
currentIndexHelper.selectedItem(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
onReleased: {
|
||||||
|
list.currentIndex = index;
|
||||||
|
|
||||||
|
if(mouse.button === Qt.RightButton) // context menu is requested
|
||||||
|
{
|
||||||
|
var coordinates = main.mapFromItem(coverElement,mouseX,mouseY)
|
||||||
|
contextMenuHelper.requestedContextMenu(Qt.point(coordinates.x,coordinates.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
mouse.accepted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user