Enabled light theme for info views in osx.

This commit is contained in:
Luis Ángel San Martín 2017-04-24 21:53:55 +02:00
parent 22971c330c
commit 689a782d5a
9 changed files with 163 additions and 60 deletions

View File

@ -52,35 +52,87 @@ GridComicsView::GridComicsView(QWidget *parent) :
QQmlContext *ctxt = view->rootContext();
LibraryUITheme theme;
#ifdef Q_OS_MAC
theme = Light
#else
theme = Dark;
#endif
if(theme == Light)
{
ctxt->setContextProperty("backgroundColor", "#F6F6F6");
ctxt->setContextProperty("cellColor", "#FFFFFF");
ctxt->setContextProperty("selectedColor", "#FFFFFF");
ctxt->setContextProperty("selectedBorderColor", "#007AFF");
ctxt->setContextProperty("borderColor", "#DBDBDB");
ctxt->setContextProperty("titleColor", "#121212");
ctxt->setContextProperty("textColor", "#636363");
//fonts settings
ctxt->setContextProperty("fontSize", 11);
ctxt->setContextProperty("fontFamily", QApplication::font().family());
ctxt->setContextProperty("fontSpacing", 0.5);
//info - copy/pasted from info_comics_view TODO create helpers for setting the UI config
ctxt->setContextProperty("infoBackgroundColor", "#FFFFFF");
ctxt->setContextProperty("topShadow", QUrl());
ctxt->setContextProperty("infoShadow", "info-shadow-light.png");
ctxt->setContextProperty("infoIndicator", "info-indicator-light.png");
ctxt->setContextProperty("infoTextColor", "#404040");
ctxt->setContextProperty("infoTitleColor", "#2E2E2E");
ctxt->setContextProperty("ratingUnselectedColor", "#DEDEDE");
ctxt->setContextProperty("ratingSelectedColor", "#2B2B2B");
ctxt->setContextProperty("favUncheckedColor", "#DEDEDE");
ctxt->setContextProperty("favCheckedColor", "#E84852");
ctxt->setContextProperty("readTickUncheckedColor", "#DEDEDE");
ctxt->setContextProperty("readTickCheckedColor", "#E84852");
}
else
{
ctxt->setContextProperty("backgroundColor", "#2A2A2A");
ctxt->setContextProperty("cellColor", "#212121");
ctxt->setContextProperty("selectedColor", "#121212");
ctxt->setContextProperty("selectedBorderColor", "#121212");
ctxt->setContextProperty("borderColor", "#121212");
ctxt->setContextProperty("titleColor", "#FFFFFF");
ctxt->setContextProperty("textColor", "#A8A8A8");
ctxt->setContextProperty("dropShadow",false);
//fonts settings
int fontSize = QApplication::font().pointSize();
if(fontSize == -1)
fontSize = QApplication::font().pixelSize();
ctxt->setContextProperty("fontSize", fontSize);
ctxt->setContextProperty("fontFamily", QApplication::font().family());
ctxt->setContextProperty("fontSpacing", 0.5);
//info - copy/pasted from info_comics_view TODO create helpers for setting the UI config
ctxt->setContextProperty("infoBackgroundColor", "#2E2E2E");
ctxt->setContextProperty("topShadow", "info-top-shadow.png");
ctxt->setContextProperty("infoShadow", "info-shadow.png");
ctxt->setContextProperty("infoIndicator", "info-indicator.png");
ctxt->setContextProperty("infoTextColor", "#B0B0B0");
ctxt->setContextProperty("infoTitleColor", "#FFFFFF");
ctxt->setContextProperty("ratingUnselectedColor", "#1C1C1C");
ctxt->setContextProperty("ratingSelectedColor", "#FFFFFF");
ctxt->setContextProperty("favUncheckedColor", "#1C1C1C");
ctxt->setContextProperty("favCheckedColor", "#E84852");
ctxt->setContextProperty("readTickUncheckedColor", "#1C1C1C");
ctxt->setContextProperty("readTickCheckedColor", "#E84852");
}
#ifdef Q_OS_MAC
ctxt->setContextProperty("backgroundColor", "#F6F6F6");
ctxt->setContextProperty("cellColor", "#FFFFFF");
ctxt->setContextProperty("selectedColor", "#FFFFFF");
ctxt->setContextProperty("selectedBorderColor", "#007AFF");
ctxt->setContextProperty("borderColor", "#DBDBDB");
ctxt->setContextProperty("titleColor", "#121212");
ctxt->setContextProperty("textColor", "#636363");
//fonts settings
ctxt->setContextProperty("fontSize", 11);
ctxt->setContextProperty("fontFamily", QApplication::font().family());
ctxt->setContextProperty("fontSpacing", 0.5);
#else
ctxt->setContextProperty("backgroundColor", "#2A2A2A");
ctxt->setContextProperty("cellColor", "#212121");
ctxt->setContextProperty("selectedColor", "#121212");
ctxt->setContextProperty("selectedBorderColor", "#121212");
ctxt->setContextProperty("borderColor", "#121212");
ctxt->setContextProperty("titleColor", "#FFFFFF");
ctxt->setContextProperty("textColor", "#A8A8A8");
ctxt->setContextProperty("dropShadow",false);
//fonts settings
int fontSize = QApplication::font().pointSize();
if(fontSize == -1)
fontSize = QApplication::font().pixelSize();
ctxt->setContextProperty("fontSize", fontSize);
ctxt->setContextProperty("fontFamily", QApplication::font().family());
ctxt->setContextProperty("fontSpacing", 0.5);
#endif
ctxt->setContextProperty("backgroundImage", QUrl());

