mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 13:34:44 -04:00
fixed spaces/tabs mix
This commit is contained in:
@ -10,44 +10,44 @@
|
||||
|
||||
|
||||
DropShadowLabel::DropShadowLabel(QWidget* parent) :
|
||||
QLabel(parent)
|
||||
QLabel(parent)
|
||||
{ }
|
||||
|
||||
void DropShadowLabel::drawText(QPainter *painter,
|
||||
QPoint offset)
|
||||
QPoint offset)
|
||||
{
|
||||
Q_ASSERT(painter != 0);
|
||||
Q_ASSERT(painter != 0);
|
||||
|
||||
// Draw shadow.
|
||||
painter->setPen(QPen(textColor));
|
||||
painter->drawText(rect().translated(offset),
|
||||
alignment(), text());
|
||||
// Draw shadow.
|
||||
painter->setPen(QPen(textColor));
|
||||
painter->drawText(rect().translated(offset),
|
||||
alignment(), text());
|
||||
}
|
||||
void DropShadowLabel::drawTextEffect(QPainter *painter,
|
||||
QPoint offset)
|
||||
QPoint offset)
|
||||
{
|
||||
Q_ASSERT(painter != 0);
|
||||
Q_ASSERT(painter != 0);
|
||||
|
||||
// Draw shadow.
|
||||
painter->setPen(QPen(dropShadowColor));
|
||||
painter->drawText(rect().translated(offset),
|
||||
alignment(), text());
|
||||
// Draw shadow.
|
||||
painter->setPen(QPen(dropShadowColor));
|
||||
painter->drawText(rect().translated(offset),
|
||||
alignment(), text());
|
||||
}
|
||||
|
||||
void DropShadowLabel::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(event);
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setFont(font());
|
||||
//TODO find where is the '3' comming from?
|
||||
drawTextEffect(&painter, QPoint(contentsMargins().left(), 1));
|
||||
drawText(&painter, QPoint(contentsMargins().left(), 0));
|
||||
QPainter painter(this);
|
||||
painter.setFont(font());
|
||||
//TODO find where is the '3' comming from?
|
||||
drawTextEffect(&painter, QPoint(contentsMargins().left(), 1));
|
||||
drawText(&painter, QPoint(contentsMargins().left(), 0));
|
||||
}
|
||||
|
||||
void DropShadowLabel::setColor(const QColor & color)
|
||||
{
|
||||
textColor = color;
|
||||
textColor = color;
|
||||
}
|
||||
|
||||
void DropShadowLabel::setDropShadowColor(const QColor & color)
|
||||
@ -58,7 +58,7 @@ void DropShadowLabel::setDropShadowColor(const QColor & color)
|
||||
|
||||
|
||||
YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *parent) :
|
||||
QWidget(parent)
|
||||
QWidget(parent)
|
||||
{
|
||||
QHBoxLayout * mainLayout = new QHBoxLayout;
|
||||
mainLayout->setMargin(0);
|
||||
@ -67,15 +67,15 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *p
|
||||
QString styleSheet = "QWidget {border:0px;}";
|
||||
setStyleSheet(styleSheet);
|
||||
|
||||
nameLabel = new DropShadowLabel(this);
|
||||
nameLabel = new DropShadowLabel(this);
|
||||
nameLabel->setText(title);
|
||||
#ifdef Q_OS_MAC
|
||||
QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setColor(QColor("#707E8C"));
|
||||
QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setColor(QColor("#707E8C"));
|
||||
nameLabel->setDropShadowColor(QColor("#F9FAFB"));
|
||||
#else
|
||||
QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setColor(QColor("#BDBFBF"));
|
||||
QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setColor(QColor("#BDBFBF"));
|
||||
nameLabel->setDropShadowColor(QColor("#000000"));
|
||||
#endif
|
||||
nameLabel->setStyleSheet(nameLabelStyleSheet);
|
||||
@ -101,7 +101,7 @@ void YACReaderTitledToolBar::addAction(QAction * action)
|
||||
tb->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
|
||||
//tb->setStyleSheet("QToolButton:hover {background-color:#C5C5C5;}");
|
||||
|
||||
mainLayout->addWidget(tb);
|
||||
mainLayout->addWidget(tb);
|
||||
}
|
||||
|
||||
void YACReaderTitledToolBar::addSpacing(int spacing)
|
||||
|
Reference in New Issue
Block a user