Use ints for colors instead of string literals

This commit is contained in:
Luis Ángel San Martín 2021-09-30 22:01:07 +02:00
parent d8cb61314d
commit cc927de7de
7 changed files with 7 additions and 7 deletions

View File

@ -85,7 +85,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
QPalette Pal(palette());
// set black background
Pal.setColor(QPalette::Background, QColor("#454545"));
Pal.setColor(QPalette::Background, QColor(0x454545));
this->setAutoFillBackground(true);
this->setPalette(Pal);

View File

@ -93,7 +93,7 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget *parent)
void GoToFlowToolBar::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.fillRect(0, 0, width(), height(), QColor("#99000000"));
painter.fillRect(0, 0, width(), height(), QColor(0x99000000));
}
void GoToFlowToolBar::setPage(int pageNumber)

View File

@ -47,7 +47,7 @@ void NotificationsLabelWidget::paintEvent(QPaintEvent *)
QPainterPath path;
path.addRoundedRect(QRectF(0, 0, width(), height()), 5.0, 5.0);
painter.setPen(Qt::NoPen);
painter.fillPath(path, QColor("#BB000000"));
painter.fillPath(path, QColor(0xBB000000));
painter.drawPath(path);
}

View File

@ -82,7 +82,7 @@ void PageLabelWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.fillRect(0, 0, width(), height(), QColor("#BB000000"));
painter.fillRect(0, 0, width(), height(), QColor(0xBB000000));
}
void PageLabelWidget::updatePosition()

View File

@ -51,7 +51,7 @@ YACReaderTranslator::YACReaderTranslator(Viewer *parent)
this->setAutoFillBackground(true);
this->setBackgroundRole(QPalette::Window);
QPalette p(this->palette());
p.setColor(QPalette::Window, QColor("#404040"));
p.setColor(QPalette::Window, QColor(0x404040));
this->setPalette(p);
auto layout = new QVBoxLayout(this);

View File

@ -79,7 +79,7 @@ void YACReaderSlider::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.fillRect(0, 0, width(), height(), QColor("#BB000000"));
painter.fillRect(0, 0, width(), height(), QColor(0xBB000000));
}
void YACReaderSlider::show()

View File

@ -59,7 +59,7 @@ QVariant ActionsShortcutsModel::data(const QModelIndex &index, int role) const
}
if (role == Qt::ForegroundRole && index.column() == KEYS && actions[index.row()]->shortcut().isEmpty())
return QBrush(QColor("#AAAAAA"));
return QBrush(QColor(0xAAAAAA));
if (role != Qt::DisplayRole)
return QVariant();