diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index e0290b98..e950c0c7 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -768,29 +768,27 @@ void Viewer::mouseMoveEvent(QMouseEvent * event) { if(showGoToFlowAnimation->state()!=QPropertyAnimation::Running) { - if(Configuration::getConfiguration().getDisableShowOnMouseOver()) + if(Configuration::getConfiguration().getDisableShowOnMouseOver() == false) { - return; + if(goToFlow->isVisible()) + { + QPoint gtfPos = goToFlow->mapFrom(this,event->pos()); + if(gtfPos.y() < 0 || gtfPos.x()<0 || gtfPos.x()>goToFlow->width())//TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken) + animateHideGoToFlow(); + //goToFlow->hide(); + } + else + { + int umbral = (width()-goToFlow->width())/2; + if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()stop(); + } + } } - - if(goToFlow->isVisible()) - { - QPoint gtfPos = goToFlow->mapFrom(this,event->pos()); - if(gtfPos.y() < 0 || gtfPos.x()<0 || gtfPos.x()>goToFlow->width())//TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken) - animateHideGoToFlow(); - //goToFlow->hide(); - } - else - { - int umbral = (width()-goToFlow->width())/2; - if((event->y()>height()-15)&&(event->x()>umbral)&&(event->x()stop(); - } - } - } + } if(drag) { diff --git a/YACReaderLibrary/grid_comics_view.cpp b/YACReaderLibrary/grid_comics_view.cpp index 250cf55a..7b35b600 100644 --- a/YACReaderLibrary/grid_comics_view.cpp +++ b/YACReaderLibrary/grid_comics_view.cpp @@ -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()); diff --git a/YACReaderLibrary/images_osx.qrc b/YACReaderLibrary/images_osx.qrc index 4cac9ddc..14398e66 100644 --- a/YACReaderLibrary/images_osx.qrc +++ b/YACReaderLibrary/images_osx.qrc @@ -15,6 +15,8 @@ ../images/main_toolbar/flow_osx@2x.png ../images/main_toolbar/grid_osx.png ../images/main_toolbar/grid_osx@2x.png + ../images/main_toolbar/info_osx.png + ../images/main_toolbar/info_osx@2x.png ../images/empty_folder_osx.png ../images/empty_search_osx.png ../images/iconSearch.png diff --git a/YACReaderLibrary/info_comics_view.cpp b/YACReaderLibrary/info_comics_view.cpp index 5912686b..44af8dc3 100644 --- a/YACReaderLibrary/info_comics_view.cpp +++ b/YACReaderLibrary/info_comics_view.cpp @@ -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(view->rootObject()); flow = rootObject->findChild("flow"); diff --git a/YACReaderLibrary/qml.qrc b/YACReaderLibrary/qml.qrc index 69bcc0fd..d3d279ea 100644 --- a/YACReaderLibrary/qml.qrc +++ b/YACReaderLibrary/qml.qrc @@ -10,6 +10,10 @@ qml/FlowView.qml qml/info-indicator.png qml/info-shadow.png + qml/info-indicator-light.png + qml/info-shadow-light.png + qml/info-indicator-light@2x.png + qml/info-shadow-light@2x.png qml/info-top-shadow.png qml/ComicInfo.qml qml/info-favorites.png diff --git a/YACReaderLibrary/qml/ComicInfo.qml b/YACReaderLibrary/qml/ComicInfo.qml index ce6f86e2..ea5b6ccb 100644 --- a/YACReaderLibrary/qml/ComicInfo.qml +++ b/YACReaderLibrary/qml/ComicInfo.qml @@ -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 diff --git a/YACReaderLibrary/qml/GridComicsView.qml b/YACReaderLibrary/qml/GridComicsView.qml index dc24bf83..56b45fde 100644 --- a/YACReaderLibrary/qml/GridComicsView.qml +++ b/YACReaderLibrary/qml/GridComicsView.qml @@ -587,7 +587,7 @@ Rectangle { Layout.maximumWidth: 960 height: parent.height - color: "#2e2e2e" + color: infoBackgroundColor visible: showInfo diff --git a/YACReaderLibrary/qml/InfoComicsView.qml b/YACReaderLibrary/qml/InfoComicsView.qml index 6ffb35c3..b6835de0 100644 --- a/YACReaderLibrary/qml/InfoComicsView.qml +++ b/YACReaderLibrary/qml/InfoComicsView.qml @@ -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 diff --git a/YACReaderLibrary/qml/InfoFavorites.qml b/YACReaderLibrary/qml/InfoFavorites.qml index daf6b956..d490ab17 100644 --- a/YACReaderLibrary/qml/InfoFavorites.qml +++ b/YACReaderLibrary/qml/InfoFavorites.qml @@ -26,7 +26,7 @@ Item { ColorOverlay { anchors.fill: favorites_button_compact source: favorites_button_compact - color: active ? "#e84852" : "#1c1c1c" + color: active ? favCheckedColor : favUncheckedColor } } diff --git a/YACReaderLibrary/qml/InfoRating.qml b/YACReaderLibrary/qml/InfoRating.qml index 9a2e5e76..d865358b 100644 --- a/YACReaderLibrary/qml/InfoRating.qml +++ b/YACReaderLibrary/qml/InfoRating.qml @@ -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 { diff --git a/YACReaderLibrary/qml/InfoTick.qml b/YACReaderLibrary/qml/InfoTick.qml index f52e5402..f91d65a8 100644 --- a/YACReaderLibrary/qml/InfoTick.qml +++ b/YACReaderLibrary/qml/InfoTick.qml @@ -23,7 +23,7 @@ Item { ColorOverlay { anchors.fill: read_compact source: read_compact - color: read ? "#e84852" : "#1c1c1c" + color: read ? readTickCheckedColor : readTickUncheckedColor } } diff --git a/YACReaderLibrary/qml/info-indicator-light.png b/YACReaderLibrary/qml/info-indicator-light.png new file mode 100644 index 00000000..b08a8ead Binary files /dev/null and b/YACReaderLibrary/qml/info-indicator-light.png differ diff --git a/YACReaderLibrary/qml/info-indicator-light@2x.png b/YACReaderLibrary/qml/info-indicator-light@2x.png new file mode 100644 index 00000000..38abb8c8 Binary files /dev/null and b/YACReaderLibrary/qml/info-indicator-light@2x.png differ diff --git a/YACReaderLibrary/qml/info-shadow-light.png b/YACReaderLibrary/qml/info-shadow-light.png new file mode 100644 index 00000000..e52f2c7a Binary files /dev/null and b/YACReaderLibrary/qml/info-shadow-light.png differ diff --git a/YACReaderLibrary/qml/info-shadow-light@2x.png b/YACReaderLibrary/qml/info-shadow-light@2x.png new file mode 100644 index 00000000..3abb75af Binary files /dev/null and b/YACReaderLibrary/qml/info-shadow-light@2x.png differ diff --git a/common/pdf_comic.cpp b/common/pdf_comic.cpp index aa95c7d7..cadc988c 100644 --- a/common/pdf_comic.cpp +++ b/common/pdf_comic.cpp @@ -17,7 +17,7 @@ PdfiumComic::~PdfiumComic() bool PdfiumComic::openComic(const QString & path) { - doc = FPDF_LoadDocument(path.toStdString().c_str(), NULL); + doc = FPDF_LoadDocument(path.toLocal8Bit().constData(), NULL); if (doc) { return true; diff --git a/common/yacreader_global_gui.h b/common/yacreader_global_gui.h index 46680c35..6c3f6ac5 100644 --- a/common/yacreader_global_gui.h +++ b/common/yacreader_global_gui.h @@ -92,6 +92,11 @@ static const QString YACReaderLibrarSubReadingListMimeDataFormat = "application/ //Text=0x05 }; + enum LibraryUITheme + { + Light, + Dark + }; void addSperator(QWidget * w); QAction * createSeparator(); diff --git a/images/main_toolbar/info_osx.png b/images/main_toolbar/info_osx.png new file mode 100644 index 00000000..17168990 Binary files /dev/null and b/images/main_toolbar/info_osx.png differ diff --git a/images/main_toolbar/info_osx@2x.png b/images/main_toolbar/info_osx@2x.png new file mode 100644 index 00000000..4f78fefb Binary files /dev/null and b/images/main_toolbar/info_osx@2x.png differ