mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Don't use Q_OS_MAC for ui specifics, Y_MAC_UI is the replacement
This commit is contained in:
@ -56,7 +56,7 @@ YACReaderLibraryItemWidget::YACReaderLibraryItemWidget(QString n /*ame*/, QStrin
|
||||
mainLayout->addWidget(down);*/
|
||||
|
||||
setLayout(mainLayout);
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
QString styleSheet = "background-color:transparent; color:#DDDFDF;";
|
||||
setStyleSheet(styleSheet);
|
||||
#endif
|
||||
@ -117,7 +117,7 @@ bool YACReaderLibraryItemWidget::eventFilter(QObject *object, QEvent *event){
|
||||
void YACReaderLibraryItemWidget::deselect()
|
||||
{
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
QString styleSheet = "background-color:transparent;";
|
||||
setStyleSheet(styleSheet);
|
||||
#else
|
||||
@ -137,7 +137,7 @@ void YACReaderLibraryItemWidget::deselect()
|
||||
|
||||
void YACReaderLibraryItemWidget::select()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
// QString styleSheet ="color: white; background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6BAFE4, stop: 1 #3984D2); border-top: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5EA3DF, stop: 1 #73B8EA); border-left:none;border-right:none;border-bottom:1px solid #3577C2;";
|
||||
QString styleSheet = "color: white; background-color:#91c4f4; border-bottom:1px solid #91c4f4;";
|
||||
#else
|
||||
|
@ -13,7 +13,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
clearButton = new QToolButton(this);
|
||||
searchLabel = new QLabel(this);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
QPixmap clearIcon;
|
||||
QPixmap searchIcon;
|
||||
|
||||
@ -41,7 +41,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
|
||||
clearButton->setIcon(QIcon(clearIcon));
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
clearButton->setIconSize(QSize(14, 14));
|
||||
#else
|
||||
clearButton->setIconSize(QSize(12, 12));
|
||||
@ -53,7 +53,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
connect(clearButton, &QAbstractButton::clicked, this, &QLineEdit::clear);
|
||||
connect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::updateCloseButton);
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
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: 4px; background-color:#EEEEEE; 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 {color: #ABABAB; border:none; border-radius: 4px; background-color:#404040; padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-right: 9px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6 + 5).arg(clearButton->sizeHint().width() + frameWidth + 2));
|
||||
@ -62,7 +62,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
|
||||
qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
setMaximumWidth(212);
|
||||
setFixedHeight(26);
|
||||
#else
|
||||
@ -90,7 +90,7 @@ const QString YACReaderSearchLineEdit::text()
|
||||
|
||||
void YACReaderSearchLineEdit::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
QSize sz = clearButton->sizeHint();
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
clearButton->move(rect().right() - frameWidth - sz.width(),
|
||||
|
@ -23,7 +23,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
readingListsView = new YACReaderReadingListsView;
|
||||
selectedLibrary = new YACReaderLibraryListWidget;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
librariesTitle = new YACReaderTitledToolBar(tr("Libraries"));
|
||||
foldersTitle = new YACReaderTitledToolBar(tr("Folders"));
|
||||
readingListsTitle = new YACReaderTitledToolBar(tr("Reading Lists"));
|
||||
@ -36,7 +36,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
splitter = new QSplitter(this);
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
splitter->setStyleSheet("QSplitter::handle { "
|
||||
" image: none; background-color = black; "
|
||||
" }"
|
||||
@ -55,20 +55,20 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
l->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// LIBRARIES-------------------------------------------------------
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
l->addSpacing(5);
|
||||
#endif
|
||||
|
||||
l->addWidget(librariesTitle);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
l->addSpacing(4);
|
||||
l->addWidget(new YACReaderSideBarSeparator(this));
|
||||
l->addSpacing(3);
|
||||
#endif
|
||||
|
||||
l->addWidget(selectedLibrary);
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
l->addSpacing(11);
|
||||
#else
|
||||
l->addSpacing(6);
|
||||
@ -82,7 +82,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
foldersLayout->setContentsMargins(0, 0, 0, 0);
|
||||
foldersLayout->setSpacing(0);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
// foldersLayout->addSpacing(6);
|
||||
|
||||
// foldersLayout->addSpacing(5);
|
||||
@ -94,7 +94,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
|
||||
foldersLayout->addWidget(foldersTitle);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
foldersLayout->addSpacing(4);
|
||||
foldersLayout->addWidget(new YACReaderSideBarSeparator(this));
|
||||
foldersLayout->addSpacing(4);
|
||||
@ -114,7 +114,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
readingListsHeaderLayout->setContentsMargins(0, 0, 0, 0);
|
||||
readingListsHeaderLayout->setSpacing(0);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
// readingListsHeaderLayout->addSpacing(6);
|
||||
|
||||
// readingListsHeaderLayout->addSpacing(5);
|
||||
@ -126,7 +126,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
|
||||
readingListsHeaderLayout->addWidget(readingListsTitle);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
readingListsHeaderLayout->addSpacing(4);
|
||||
readingListsHeaderLayout->addWidget(new YACReaderSideBarSeparator(this));
|
||||
readingListsHeaderLayout->addSpacing(4);
|
||||
@ -152,7 +152,7 @@ void YACReaderSideBar::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
QPainter painter(this);
|
||||
|
||||
painter.fillRect(0, 0, width(), height(), QColor("#F1F1F1"));
|
||||
|
@ -24,7 +24,7 @@ YACReaderTableView::YACReaderTableView(QWidget *parent)
|
||||
"QTableCornerButton::section {background-color:#F5F5F5; border:none; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4);}"
|
||||
"QTableView::item {outline: 0px; border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE; padding-bottom:1px; color:#252626;}"
|
||||
"QTableView {border-top:1px solid #B8B8B8;border-bottom:none;border-left:1px solid #B8B8B8;border-right:none;}"
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
"QTableView {border-top:1px solid #B8B8B8;border-bottom:none;border-left:none;border-right:none;}"
|
||||
"QTableView::item:selected {outline: 0px; border-bottom: 1px solid #3875D7;border-top: 1px solid #3875D7; padding-bottom:1px; background-color: #3875D7; color: #FFFFFF; }"
|
||||
|
||||
|
@ -40,7 +40,7 @@ void DropShadowLabel::paintEvent(QPaintEvent *event)
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setFont(font());
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Y_MAC_UI
|
||||
drawTextEffect(&painter, QPoint(contentsMargins().left(), 1));
|
||||
#endif
|
||||
drawText(&painter, QPoint(contentsMargins().left(), 0));
|
||||
@ -68,7 +68,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa
|
||||
|
||||
nameLabel = new DropShadowLabel(this);
|
||||
nameLabel->setText(title);
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setColor(QColor("#808080"));
|
||||
// nameLabel->setDropShadowColor(QColor("#F9FAFB"));
|
||||
@ -94,7 +94,7 @@ void YACReaderTitledToolBar::addAction(QAction *action)
|
||||
QHBoxLayout *mainLayout = dynamic_cast<QHBoxLayout *>(layout());
|
||||
|
||||
// fix for QToolButton and retina support in OSX
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC // TODO_Y_MAC_UI
|
||||
QPushButton *pb = new QPushButton(this);
|
||||
pb->setCursor(QCursor(Qt::ArrowCursor));
|
||||
pb->setIcon(action->icon());
|
||||
@ -128,7 +128,7 @@ void YACReaderTitledToolBar::addSepartor()
|
||||
|
||||
QWidget *w = new QWidget(this);
|
||||
w->setFixedSize(1, 14);
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
w->setStyleSheet("QWidget {background-color:#AFAFAF;}");
|
||||
#else
|
||||
w->setStyleSheet("QWidget {background-color:#6F6F6F;}");
|
||||
|
@ -18,7 +18,7 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent)
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Y_MAC_UI
|
||||
|
||||
setStyleSheet("QTreeView {background-color:transparent; border: none;}"
|
||||
"QTreeView::item:selected {background-color:#91c4f4; border-top: 1px solid #91c4f4; border-left:none;border-right:none;border-bottom:1px solid #91c4f4;}"
|
||||
|
Reference in New Issue
Block a user