mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
a?adido bot?n que permite mostrar u ocultar las portadas de los c?mics siendo importados..
This commit is contained in:
parent
87dbe7fabf
commit
df08b6e4d2
@ -68,5 +68,7 @@
|
|||||||
<file>../images/clearSearch.png</file>
|
<file>../images/clearSearch.png</file>
|
||||||
<file>../images/iconSearch.png</file>
|
<file>../images/iconSearch.png</file>
|
||||||
<file>../images/readRibbon.png</file>
|
<file>../images/readRibbon.png</file>
|
||||||
|
<file>../images/shownCovers.png</file>
|
||||||
|
<file>../images/hiddenCovers.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
@ -13,6 +13,8 @@
|
|||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QGraphicsOpacityEffect>
|
#include <QGraphicsOpacityEffect>
|
||||||
@ -113,7 +115,9 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
|||||||
textDescription->setMaximumWidth(330);
|
textDescription->setMaximumWidth(330);
|
||||||
currentComicLabel = new QLabel("<font color=\"#565959\">...</font>");
|
currentComicLabel = new QLabel("<font color=\"#565959\">...</font>");
|
||||||
|
|
||||||
|
coversViewContainer = new QWidget(this);
|
||||||
QVBoxLayout * coversViewLayout = new QVBoxLayout;
|
QVBoxLayout * coversViewLayout = new QVBoxLayout;
|
||||||
|
coversViewContainer->setLayout(coversViewLayout);
|
||||||
coversView = new QGraphicsView();
|
coversView = new QGraphicsView();
|
||||||
//coversView->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
//coversView->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
||||||
coversView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
coversView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
@ -185,8 +189,17 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
|||||||
layout->addSpacing(10);
|
layout->addSpacing(10);
|
||||||
layout->addStretch();
|
layout->addStretch();
|
||||||
portadasLabel = new QLabel("<font color=\"#565959\">"+tr("Some of the comics being added...")+"</font>");
|
portadasLabel = new QLabel("<font color=\"#565959\">"+tr("Some of the comics being added...")+"</font>");
|
||||||
|
|
||||||
|
hideButton = new QToolButton(this);
|
||||||
|
hideButton->setFixedSize(25,18);
|
||||||
|
hideButton->setStyleSheet("QToolButton {background: url(\":/images/shownCovers.png\"); border:none;}"
|
||||||
|
" QToolButton:checked {background:url(\":/images/hiddenCovers.png\"); border:none;}");
|
||||||
|
hideButton->setCheckable(true);
|
||||||
|
|
||||||
|
connect(hideButton,SIGNAL(toggled(bool)),this,SLOT(showCovers(bool)));
|
||||||
|
|
||||||
layout->addWidget(portadasLabel,0,Qt::AlignHCenter);
|
layout->addWidget(portadasLabel,0,Qt::AlignHCenter);
|
||||||
layout->addLayout(coversViewLayout);
|
layout->addWidget(coversViewContainer);
|
||||||
//layout->addStretch();
|
//layout->addStretch();
|
||||||
layout->addWidget(currentComicLabel,0,Qt::AlignHCenter);
|
layout->addWidget(currentComicLabel,0,Qt::AlignHCenter);
|
||||||
layout->setContentsMargins(0,layout->contentsMargins().top(),0,layout->contentsMargins().bottom());
|
layout->setContentsMargins(0,layout->contentsMargins().top(),0,layout->contentsMargins().bottom());
|
||||||
@ -357,4 +370,17 @@ void ImportWidget::clearScene()
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImportWidget::showCovers(bool hide)
|
||||||
|
{
|
||||||
|
portadasLabel->setHidden(hide);
|
||||||
|
coversViewContainer->setHidden(hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImportWidget::resizeEvent(QResizeEvent * event)
|
||||||
|
{
|
||||||
|
hideButton->move(event->size().width()-hideButton->width()- (currentComicLabel->height()/2),event->size().height()-hideButton->height()- (currentComicLabel->height()/2));
|
||||||
|
|
||||||
|
QWidget::resizeEvent(event);
|
||||||
}
|
}
|
@ -7,6 +7,9 @@ class QLabel;
|
|||||||
class QGraphicsView;
|
class QGraphicsView;
|
||||||
class QGraphicsScene;
|
class QGraphicsScene;
|
||||||
class QElapsedTimer;
|
class QElapsedTimer;
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QToolButton;
|
||||||
|
class QResizeEvent;
|
||||||
|
|
||||||
class ImportWidget : public QWidget
|
class ImportWidget : public QWidget
|
||||||
{
|
{
|
||||||
@ -25,18 +28,24 @@ public slots:
|
|||||||
void clearScene();
|
void clearScene();
|
||||||
void setImportLook();
|
void setImportLook();
|
||||||
void setUpdateLook();
|
void setUpdateLook();
|
||||||
|
void showCovers(bool hide);
|
||||||
private:
|
private:
|
||||||
QLabel * currentComicLabel;
|
QLabel * currentComicLabel;
|
||||||
QLabel * portadasLabel;
|
QLabel * portadasLabel;
|
||||||
QLabel * iconLabel;
|
QLabel * iconLabel;
|
||||||
QLabel * text;
|
QLabel * text;
|
||||||
QLabel * textDescription;
|
QLabel * textDescription;
|
||||||
|
QWidget * coversViewContainer;
|
||||||
QGraphicsView * coversView;
|
QGraphicsView * coversView;
|
||||||
QGraphicsScene * coversScene;
|
QGraphicsScene * coversScene;
|
||||||
int previousWidth;
|
int previousWidth;
|
||||||
bool updatingCovers;
|
bool updatingCovers;
|
||||||
QElapsedTimer * elapsedTimer;
|
QElapsedTimer * elapsedTimer;
|
||||||
quint64 i;
|
quint64 i;
|
||||||
|
|
||||||
|
QToolButton * hideButton;
|
||||||
|
|
||||||
|
void resizeEvent(QResizeEvent * event);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BIN
images/hiddenCovers.png
Normal file
BIN
images/hiddenCovers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 446 B |
BIN
images/shownCovers.png
Normal file
BIN
images/shownCovers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
Loading…
x
Reference in New Issue
Block a user