mirror of
https://github.com/YACReader/yacreader
synced 2025-07-27 01:15:07 -04:00
nuevo estilo para windows y linux de la sidebar
This commit is contained in:
@ -48,9 +48,10 @@ YACReaderLibraryItemWidget::YACReaderLibraryItemWidget(QString n/*ame*/, QString
|
||||
mainLayout->addWidget(down);*/
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
//QString styleSheet = " background-color:#454545; border-top: 1px solid #454545;border-bottom: 1px solid #454545;";
|
||||
//setStyleSheet(styleSheet);
|
||||
#ifndef Q_OS_MAC
|
||||
QString styleSheet = "background-color:transparent; color:#DDDFDF;";
|
||||
setStyleSheet(styleSheet);
|
||||
#endif
|
||||
|
||||
|
||||
QString iconStyleSheet = "QLabel {padding:0 0 0 24px; margin:0px}";
|
||||
@ -109,8 +110,14 @@ bool YACReaderLibraryItemWidget::eventFilter(QObject *object, QEvent *event){
|
||||
|
||||
void YACReaderLibraryItemWidget::deselect()
|
||||
{
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QString styleSheet = "background-color:transparent;";
|
||||
setStyleSheet(styleSheet);
|
||||
#else
|
||||
QString styleSheet = "background-color:transparent; color:#DDDFDF;";
|
||||
setStyleSheet(styleSheet);
|
||||
#endif
|
||||
|
||||
QPixmap iconPixmap(":/images/libraryIcon.png");
|
||||
icon->setPixmap(iconPixmap);
|
||||
@ -129,7 +136,7 @@ void YACReaderLibraryItemWidget::select()
|
||||
#ifdef Q_OS_MAC
|
||||
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;";
|
||||
#else
|
||||
QString styleSheet = "color: white; background-color:#BBBBBB; font-weight:bold;";
|
||||
QString styleSheet = "color: white; background-color:#2E2E2E; font-weight:bold;";
|
||||
#endif
|
||||
setStyleSheet(styleSheet);
|
||||
|
||||
|
@ -24,7 +24,10 @@ void YACReaderSideBar::paintEvent(QPaintEvent * event)
|
||||
|
||||
painter.fillRect(0,0,width(),height(),lG);
|
||||
#else
|
||||
QWidget::paintEvent(event);
|
||||
QPainter painter(this);
|
||||
|
||||
painter.fillRect(0,0,width(),height(),QColor("#454545"));
|
||||
//QWidget::paintEvent(event);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -14,8 +14,9 @@ YACReaderTableView::YACReaderTableView(QWidget *parent) :
|
||||
setStyleSheet("QTableView {alternate-background-color: #F2F2F2;background-color: #FAFAFA; outline: 0px;}"// border: 1px solid #999999; border-right:none; border-bottom:none;}"
|
||||
"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:none;border-right:none;}"
|
||||
#ifdef Q_OS_MAC
|
||||
"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; }"
|
||||
|
||||
#else
|
||||
|
@ -5,6 +5,40 @@
|
||||
#include <QPixmap>
|
||||
#include <QToolButton>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QPainter>
|
||||
|
||||
|
||||
|
||||
DropShadowLabel::DropShadowLabel(QWidget* parent) :
|
||||
QLabel(parent)
|
||||
{ }
|
||||
|
||||
void DropShadowLabel::drawTextEffect(QPainter *painter,
|
||||
QPoint offset)
|
||||
{
|
||||
Q_ASSERT(painter != 0);
|
||||
|
||||
// Draw shadow.
|
||||
painter->setPen(QPen(dropShadowColor));
|
||||
painter->drawText(rect().translated(offset),
|
||||
alignment(), text());
|
||||
}
|
||||
|
||||
void DropShadowLabel::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.setFont(font());
|
||||
//TODO find where is the '3' comming from?
|
||||
drawTextEffect(&painter, QPoint(contentsMargins().left()+3, 1));
|
||||
QLabel::paintEvent(event);
|
||||
}
|
||||
|
||||
void DropShadowLabel::setDropShadowColor(const QColor & color)
|
||||
{
|
||||
dropShadowColor = color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *parent) :
|
||||
QWidget(parent)
|
||||
@ -16,11 +50,14 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *p
|
||||
QString styleSheet = "QWidget {border:0px;}";
|
||||
setStyleSheet(styleSheet);
|
||||
|
||||
QLabel * nameLabel = new QLabel(title,this);
|
||||
DropShadowLabel * nameLabel = new DropShadowLabel(this);
|
||||
nameLabel->setText(title);
|
||||
#ifdef Q_OS_MAC
|
||||
QString nameLabelStyleSheet = "QLabel {color:#707E8C; padding:0 0 0 7px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setDropShadowColor(QColor("#F9FAFB"));
|
||||
#else
|
||||
QString nameLabelStyleSheet = "QLabel {color:#656565; padding:0 0 0 0px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
QString nameLabelStyleSheet = "QLabel {color:#BDBFBF; padding:0 0 0 7px; margin:0px; font-size:11px; font-weight:bold;}";
|
||||
nameLabel->setDropShadowColor(QColor("#000000"));
|
||||
#endif
|
||||
nameLabel->setStyleSheet(nameLabelStyleSheet);
|
||||
|
||||
|
@ -2,9 +2,28 @@
|
||||
#define YACREADER_TITLED_TOOLBAR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPoint>
|
||||
|
||||
class QIcon;
|
||||
|
||||
class DropShadowLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
DropShadowLabel(QWidget* parent = 0);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void setDropShadowColor(const QColor & color);
|
||||
private:
|
||||
|
||||
QColor dropShadowColor;
|
||||
void drawTextEffect(QPainter* painter, QPoint offset);
|
||||
};
|
||||
|
||||
class YACReaderTitledToolBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
Reference in New Issue
Block a user