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/iconSearch.png</file>
|
||||
<file>../images/readRibbon.png</file>
|
||||
<file>../images/shownCovers.png</file>
|
||||
<file>../images/hiddenCovers.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -13,6 +13,8 @@
|
||||
#include <QGLWidget>
|
||||
#include <QTimer>
|
||||
#include <QElapsedTimer>
|
||||
#include <QToolButton>
|
||||
#include <QResizeEvent>
|
||||
|
||||
#include <QPropertyAnimation>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
@ -113,7 +115,9 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
||||
textDescription->setMaximumWidth(330);
|
||||
currentComicLabel = new QLabel("<font color=\"#565959\">...</font>");
|
||||
|
||||
coversViewContainer = new QWidget(this);
|
||||
QVBoxLayout * coversViewLayout = new QVBoxLayout;
|
||||
coversViewContainer->setLayout(coversViewLayout);
|
||||
coversView = new QGraphicsView();
|
||||
//coversView->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
||||
coversView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -185,8 +189,17 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
||||
layout->addSpacing(10);
|
||||
layout->addStretch();
|
||||
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->addLayout(coversViewLayout);
|
||||
layout->addWidget(coversViewContainer);
|
||||
//layout->addStretch();
|
||||
layout->addWidget(currentComicLabel,0,Qt::AlignHCenter);
|
||||
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 QGraphicsScene;
|
||||
class QElapsedTimer;
|
||||
class QVBoxLayout;
|
||||
class QToolButton;
|
||||
class QResizeEvent;
|
||||
|
||||
class ImportWidget : public QWidget
|
||||
{
|
||||
@ -25,18 +28,24 @@ public slots:
|
||||
void clearScene();
|
||||
void setImportLook();
|
||||
void setUpdateLook();
|
||||
void showCovers(bool hide);
|
||||
private:
|
||||
QLabel * currentComicLabel;
|
||||
QLabel * portadasLabel;
|
||||
QLabel * iconLabel;
|
||||
QLabel * text;
|
||||
QLabel * textDescription;
|
||||
QWidget * coversViewContainer;
|
||||
QGraphicsView * coversView;
|
||||
QGraphicsScene * coversScene;
|
||||
int previousWidth;
|
||||
bool updatingCovers;
|
||||
QElapsedTimer * elapsedTimer;
|
||||
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