View File

@ -23,8 +23,55 @@ InfoComicsView::InfoComicsView(QWidget *parent)
container->setFocusPolicy(Qt::StrongFocus);
view->setSource(QUrl("qrc:/qml/InfoComicsView.qml"));
QQmlContext *ctxt = view->rootContext();
LibraryUITheme theme;
#ifdef Q_OS_MAC
theme = Light
#else
theme = Dark;
#endif
if(theme == Light)
{
ctxt->setContextProperty("infoBackgroundColor", "#FFFFFF");
ctxt->setContextProperty("topShadow", QUrl());
ctxt->setContextProperty("infoShadow", "info-shadow-light.png");
ctxt->setContextProperty("infoIndicator", "info-indicator-light.png");
ctxt->setContextProperty("infoTextColor", "#404040");
ctxt->setContextProperty("infoTitleColor", "#2E2E2E");
ctxt->setContextProperty("ratingUnselectedColor", "#DEDEDE");
ctxt->setContextProperty("ratingSelectedColor", "#2B2B2B");
ctxt->setContextProperty("favUncheckedColor", "#DEDEDE");
ctxt->setContextProperty("favCheckedColor", "#E84852");
ctxt->setContextProperty("readTickUncheckedColor", "#DEDEDE");
ctxt->setContextProperty("readTickCheckedColor", "#E84852");
}
else
{
ctxt->setContextProperty("infoBackgroundColor", "#2E2E2E");
ctxt->setContextProperty("topShadow", "info-top-shadow.png");
ctxt->setContextProperty("infoShadow", "info-shadow.png");
ctxt->setContextProperty("infoIndicator", "info-indicator.png");
ctxt->setContextProperty("infoTextColor", "#B0B0B0");
ctxt->setContextProperty("infoTitleColor", "#FFFFFF");
ctxt->setContextProperty("ratingUnselectedColor", "#1C1C1C");
ctxt->setContextProperty("ratingSelectedColor", "#FFFFFF");
ctxt->setContextProperty("favUncheckedColor", "#1C1C1C");
ctxt->setContextProperty("favCheckedColor", "#E84852");
ctxt->setContextProperty("readTickUncheckedColor", "#1C1C1C");
ctxt->setContextProperty("readTickCheckedColor", "#E84852");
}
view->setSource(QUrl("qrc:/qml/InfoComicsView.qml"));
QObject *rootObject = dynamic_cast<QObject*>(view->rootObject());
flow = rootObject->findChild<QObject*>("flow");

View File

@ -10,6 +10,10 @@
<file>qml/FlowView.qml</file>
<file>qml/info-indicator.png</file>
<file>qml/info-shadow.png</file>
<file>qml/info-indicator-light.png</file>
<file>qml/info-shadow-light.png</file>
<file>qml/info-indicator-light@2x.png</file>
<file>qml/info-shadow-light@2x.png</file>
<file>qml/info-top-shadow.png</file>
<file>qml/ComicInfo.qml</file>
<file>qml/info-favorites.png</file>

View File

