mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
A?adido nuevo edit para la b?squeda que sustituye al antiguo junto con la etiqueta y el bot?n
Se ha eliminado la posibilidad de realizar b?squedas que no incluyan los c?mics(falta a?adir una b?squeda m?s potente)
This commit is contained in:
parent
65a50fb612
commit
af6c6c26b5
@ -65,5 +65,7 @@
|
||||
<file>../images/importTopCoversDecoration.png</file>
|
||||
<file>../images/importBottomCoversDecoration.png</file>
|
||||
<file>../images/glowLine.png</file>
|
||||
<file>../images/clearSearch.png</file>
|
||||
<file>../images/iconSearch.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -335,7 +335,7 @@ void ImportWidget::setImportLook()
|
||||
{
|
||||
iconLabel->setPixmap(QPixmap(":/images/importingIcon.png"));
|
||||
text->setText("<font color=\"#495252\">"+tr("Importing comics")+"</font>");
|
||||
textDescription->setText("<font color=\"#565959\">"+tr("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")+"</font>");
|
||||
textDescription->setText("<font color=\"#565959\">"+tr("Create a library could take several minutes. You can stop the process and update the library later for completing the task.")+"</font>");
|
||||
}
|
||||
|
||||
void ImportWidget::setUpdateLook()
|
||||
|
@ -181,16 +181,17 @@ void LibraryWindow::doLayout()
|
||||
QVBoxLayout * searchLayout = new QVBoxLayout;
|
||||
|
||||
QHBoxLayout * filter = new QHBoxLayout;
|
||||
filter->addWidget(foldersFilter = new QLineEdit());
|
||||
filter->addWidget(foldersFilter = new YACReaderLineEdit());
|
||||
foldersFilter->setPlaceholderText(tr("Search folders and comics"));
|
||||
previousFilter = "";
|
||||
filter->addWidget(clearFoldersFilter = new QPushButton(tr("Clear")));
|
||||
//filter->addWidget(clearFoldersFilter = new QPushButton(tr("Clear")));
|
||||
|
||||
searchLayout->addWidget(new QLabel(tr("Search folders/comics"),this));
|
||||
//searchLayout->addWidget(new QLabel(tr("Search folders/comics"),this));
|
||||
|
||||
searchLayout->addLayout(filter);
|
||||
includeComicsCheckBox = new QCheckBox(tr("Include files (slower)"),this);
|
||||
includeComicsCheckBox->setChecked(true);
|
||||
searchLayout->addWidget(includeComicsCheckBox);
|
||||
//includeComicsCheckBox = new QCheckBox(tr("Include files (slower)"),this);
|
||||
//includeComicsCheckBox->setChecked(true);
|
||||
//searchLayout->addWidget(includeComicsCheckBox);
|
||||
|
||||
l->addLayout(searchLayout);
|
||||
l->setSpacing(1);
|
||||
@ -506,7 +507,7 @@ void LibraryWindow::enableLibraryActions()
|
||||
deleteLibraryAction->setEnabled(true);
|
||||
removeLibraryAction->setEnabled(true);
|
||||
foldersFilter->setEnabled(true);
|
||||
clearFoldersFilter->setEnabled(true);
|
||||
//clearFoldersFilter->setEnabled(true);
|
||||
}
|
||||
|
||||
void LibraryWindow::createToolBars()
|
||||
@ -682,9 +683,9 @@ void LibraryWindow::createConnections()
|
||||
connect(comicFlow,SIGNAL(selected(unsigned int)),this,SLOT(openComic()));
|
||||
connect(comicView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(openComic()));
|
||||
//Folders filter
|
||||
connect(clearFoldersFilter,SIGNAL(clicked()),foldersFilter,SLOT(clear()));
|
||||
//connect(clearFoldersFilter,SIGNAL(clicked()),foldersFilter,SLOT(clear()));
|
||||
connect(foldersFilter,SIGNAL(textChanged(QString)),this,SLOT(setFoldersFilter(QString)));
|
||||
connect(includeComicsCheckBox,SIGNAL(stateChanged(int)),this,SLOT(searchInFiles(int)));
|
||||
//connect(includeComicsCheckBox,SIGNAL(stateChanged(int)),this,SLOT(searchInFiles(int)));
|
||||
|
||||
//ContextMenus
|
||||
connect(openContainingFolderComicAction,SIGNAL(triggered()),this,SLOT(openContainingFolderComic()));
|
||||
@ -759,7 +760,6 @@ void LibraryWindow::loadLibrary(const QString & name)
|
||||
//TODO encontrar el bug que provoca que no se carguen adecuadamente las carátulas en root.
|
||||
setRootIndex();
|
||||
|
||||
//includeComicsCheckBox->setCheckState(Qt::Unchecked);
|
||||
foldersFilter->clear();
|
||||
}
|
||||
else if(comparation > 0)
|
||||
@ -1291,7 +1291,7 @@ void LibraryWindow::setFoldersFilter(QString filter)
|
||||
{
|
||||
if(!filter.isEmpty())
|
||||
{
|
||||
dm->setFilter(filter, includeComicsCheckBox->isChecked());
|
||||
dm->setFilter(filter, true);//includeComicsCheckBox->isChecked());
|
||||
foldersView->expandAll();
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ private:
|
||||
QSize slideSizeW;
|
||||
QSize slideSizeF;
|
||||
//search filter
|
||||
QLineEdit * foldersFilter;
|
||||
YACReaderLineEdit * foldersFilter;
|
||||
TreeItem * index; //index al que hay que hacer scroll después de pulsar sobre un folder filtrado
|
||||
int column;
|
||||
QString previousFilter;
|
||||
|
@ -1245,4 +1245,51 @@ YACReaderFlowConfigWidget::YACReaderFlowConfigWidget(QWidget * parent )
|
||||
layout->setContentsMargins(0,0,0,0);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include <QToolButton>
|
||||
#include <QStyle>
|
||||
#include <QLabel>
|
||||
|
||||
YACReaderLineEdit::YACReaderLineEdit(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
{
|
||||
clearButton = new QToolButton(this);
|
||||
searchLabel = new QLabel(this);
|
||||
|
||||
QPixmap pixmap(":/images/clearSearch.png");
|
||||
QPixmap pixmapIcon(":/images/iconSearch.png");
|
||||
|
||||
searchLabel->setStyleSheet("QLabel { border: none; padding: 0px; }");
|
||||
searchLabel->setPixmap(pixmapIcon);
|
||||
|
||||
clearButton->setIcon(QIcon(pixmap));
|
||||
clearButton->setIconSize(pixmap.size());
|
||||
clearButton->setCursor(Qt::ArrowCursor);
|
||||
clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
|
||||
clearButton->hide();
|
||||
connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
|
||||
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-bottom: 1px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 2).arg(clearButton->sizeHint().width() + frameWidth + 2));
|
||||
QSize msz = minimumSizeHint();
|
||||
setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
|
||||
qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
|
||||
}
|
||||
|
||||
void YACReaderLineEdit::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
QSize sz = clearButton->sizeHint();
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
clearButton->move(rect().right() - frameWidth - sz.width(),
|
||||
(rect().bottom() + 1 - sz.height())/2);
|
||||
|
||||
QSize szl = searchLabel->sizeHint();
|
||||
searchLabel->move(3,(rect().bottom() + 1 - szl.height())/2);
|
||||
}
|
||||
|
||||
void YACReaderLineEdit::updateCloseButton(const QString& text)
|
||||
{
|
||||
clearButton->setVisible(!text.isEmpty());
|
||||
}
|
@ -379,6 +379,28 @@ signals:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
class QToolButton;
|
||||
class QLabel;
|
||||
|
||||
class YACReaderLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
YACReaderLineEdit(QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
private slots:
|
||||
void updateCloseButton(const QString &text);
|
||||
|
||||
private:
|
||||
QToolButton *clearButton;
|
||||
QLabel * searchLabel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
BIN
images/clearSearch.png
Normal file
BIN
images/clearSearch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 333 B |
Loading…
Reference in New Issue
Block a user