diff --git a/YACReaderLibrary/images.qrc b/YACReaderLibrary/images.qrc index 5bb0e507..4ff01248 100644 --- a/YACReaderLibrary/images.qrc +++ b/YACReaderLibrary/images.qrc @@ -104,5 +104,9 @@ ../images/libraryIcon.png ../images/libraryIconSelected.png ../images/libraryOptions.png + ../images/branch-open.png + ../images/branch-closed.png + ../images/expanded_branch_selected.png + ../images/collapsed_branch_selected.png diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 8f405d69..af219caa 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -190,6 +190,31 @@ void LibraryWindow::doLayout() "QTreeView::branch:selected {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;}" "QTreeView::branch:open:selected:has-children {image: url(':/images/expanded_branch_osx.png');}" "QTreeView::branch:closed:selected:has-children {image: url(':/images/collapsed_branch_osx.png');}"); +#else + foldersView->setStyleSheet("QTreeView {background-color:transparent; border: none; color:#DDDFDF; outline:0;}" + "QTreeView::item:selected {background-color: #2E2E2E; color:white; font:bold;}" + "QTreeView::item:hover {background-color:#2E2E2E; color:white; font:bold;}" + "QTreeView::branch:selected {background-color:#2E2E2E;}" + + + "QScrollBar:vertical { border: none; background: #222222; width: 7px; margin: 0 3px 0 0; }" + "QScrollBar::handle:vertical { background: #DDDDDD; width: 7px; min-height: 20px; }" + "QScrollBar::add-line:vertical { border: none; background: #222222; height: 10px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}" + + "QScrollBar::sub-line:vertical { border: none; background: #222222; height: 10px; subcontrol-position: top; subcontrol-origin: margin; margin: 0 3px 0 0;}" + "QScrollBar::up-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-up.png') center top no-repeat;}" + "QScrollBar::down-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-down.png') center top no-repeat;}" + + "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none; }" + + "QTreeView::branch:has-children:!has-siblings:closed,QTreeView::branch:closed:has-children:has-siblings {border-image: none;image: url(':/images/branch-closed.png');}" + "QTreeView::branch:has-children:selected:!has-siblings:closed,QTreeView::branch:closed:selected:has-children:has-siblings {border-image: none;image: url(':/images/collapsed_branch_selected.png');}" + + "QTreeView::branch:open:has-children:!has-siblings,QTreeView::branch:open:has-children:has-siblings {border-image: none;image: url(':/images/branch-open.png');}" + "QTreeView::branch:open:has-children:selected:!has-siblings,QTreeView::branch:open:has-children:selected:has-siblings {border-image: none;image: url(':/images/expanded_branch_selected.png');}" + + + ); #endif sideBar = new YACReaderSideBar; QVBoxLayout * l = new QVBoxLayout; @@ -197,11 +222,8 @@ void LibraryWindow::doLayout() selectedLibrary->setContextMenuPolicy(Qt::ActionsContextMenu); selectedLibrary->setAttribute(Qt::WA_MacShowFocusRect,false); selectedLibrary->setFocusPolicy(Qt::NoFocus); -#ifdef Q_OS_MAC + l->setContentsMargins(0,0,0,0); -#else - l->setContentsMargins(sHorizontal->handleWidth(),0,0,0); -#endif YACReaderTitledToolBar * librariesTitle = new YACReaderTitledToolBar(tr("LIBRARIES")); @@ -228,7 +250,7 @@ void LibraryWindow::doLayout() searchLayout->addLayout(filter); l->addLayout(searchLayout); - l->setSpacing(1); + l->setSpacing(0); sideBar->setLayout(l); //FINAL LAYOUT------------------------------------------------------------- diff --git a/custom_widgets/yacreader_library_item_widget.cpp b/custom_widgets/yacreader_library_item_widget.cpp index a4b40407..dbb03044 100644 --- a/custom_widgets/yacreader_library_item_widget.cpp +++ b/custom_widgets/yacreader_library_item_widget.cpp @@ -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); diff --git a/custom_widgets/yacreader_sidebar.cpp b/custom_widgets/yacreader_sidebar.cpp index 1cbc0973..9dfc7fc5 100644 --- a/custom_widgets/yacreader_sidebar.cpp +++ b/custom_widgets/yacreader_sidebar.cpp @@ -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 diff --git a/custom_widgets/yacreader_table_view.cpp b/custom_widgets/yacreader_table_view.cpp index bc4a0f98..2f87e657 100644 --- a/custom_widgets/yacreader_table_view.cpp +++ b/custom_widgets/yacreader_table_view.cpp @@ -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 diff --git a/custom_widgets/yacreader_titled_toolbar.cpp b/custom_widgets/yacreader_titled_toolbar.cpp index 1d8e2cf5..ea3b8ad1 100644 --- a/custom_widgets/yacreader_titled_toolbar.cpp +++ b/custom_widgets/yacreader_titled_toolbar.cpp @@ -5,6 +5,40 @@ #include #include #include +#include + + + +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); diff --git a/custom_widgets/yacreader_titled_toolbar.h b/custom_widgets/yacreader_titled_toolbar.h index 848bfa62..35fda80e 100644 --- a/custom_widgets/yacreader_titled_toolbar.h +++ b/custom_widgets/yacreader_titled_toolbar.h @@ -2,9 +2,28 @@ #define YACREADER_TITLED_TOOLBAR_H #include +#include +#include +#include +#include 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 diff --git a/images/branch-closed.png b/images/branch-closed.png new file mode 100644 index 00000000..5903e65b Binary files /dev/null and b/images/branch-closed.png differ diff --git a/images/branch-open.png b/images/branch-open.png new file mode 100644 index 00000000..4a25b96f Binary files /dev/null and b/images/branch-open.png differ diff --git a/images/colapse.png b/images/colapse.png index 2f1ce901..b70c8171 100644 Binary files a/images/colapse.png and b/images/colapse.png differ diff --git a/images/collapsed_branch_selected.png b/images/collapsed_branch_selected.png new file mode 100644 index 00000000..9c6c6a6d Binary files /dev/null and b/images/collapsed_branch_selected.png differ diff --git a/images/expand.png b/images/expand.png index 84a89060..36a41fba 100644 Binary files a/images/expand.png and b/images/expand.png differ diff --git a/images/expanded_branch_selected.png b/images/expanded_branch_selected.png new file mode 100644 index 00000000..89669762 Binary files /dev/null and b/images/expanded_branch_selected.png differ diff --git a/images/folder.png b/images/folder.png index b103e43f..22262293 100644 Binary files a/images/folder.png and b/images/folder.png differ diff --git a/images/libraryIcon.png b/images/libraryIcon.png index d2cc7112..fdee3b28 100644 Binary files a/images/libraryIcon.png and b/images/libraryIcon.png differ diff --git a/images/setRoot.png b/images/setRoot.png index b1bd897c..da846f78 100644 Binary files a/images/setRoot.png and b/images/setRoot.png differ