@ -15,7 +15,7 @@ Rectangle {
height: info.height + 2 * topMargin
property string infoColor: "#b0b0b0"
property string infoColor: infoTextColor
property font infoFont: Qt.font({
family: "Arial",
@ -136,7 +136,7 @@ Rectangle {
id: title
color: "#ffffff"
color: infoTitleColor
font.family: "Arial"
font.bold: true
font.pixelSize: mainContainer.compact ? 18 : 21;
@ -232,7 +232,7 @@ Rectangle {
}
Text {
id: showInComicVinw
id: showInComicVine
font: mainContainer.infoFont
color: "#ffcc00"
text: "Show in Comic Vine"
@ -253,7 +253,7 @@ Rectangle {
Layout.fillWidth: true
id: sinopsis
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
wrapMode: Text.WordWrap
@ -267,7 +267,7 @@ Rectangle {
Layout.bottomMargin: 5
id: authors_title
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 18
font.bold: true
@ -290,7 +290,7 @@ Rectangle {
model: comicInfo.getWriters().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -298,7 +298,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -312,7 +312,7 @@ Rectangle {
model: comicInfo.getPencillers().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -320,7 +320,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -334,7 +334,7 @@ Rectangle {
model: comicInfo.getInkers().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -342,7 +342,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -356,7 +356,7 @@ Rectangle {
model: comicInfo.getColorists().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -364,7 +364,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -378,7 +378,7 @@ Rectangle {
model: comicInfo.getLetterers().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -386,7 +386,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -400,7 +400,7 @@ Rectangle {
model: comicInfo.getCoverArtists().length
Column{
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -408,7 +408,7 @@ Rectangle {
}
Text {
color: "#b0b0b0"
color: infoTextColor
font.family: "Arial"
font.pixelSize: 13
font.italic: true
@ -422,7 +422,7 @@ Rectangle {
Layout.topMargin: 25
id: publisher_title
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 18
font.bold: true
@ -439,7 +439,7 @@ Rectangle {
Text {
id: publisher
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -451,7 +451,7 @@ Rectangle {
Text {
id: format
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -463,7 +463,7 @@ Rectangle {
Text {
id: color
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -475,7 +475,7 @@ Rectangle {
Text {
id: age_rating
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15
@ -490,7 +490,7 @@ Rectangle {
Layout.bottomMargin: 5
id: characters_title
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 18
font.bold: true
@ -508,7 +508,7 @@ Rectangle {
model: comicInfo.getCharacters().length
Text {
color: "white"
color: infoTitleColor
font.family: "Arial"
font.pixelSize: 15

View File

@ -587,7 +587,7 @@ Rectangle {
Layout.maximumWidth: 960
height: parent.height
color: "#2e2e2e"
color: infoBackgroundColor
visible: showInfo

View File

@ -9,7 +9,7 @@ import com.yacreader.ComicModel 1.0
Rectangle {
id: main
color: "#2e2e2e"
color: infoBackgroundColor
width: parent.width
height: parent.height
@ -29,7 +29,7 @@ Rectangle {
Image {
id: top_shadow
source: "info-top-shadow.png"
source: topShadow
width: parent.width
fillMode: Image.TileHorizontally
}
@ -41,14 +41,14 @@ Rectangle {
Image {
id: indicator
source: "info-indicator.png"
source: infoIndicator
}
Image {
id: bottom_shadow
x: indicator.width
width: parent.width - indicator.width
source: "info-shadow.png"
source: infoShadow
fillMode: Image.TileHorizontally
}
}
@ -59,7 +59,7 @@ Rectangle {
y: flow.height + flow.additionalBottomSpace - 6
height: parent.height - y
color: "#2e2e2e"
color: infoBackgroundColor
ScrollView {
__wheelAreaScrollSpeed: 75

View File

@ -26,7 +26,7 @@ Item {
ColorOverlay {
anchors.fill: favorites_button_compact
source: favorites_button_compact
color: active ? "#e84852" : "#1c1c1c"
color: active ? favCheckedColor : favUncheckedColor
}
}

View File

@ -24,7 +24,7 @@ Row {
ColorOverlay {
anchors.fill: star
source: star
color: index < (mouseIndex > 0 ? mouseIndex : rating) ? "#ffffff" : "#1c1c1c"
color: index < (mouseIndex > 0 ? mouseIndex : rating) ? ratingSelectedColor : ratingUnselectedColor
}
MouseArea {

View File

@ -23,7 +23,7 @@ Item {
ColorOverlay {
anchors.fill: read_compact
source: read_compact
color: read ? "#e84852" : "#1c1c1c"
color: read ? readTickCheckedColor : readTickUncheckedColor
}
}