From 98e5fc648ca76ddbf4610a9f1dc633b2f0d382cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Tue, 2 Oct 2012 19:33:04 +0200 Subject: [PATCH] solucionados algunos problemas en la integraci?n de yacreader_flow_gl (comicFlow) --- YACReaderLibrary/library_window.cpp | 1 + common/comic_flow_widget.cpp | 9 ++++++++- common/yacreader_flow_gl.cpp | 10 +++++----- common/yacreader_flow_gl.h | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 6050cfc6..03b9cdd9 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -52,6 +52,7 @@ void LibraryWindow::doLayout() //TODO: flowType is a global variable //CONFIG COMIC_FLOW-------------------------------------------------------- comicFlow = new ComicFlowWidgetGL(0); + comicFlow->setFlowType(flowType); comicFlow->setFocusPolicy(Qt::StrongFocus); comicFlow->setShowMarks(true); QMatrix m; diff --git a/common/comic_flow_widget.cpp b/common/comic_flow_widget.cpp index dc944215..483d1573 100644 --- a/common/comic_flow_widget.cpp +++ b/common/comic_flow_widget.cpp @@ -200,7 +200,14 @@ void ComicFlowWidgetGL::updateMarks() } void ComicFlowWidgetGL::setFlowType(PictureFlow::FlowType flowType) { - flow->setFlowType(flowType); + if(flowType == PictureFlow::CoverFlowLike) + flow->setPreset(presetYACReaderFlowClassicConfig); + else if(flowType == PictureFlow::Strip) + flow->setPreset(presetYACReaderFlowStripeConfig); + else if(flowType == PictureFlow::StripOverlapped) + flow->setPreset(presetYACReaderFlowOverlappedStripeConfig); + else + flow->setPreset(defaultYACReaderFlowConfig); } void ComicFlowWidgetGL::render() { diff --git a/common/yacreader_flow_gl.cpp b/common/yacreader_flow_gl.cpp index 6b7c8c61..4057e88f 100644 --- a/common/yacreader_flow_gl.cpp +++ b/common/yacreader_flow_gl.cpp @@ -437,7 +437,7 @@ void YACReaderFlowGL::drawCover(CFImage *CF) glEnd(); glDisable(GL_TEXTURE_2D); - if(loaded[CF->index] && marks[CF->index]) + if(showMarks && loaded[CF->index] && marks[CF->index]) { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, markTexture); @@ -898,10 +898,10 @@ void YACReaderFlowGL::updateMarks() { //do nothing } -void YACReaderFlowGL::setFlowType(PictureFlow::FlowType flowType) +/*void YACReaderFlowGL::setFlowType(PictureFlow::FlowType flowType) { //TODO esperar a que se reimplemente flowtype -} +}*/ void YACReaderFlowGL::render() { //do nothing @@ -965,7 +965,7 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event) gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ); - if(posX >= 0) + if(posX >= 0.5) { //int index = currentSelected+1; //while((cfImages[index].current.x-cfImages[index].width/(2.0*config.rotation)) < posX) @@ -973,7 +973,7 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event) //setCurrentIndex(index-1); showNext(); } - else + else if(posX <=-0.5) showPrevious(); } else if(event->button() == Qt::RightButton) { diff --git a/common/yacreader_flow_gl.h b/common/yacreader_flow_gl.h index 4757a0eb..2a34efe4 100644 --- a/common/yacreader_flow_gl.h +++ b/common/yacreader_flow_gl.h @@ -228,7 +228,7 @@ public: void showSlide(int index); int centerIndex(); void updateMarks(); - void setFlowType(PictureFlow::FlowType flowType); + //void setFlowType(PictureFlow::FlowType flowType); void render(); //void paintEvent(QPaintEvent *event);