Use theme as the color source for the completed decoration.

This commit is contained in:
Luis Ángel San Martín 2018-09-13 09:46:15 +02:00 committed by Luis Ángel San Martín
parent 58facbe744
commit ac0aa6ded5
2 changed files with 12 additions and 7 deletions

View File

@ -38,7 +38,6 @@ public:
"QListView::item:selected {background-color: #EFEFEF; color:#CCCCCC;}" "QListView::item:selected {background-color: #EFEFEF; color:#CCCCCC;}"
"QListView::item:hover {background-color:#F4F4F8; color:#757575; }" "QListView::item:hover {background-color:#F4F4F8; color:#757575; }"
"QScrollBar:vertical { border-radius:3px; background: #FFFFFF; width: 14px; margin: 0 10px 0 0; }" "QScrollBar:vertical { border-radius:3px; background: #FFFFFF; width: 14px; margin: 0 10px 0 0; }"
"QScrollBar::handle:vertical { border: 1px solid #999999; background: #999999; width: 14px; min-height: 20px; border-radius: 2px; }" "QScrollBar::handle:vertical { border: 1px solid #999999; background: #999999; width: 14px; min-height: 20px; border-radius: 2px; }"
"QScrollBar::add-line:vertical { border: none; background: #999999; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}" "QScrollBar::add-line:vertical { border: none; background: #999999; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}"
@ -56,6 +55,8 @@ public:
t.titledToolBarSeparatorColor = "#AFAFAF"; t.titledToolBarSeparatorColor = "#AFAFAF";
t.titledToolBarTitleColor = "#808080"; t.titledToolBarTitleColor = "#808080";
t.titledToolBarTitleShadowColor = "#00000000"; t.titledToolBarTitleShadowColor = "#00000000";
t.foldersViewCompletedColor = "#AABFFF";
} else { } else {
t.isMacosNative = false; t.isMacosNative = false;
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
@ -81,7 +82,6 @@ public:
"QListView::item:selected {background-color: #212121; color:#CCCCCC;}" "QListView::item:selected {background-color: #212121; color:#CCCCCC;}"
"QListView::item:hover {background-color:#212121; color:#CCCCCC; }" "QListView::item:hover {background-color:#212121; color:#CCCCCC; }"
"QScrollBar:vertical { border: none; background: #212121; width: 14px; margin: 0 10px 0 0; }" "QScrollBar:vertical { border: none; background: #212121; width: 14px; margin: 0 10px 0 0; }"
"QScrollBar::handle:vertical { background: #858585; width: 14px; min-height: 20px; }" "QScrollBar::handle:vertical { background: #858585; width: 14px; min-height: 20px; }"
"QScrollBar::add-line:vertical { border: none; background: #212121; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}" "QScrollBar::add-line:vertical { border: none; background: #212121; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}"
@ -102,6 +102,8 @@ public:
t.titledToolBarSeparatorColor = "#6F6F6F"; t.titledToolBarSeparatorColor = "#6F6F6F";
t.titledToolBarTitleColor = "#BDBFBF"; t.titledToolBarTitleColor = "#BDBFBF";
t.titledToolBarTitleShadowColor = "#000000"; t.titledToolBarTitleShadowColor = "#000000";
t.foldersViewCompletedColor = "#EDC542";
} }
return t; return t;
@ -139,6 +141,9 @@ public:
QString titledToolBarSeparatorColor; QString titledToolBarSeparatorColor;
QString titledToolBarTitleColor; QString titledToolBarTitleColor;
QString titledToolBarTitleShadowColor; QString titledToolBarTitleShadowColor;
//YACReaderFoldersView (tree view)
QString foldersViewCompletedColor;
}; };
#endif // THEME_H #endif // THEME_H

View File

@ -6,6 +6,8 @@
#include "comic.h" #include "comic.h"
#include "comic_files_manager.h" #include "comic_files_manager.h"
#include "theme.h"
#include "QsLog.h" #include "QsLog.h"
YACReaderFoldersView::YACReaderFoldersView(QWidget *parent) YACReaderFoldersView::YACReaderFoldersView(QWidget *parent)
@ -80,11 +82,9 @@ void YACReaderFoldersViewItemDeletegate::paint(QPainter *painter, const QStyleOp
{ {
if (!index.data(FolderModel::CompletedRole).toBool()) { if (!index.data(FolderModel::CompletedRole).toBool()) {
painter->save(); painter->save();
#ifdef Q_OS_MAC
painter->setBrush(QBrush(QColor(85, 95, 127))); painter->setBrush(QBrush(QColor(Theme::currentTheme().foldersViewCompletedColor)));
#else
painter->setBrush(QBrush(QColor(237, 197, 24)));
#endif
painter->setPen(QPen(QBrush(), 0)); painter->setPen(QPen(QBrush(), 0));
painter->drawRect(0, option.rect.y(), 2, option.rect.height()); painter->drawRect(0, option.rect.y(), 2, option.rect.height());
painter->restore(); painter->restore();