mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
modificado el layout en macosx para que el input de b?squeda est? en el lugar apropiado
This commit is contained in:
parent
70a3dbb2aa
commit
b13acf639d
@ -206,7 +206,7 @@ void LibraryWindow::doLayout()
|
||||
|
||||
QHBoxLayout * filter = new QHBoxLayout;
|
||||
filter->addWidget(foldersFilter = new YACReaderSearchLineEdit());
|
||||
foldersFilter->setAttribute(Qt::WA_MacShowFocusRect,false);
|
||||
foldersFilter->setAttribute(Qt::WA_MacShowFocusRect,false);
|
||||
foldersFilter->setPlaceholderText(tr("Search folders and comics"));
|
||||
previousFilter = "";
|
||||
|
||||
@ -562,8 +562,11 @@ void LibraryWindow::createToolBars()
|
||||
|
||||
libraryToolBar->addSeparator();
|
||||
libraryToolBar->addAction(toggleFullScreenAction);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
libraryToolBar->addSeparator();
|
||||
#else
|
||||
libraryToolBar->addWidget(new QToolBarStretch());
|
||||
#endif
|
||||
|
||||
#ifdef SERVER_RELEASE
|
||||
libraryToolBar->addAction(serverConfigAction);
|
||||
@ -572,6 +575,10 @@ void LibraryWindow::createToolBars()
|
||||
libraryToolBar->addAction(helpAboutAction);
|
||||
//libraryToolBar->addAction(socialAction);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
libraryToolBar->addWidget(new QToolBarStretch());
|
||||
libraryToolBar->addWidget(foldersFilter);
|
||||
#endif
|
||||
|
||||
libraryToolBar->setMovable(false);
|
||||
|
||||
|
@ -24,10 +24,18 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
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);
|
||||
#ifdef Q_OS_MAC
|
||||
setStyleSheet(QString("QLineEdit {border-top:1px solid #9F9F9F; border-bottom:1px solid #ACACAC; border-right:1px solid #ACACAC; border-left:1px solid #ACACAC; border-radius: 10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CACACA, stop: 0.15 #FFFFFF); padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-bottom: 1px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6).arg(clearButton->sizeHint().width() + frameWidth + 2));
|
||||
#else
|
||||
setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-bottom: 1px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6).arg(clearButton->sizeHint().width() + frameWidth + 2));
|
||||
#endif
|
||||
QSize msz = minimumSizeHint();
|
||||
setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
|
||||
qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
setMaximumWidth(300);
|
||||
#endif
|
||||
}
|
||||
|
||||
void YACReaderSearchLineEdit::resizeEvent(QResizeEvent *)
|
||||
@ -44,4 +52,4 @@ void YACReaderSearchLineEdit::resizeEvent(QResizeEvent *)
|
||||
void YACReaderSearchLineEdit::updateCloseButton(const QString& text)
|
||||
{
|
||||
clearButton->setVisible(!text.isEmpty());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user