mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
@ -262,7 +262,7 @@ TRANSLATIONS = yacreaderlibrary_es.ts \
|
|||||||
yacreaderlibrary_source.ts
|
yacreaderlibrary_source.ts
|
||||||
|
|
||||||
#QML/GridView
|
#QML/GridView
|
||||||
QT += quick qml
|
QT += quick qml quickwidgets
|
||||||
|
|
||||||
HEADERS += grid_comics_view.h \
|
HEADERS += grid_comics_view.h \
|
||||||
comics_view_transition.h
|
comics_view_transition.h
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "QsLog.h"
|
#include "QsLog.h"
|
||||||
|
|
||||||
#include <QtQuick>
|
#include <QtQuick>
|
||||||
|
#include <QQuickWidget>
|
||||||
|
|
||||||
ComicsView::ComicsView(QWidget *parent) :
|
ComicsView::ComicsView(QWidget *parent) :
|
||||||
QWidget(parent),model(NULL),comicDB(nullptr)
|
QWidget(parent),model(NULL),comicDB(nullptr)
|
||||||
|
@ -10,7 +10,7 @@ class QSplitter;
|
|||||||
class ComicFlowWidget;
|
class ComicFlowWidget;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
class ComicModel;
|
class ComicModel;
|
||||||
class QQuickView;
|
class QQuickWidget;
|
||||||
|
|
||||||
class ComicsView : public QWidget
|
class ComicsView : public QWidget
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ protected:
|
|||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event);
|
||||||
|
|
||||||
QQuickView *view;
|
QQuickWidget *view;
|
||||||
QWidget *container;
|
QWidget *container;
|
||||||
|
|
||||||
ComicDB *comicDB;
|
ComicDB *comicDB;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "grid_comics_view.h"
|
#include "grid_comics_view.h"
|
||||||
|
|
||||||
#include <QtQuick>
|
#include <QtQuick>
|
||||||
|
#include <QQuickWidget>
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
#include "comic.h"
|
#include "comic.h"
|
||||||
@ -40,21 +41,20 @@ GridComicsView::GridComicsView(QWidget *parent) :
|
|||||||
qmlRegisterType<ComicDB>("com.yacreader.ComicDB",1,0,"ComicDB");
|
qmlRegisterType<ComicDB>("com.yacreader.ComicDB",1,0,"ComicDB");
|
||||||
qmlRegisterType<ComicInfo>("com.yacreader.ComicInfo",1,0,"ComicInfo");
|
qmlRegisterType<ComicInfo>("com.yacreader.ComicInfo",1,0,"ComicInfo");
|
||||||
|
|
||||||
view = new QQuickView();
|
view = new QQuickWidget(this);
|
||||||
|
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
connect(
|
connect(
|
||||||
view, &QQuickView::statusChanged,
|
view, &QQuickWidget::statusChanged,
|
||||||
[=] (QQuickView::Status status)
|
[=] (QQuickWidget::Status status)
|
||||||
{
|
{
|
||||||
if (status == QQuickView::Error)
|
if (status == QQuickWidget::Error)
|
||||||
{
|
{
|
||||||
QLOG_ERROR() << view->errors();
|
QLOG_ERROR() << view->errors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
container = QWidget::createWindowContainer(view, this);
|
|
||||||
|
|
||||||
container->setMinimumSize(200, 200);
|
//view->setFocusPolicy(Qt::TabFocus);
|
||||||
container->setFocusPolicy(Qt::TabFocus);
|
|
||||||
|
|
||||||
selectionHelper = new YACReaderComicsSelectionHelper(this);
|
selectionHelper = new YACReaderComicsSelectionHelper(this);
|
||||||
connect(selectionHelper, &YACReaderComicsSelectionHelper::selectionChanged, this, &GridComicsView::dummyUpdater);
|
connect(selectionHelper, &YACReaderComicsSelectionHelper::selectionChanged, this, &GridComicsView::dummyUpdater);
|
||||||
@ -183,7 +183,7 @@ GridComicsView::GridComicsView(QWidget *parent) :
|
|||||||
setShowMarks(true);//TODO save this in settings
|
setShowMarks(true);//TODO save this in settings
|
||||||
|
|
||||||
QVBoxLayout * l = new QVBoxLayout;
|
QVBoxLayout * l = new QVBoxLayout;
|
||||||
l->addWidget(container);
|
l->addWidget(view);
|
||||||
this->setLayout(l);
|
this->setLayout(l);
|
||||||
|
|
||||||
setContentsMargins(0,0,0,0);
|
setContentsMargins(0,0,0,0);
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
class QAbstractListModel;
|
class QAbstractListModel;
|
||||||
class QItemSelectionModel;
|
class QItemSelectionModel;
|
||||||
class QQuickView;
|
class QQuickWidget;
|
||||||
class QQuickView;
|
|
||||||
|
|
||||||
class YACReaderToolBarStretch;
|
class YACReaderToolBarStretch;
|
||||||
class YACReaderComicsSelectionHelper;
|
class YACReaderComicsSelectionHelper;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "info_comics_view.h"
|
#include "info_comics_view.h"
|
||||||
|
|
||||||
#include <QtQuick>
|
#include <QtQuick>
|
||||||
|
#include <QQuickWidget>
|
||||||
|
|
||||||
#include "comic.h"
|
#include "comic.h"
|
||||||
#include "comic_files_manager.h"
|
#include "comic_files_manager.h"
|
||||||
@ -18,21 +19,20 @@ InfoComicsView::InfoComicsView(QWidget *parent)
|
|||||||
qmlRegisterType<ComicDB>("com.yacreader.ComicDB",1,0,"ComicDB");
|
qmlRegisterType<ComicDB>("com.yacreader.ComicDB",1,0,"ComicDB");
|
||||||
qmlRegisterType<ComicInfo>("com.yacreader.ComicInfo",1,0,"ComicInfo");
|
qmlRegisterType<ComicInfo>("com.yacreader.ComicInfo",1,0,"ComicInfo");
|
||||||
|
|
||||||
view = new QQuickView();
|
view = new QQuickWidget();
|
||||||
|
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
connect(
|
connect(
|
||||||
view, &QQuickView::statusChanged,
|
view, &QQuickWidget::statusChanged,
|
||||||
[=] (QQuickView::Status status)
|
[=] (QQuickWidget::Status status)
|
||||||
{
|
{
|
||||||
if (status == QQuickView::Error)
|
if (status == QQuickWidget::Error)
|
||||||
{
|
{
|
||||||
QLOG_ERROR() << view->errors();
|
QLOG_ERROR() << view->errors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
container = QWidget::createWindowContainer(view, this);
|
//container->setFocusPolicy(Qt::StrongFocus);
|
||||||
|
|
||||||
container->setFocusPolicy(Qt::StrongFocus);
|
|
||||||
|
|
||||||
QQmlContext *ctxt = view->rootContext();
|
QQmlContext *ctxt = view->rootContext();
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ InfoComicsView::InfoComicsView(QWidget *parent)
|
|||||||
comicInfoHelper = new YACReaderComicInfoHelper(this);
|
comicInfoHelper = new YACReaderComicInfoHelper(this);
|
||||||
|
|
||||||
QVBoxLayout * l = new QVBoxLayout;
|
QVBoxLayout * l = new QVBoxLayout;
|
||||||
l->addWidget(container);
|
l->addWidget(view);
|
||||||
this->setLayout(l);
|
this->setLayout(l);
|
||||||
|
|
||||||
setContentsMargins(0,0,0,0);
|
setContentsMargins(0,0,0,0);
|
||||||
|
@ -12,7 +12,7 @@ import com.yacreader.ComicInfo 1.0
|
|||||||
import com.yacreader.ComicDB 1.0
|
import com.yacreader.ComicDB 1.0
|
||||||
|
|
||||||
SplitView {
|
SplitView {
|
||||||
anchors.fill: parent
|
//anchors.fill: parent
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
handleDelegate:Rectangle {
|
handleDelegate:Rectangle {
|
||||||
width: 1
|
width: 1
|
||||||
@ -345,14 +345,38 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//rating icon
|
//rating icon
|
||||||
RatingContextMenu {
|
Image {
|
||||||
id: ratingContextMenu
|
id: ratingImage
|
||||||
|
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
||||||
|
source: "star.png"
|
||||||
|
width: 13
|
||||||
|
height: 11
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: {
|
||||||
|
console.log("rating");
|
||||||
|
comicsSelectionHelper.clear();
|
||||||
|
comicsSelectionHelper.selectIndex(index);
|
||||||
|
grid.currentIndex = index;
|
||||||
|
ratingConextMenu.popup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: ratingConextMenu
|
||||||
|
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
||||||
|
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
||||||
|
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
||||||
|
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
||||||
|
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//comic rating
|
//comic rating
|
||||||
Text {
|
Text {
|
||||||
id: comicRating
|
id: comicRating
|
||||||
anchors {bottom: realCell.bottom; right: ratingContextMenu.left; margins: 4}
|
anchors {bottom: realCell.bottom; right: ratingImage.left; margins: 4}
|
||||||
text: rating>0?rating:"-"
|
text: rating>0?rating:"-"
|
||||||
color: textColor
|
color: textColor
|
||||||
}
|
}
|
||||||
@ -827,5 +851,3 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ Rectangle {
|
|||||||
|
|
||||||
color: infoBackgroundColor
|
color: infoBackgroundColor
|
||||||
|
|
||||||
width: parent.width
|
//width: parent.width
|
||||||
height: parent.height
|
//height: parent.height
|
||||||
anchors.margins: 0
|
anchors.margins: 0
|
||||||
|
|
||||||
FlowView {
|
FlowView {
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
import QtQuick 2.9
|
|
||||||
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: ratingImage
|
|
||||||
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
|
||||||
source: "star.png"
|
|
||||||
width: 13
|
|
||||||
height: 11
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onPressed: {
|
|
||||||
console.log("rating");
|
|
||||||
comicsSelectionHelper.clear();
|
|
||||||
comicsSelectionHelper.selectIndex(index);
|
|
||||||
grid.currentIndex = index;
|
|
||||||
ratingConextMenu.popup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu {
|
|
||||||
id: ratingConextMenu
|
|
||||||
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
|
||||||
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
|
||||||
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
|
||||||
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
|
||||||
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
import QtQuick 2.9
|
|
||||||
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: ratingImage
|
|
||||||
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
|
||||||
source: "star.png"
|
|
||||||
width: 13
|
|
||||||
height: 11
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onPressed: {
|
|
||||||
console.log("rating");
|
|
||||||
comicsSelectionHelper.clear();
|
|
||||||
comicsSelectionHelper.selectIndex(index);
|
|
||||||
grid.currentIndex = index;
|
|
||||||
ratingConextMenu.popup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuBar
|
|
||||||
{
|
|
||||||
Menu {
|
|
||||||
id: ratingConextMenu
|
|
||||||
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
|
||||||
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
|
||||||
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
|
||||||
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
|
||||||
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,6 +4,5 @@
|
|||||||
<file alias="qml/page.png">qml/page-macosx@2x.png</file>
|
<file alias="qml/page.png">qml/page-macosx@2x.png</file>
|
||||||
<file alias="qml/star.png">qml/star-macosx.png</file>
|
<file alias="qml/star.png">qml/star-macosx.png</file>
|
||||||
<file alias="qml/star.png">qml/star-macosx@2x.png</file>
|
<file alias="qml/star.png">qml/star-macosx@2x.png</file>
|
||||||
<file alias="qml/RatingContextMenu.qml">qml/RatingContextMenu-osx.qml</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -2,6 +2,5 @@
|
|||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/page.png</file>
|
<file>qml/page.png</file>
|
||||||
<file>qml/star.png</file>
|
<file>qml/star.png</file>
|
||||||
<file alias="qml/RatingContextMenu.qml">qml/RatingContextMenu-win.qml</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Reference in New Issue
Block a user