diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 179540e4..41092953 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -472,7 +472,7 @@ QAction *MainWindowViewer::addActionWithShortcut(const QString &text, const QStr void MainWindowViewer::createToolBars() { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI comicToolBar = new YACReaderMacOSXToolbar(this); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) comicToolBar->setIconSize(QSize(18, 18)); @@ -481,12 +481,12 @@ void MainWindowViewer::createToolBars() comicToolBar = addToolBar(tr("&File")); #endif -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI comicToolBar->setStyleSheet("QToolBar{border:none;}"); comicToolBar->setIconSize(QSize(18, 18)); #endif -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/open")), openAction)); comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/openFolder")), openFolderAction)); #else @@ -564,7 +564,7 @@ void MainWindowViewer::createToolBars() comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/flow")), showFlowAction)); comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/info")), showInfoAction)); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI comicToolBar->addStretch(); #else comicToolBar->addWidget(new YACReaderToolBarStretch()); @@ -574,7 +574,7 @@ void MainWindowViewer::createToolBars() comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/options")), optionsAction)); comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/help")), helpAboutAction)); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI comicToolBar->setMovable(false); #endif @@ -1061,7 +1061,7 @@ void MainWindowViewer::toggleToolBars() toolbars ? hideToolBars() : showToolBars(); Configuration::getConfiguration().setShowToolbars(toolbars); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI comicToolBar->setMovable(false); #endif } @@ -1289,7 +1289,7 @@ void MainWindowViewer::toggleFitToWidthSlider() { int y; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI y = 0; #else y = this->comicToolBar->frameSize().height(); diff --git a/YACReader/main_window_viewer.h b/YACReader/main_window_viewer.h index dda77f13..03ebcd76 100644 --- a/YACReader/main_window_viewer.h +++ b/YACReader/main_window_viewer.h @@ -8,12 +8,13 @@ #include #include -#ifdef Q_OS_MAC +#include "yacreader_global.h" + +#ifdef Y_MAC_UI #include "yacreader_macosx_toolbar.h" #endif #include "comic_db.h" -#include "yacreader_global.h" class Comic; class Viewer; @@ -102,7 +103,7 @@ private: EditShortcutsDialog *editShortcutsDialog; //! ToolBars -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI YACReaderMacOSXToolbar *comicToolBar; #else QToolBar *comicToolBar; diff --git a/YACReader/notifications_label_widget.cpp b/YACReader/notifications_label_widget.cpp index d450e84b..17e4859a 100644 --- a/YACReader/notifications_label_widget.cpp +++ b/YACReader/notifications_label_widget.cpp @@ -28,7 +28,7 @@ NotificationsLabelWidget::NotificationsLabelWidget(QWidget *parent) textLabel->setFixedSize(200, 120); - // TODO check if the effects still be broken in OSX yet + // TODO check if the effects are still broken in OSX #ifndef Q_OS_MAC this->setGraphicsEffect(effect); #endif diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 34598e47..5740983b 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -952,7 +952,7 @@ void Viewer::configureContent(QString msg) void Viewer::hideCursor() { -#ifdef Q_OS_MAC +#ifdef Q_OS_MAC // TODO_Y_MAC_UI isn't BlankCursor supported in macos? setCursor(QCursor(QBitmap(1, 1), QBitmap(1, 1))); #else setCursor(Qt::BlankCursor); diff --git a/YACReaderLibrary/classic_comics_view.cpp b/YACReaderLibrary/classic_comics_view.cpp index 1121074a..772149f7 100644 --- a/YACReaderLibrary/classic_comics_view.cpp +++ b/YACReaderLibrary/classic_comics_view.cpp @@ -1,5 +1,7 @@ #include "classic_comics_view.h" +#include "yacreader_global.h" + #include "QStackedWidget" #include "comic_flow_widget.h" @@ -78,7 +80,7 @@ ClassicComicsView::ClassicComicsView(QWidget *parent) layout->setContentsMargins(0, 0, 0, 0); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI sVertical->setCollapsible(1, false); #endif diff --git a/YACReaderLibrary/comics_view_transition.cpp b/YACReaderLibrary/comics_view_transition.cpp index 447e86cc..bde188b3 100644 --- a/YACReaderLibrary/comics_view_transition.cpp +++ b/YACReaderLibrary/comics_view_transition.cpp @@ -8,12 +8,12 @@ #include #include -#include "yacreader_global_gui.h" +#include "yacreader_global.h" ComicsViewTransition::ComicsViewTransition(QWidget *parent) : QWidget(parent) { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI setStyleSheet("QWidget {background:#FFFFFF}"); #else setStyleSheet("QWidget {background:#2A2A2A}"); @@ -24,7 +24,7 @@ void ComicsViewTransition::paintEvent(QPaintEvent *) { QPainter painter(this); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI painter.fillRect(0, 0, width(), height(), QColor("#FFFFFF")); #else painter.fillRect(0, 0, width(), height(), QColor("#2A2A2A")); diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index 28c19634..b61009ec 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -5,13 +5,15 @@ #include "folder.h" #include "db_helper.h" #include "qnaturalsorting.h" + +#include "yacreader_global.h" #include "yacreader_global_gui.h" #include #include -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI #include QIcon finishedFolderIcon; void drawMacOSXFinishedFolderIcon() @@ -134,7 +136,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const } if (role == Qt::DecorationRole) { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI if (item->data(FolderModel::Finished).toBool()) { if (finishedFolderIcon.isNull()) { drawMacOSXFinishedFolderIcon(); diff --git a/YACReaderLibrary/db/reading_list_item.cpp b/YACReaderLibrary/db/reading_list_item.cpp index a7b7edff..fc3c6a5d 100644 --- a/YACReaderLibrary/db/reading_list_item.cpp +++ b/YACReaderLibrary/db/reading_list_item.cpp @@ -136,7 +136,7 @@ QIcon ReadingListItem::getIcon() const if (parent->getId() == 0) return list; // top level list else -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI return QFileIconProvider().icon(QFileIconProvider::Folder); #else return folder; // sublist diff --git a/YACReaderLibrary/empty_container_info.cpp b/YACReaderLibrary/empty_container_info.cpp index 9dbb5231..5fb1d514 100644 --- a/YACReaderLibrary/empty_container_info.cpp +++ b/YACReaderLibrary/empty_container_info.cpp @@ -1,9 +1,11 @@ #include "empty_container_info.h" +#include "yacreader_global.h" + EmptyContainerInfo::EmptyContainerInfo(QWidget *parent) : QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel()) { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI backgroundColor = "#FFFFFF"; titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}"); #else diff --git a/YACReaderLibrary/empty_folder_widget.cpp b/YACReaderLibrary/empty_folder_widget.cpp index a267bd7c..a2bb1d13 100644 --- a/YACReaderLibrary/empty_folder_widget.cpp +++ b/YACReaderLibrary/empty_folder_widget.cpp @@ -1,5 +1,7 @@ #include "empty_folder_widget.h" +#include "yacreader_global.h" + #include #include #include @@ -77,7 +79,7 @@ EmptyFolderWidget::EmptyFolderWidget(QWidget *parent) foldersView = new QListView(); foldersView->setAttribute(Qt::WA_MacShowFocusRect, false); foldersView->setItemDelegate(new ListviewDelegate); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI foldersView->setStyleSheet("QListView {background-color:transparent; border: none; color:#959595; outline:0; font-size: 18px; show-decoration-selected: 0; margin:0}" "QListView::item:selected {background-color: #EFEFEF; color:#CCCCCC;}" "QListView::item:hover {background-color:#F4F4F8; color:#757575; }" diff --git a/YACReaderLibrary/folder_content_view.cpp b/YACReaderLibrary/folder_content_view.cpp index cfc7b3de..d546b91b 100644 --- a/YACReaderLibrary/folder_content_view.cpp +++ b/YACReaderLibrary/folder_content_view.cpp @@ -2,6 +2,7 @@ #include "folder_model.h" #include "grid_comics_view.h" +#include "yacreader_global.h" #include "yacreader_global_gui.h" #include "yacreader_tool_bar_stretch.h" @@ -77,7 +78,7 @@ FolderContentView::FolderContentView(QAction *toogleRecentVisibilityAction, QWid QQmlContext *ctxt = view->rootContext(); LibraryUITheme theme; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI theme = Light; #else theme = Dark; diff --git a/YACReaderLibrary/grid_comics_view.cpp b/YACReaderLibrary/grid_comics_view.cpp index 4f3548d6..c490e775 100644 --- a/YACReaderLibrary/grid_comics_view.cpp +++ b/YACReaderLibrary/grid_comics_view.cpp @@ -30,7 +30,7 @@ GridComicsView::GridComicsView(QWidget *parent) QQmlContext *ctxt = view->rootContext(); LibraryUITheme theme; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI theme = Light; #else theme = Dark; @@ -44,6 +44,7 @@ GridComicsView::GridComicsView(QWidget *parent) ctxt->setContextProperty("borderColor", "#DBDBDB"); ctxt->setContextProperty("titleColor", "#121212"); ctxt->setContextProperty("textColor", "#636363"); + ctxt->setContextProperty("showDropShadow", QVariant(false)); // fonts settings ctxt->setContextProperty("fontSize", 11); ctxt->setContextProperty("fontFamily", QApplication::font().family()); @@ -66,15 +67,17 @@ GridComicsView::GridComicsView(QWidget *parent) ctxt->setContextProperty("readTickUncheckedColor", "#DEDEDE"); ctxt->setContextProperty("readTickCheckedColor", "#E84852"); + + ctxt->setContextProperty("currentComicBackgroundColor", "#88FFFFFF"); } else { ctxt->setContextProperty("backgroundColor", "#2A2A2A"); ctxt->setContextProperty("cellColor", "#212121"); ctxt->setContextProperty("selectedColor", "#121212"); - ctxt->setContextProperty("selectedBorderColor", "#121212"); + ctxt->setContextProperty("selectedBorderColor", "#FFCC00"); ctxt->setContextProperty("borderColor", "#121212"); ctxt->setContextProperty("titleColor", "#FFFFFF"); ctxt->setContextProperty("textColor", "#A8A8A8"); - ctxt->setContextProperty("dropShadow", QVariant(false)); + ctxt->setContextProperty("showDropShadow", QVariant(true)); // fonts settings int fontSize = QApplication::font().pointSize(); if (fontSize == -1) @@ -100,14 +103,10 @@ GridComicsView::GridComicsView(QWidget *parent) ctxt->setContextProperty("readTickUncheckedColor", "#1C1C1C"); ctxt->setContextProperty("readTickCheckedColor", "#E84852"); + + ctxt->setContextProperty("currentComicBackgroundColor", "#88000000"); } -#ifdef Q_OS_MAC - -#else - -#endif - ctxt->setContextProperty("backgroundImage", QUrl()); ctxt->setContextProperty("backgroundBlurOpacity", 0.0); ctxt->setContextProperty("backgroundBlurRadius", 0.0); @@ -284,7 +283,7 @@ void GridComicsView::updateBackgroundConfig() ctxt->setContextProperty("backgroundBlurVisible", QVariant(false)); } -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI ctxt->setContextProperty("cellColor", useBackgroundImage ? "#99FFFFFF" : "#FFFFFF"); ctxt->setContextProperty("selectedColor", "#FFFFFF"); #else diff --git a/YACReaderLibrary/info_comics_view.cpp b/YACReaderLibrary/info_comics_view.cpp index 488ad07f..0bd68764 100644 --- a/YACReaderLibrary/info_comics_view.cpp +++ b/YACReaderLibrary/info_comics_view.cpp @@ -1,5 +1,7 @@ #include "info_comics_view.h" +#include "yacreader_global.h" + #include #include @@ -21,7 +23,7 @@ InfoComicsView::InfoComicsView(QWidget *parent) QQmlContext *ctxt = view->rootContext(); LibraryUITheme theme; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI theme = Light; #else theme = Dark; @@ -44,6 +46,8 @@ InfoComicsView::InfoComicsView(QWidget *parent) ctxt->setContextProperty("readTickUncheckedColor", "#DEDEDE"); ctxt->setContextProperty("readTickCheckedColor", "#E84852"); + + ctxt->setContextProperty("showDropShadow", QVariant(false)); } else { ctxt->setContextProperty("infoBackgroundColor", "#2E2E2E"); ctxt->setContextProperty("topShadow", "info-top-shadow.png"); @@ -61,6 +65,8 @@ InfoComicsView::InfoComicsView(QWidget *parent) ctxt->setContextProperty("readTickUncheckedColor", "#1C1C1C"); ctxt->setContextProperty("readTickCheckedColor", "#E84852"); + + ctxt->setContextProperty("showDropShadow", QVariant(true)); } ctxt->setContextProperty("backgroundImage", QUrl()); diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 0ef130e1..81e28285 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1,5 +1,6 @@ #include "library_window.h" -#include "folder_item.h" + +#include "yacreader_global.h" #include #include @@ -20,8 +21,8 @@ #include #include +#include "folder_item.h" #include "data_base_management.h" -#include "yacreader_global.h" #include "no_libraries_widget.h" #include "import_widget.h" @@ -226,7 +227,7 @@ void LibraryWindow::doLayout() { // LAYOUT ELEMENTS------------------------------------------------------------ auto sHorizontal = new QSplitter(Qt::Horizontal); // spliter principal -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI sHorizontal->setStyleSheet("QSplitter::handle{image:none;background-color:#B8B8B8;} QSplitter::handle:vertical {height:1px;}"); #else sHorizontal->setStyleSheet("QSplitter::handle:vertical {height:4px;}"); @@ -237,7 +238,7 @@ void LibraryWindow::doLayout() editInfoToolBar = new QToolBar(); editInfoToolBar->setStyleSheet("QToolBar {border: none;}"); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI libraryToolBar = new YACReaderMacOSXToolbar(this); #else libraryToolBar = new YACReaderMainToolBar(this); @@ -245,7 +246,7 @@ void LibraryWindow::doLayout() // FOLDERS FILTER------------------------------------------------------------- //--------------------------------------------------------------------------- -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI // in MacOSX the searchEdit is created using the toolbar wrapper searchEdit = new YACReaderSearchLineEdit(); #endif @@ -286,7 +287,7 @@ void LibraryWindow::doLayout() contentViewsManager = new YACReaderContentViewsManager(settings, this); sHorizontal->addWidget(sideBar); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI QVBoxLayout *rightLayout = new QVBoxLayout; rightLayout->addWidget(libraryToolBar); rightLayout->addWidget(contentViewsManager->containerWidget()); @@ -321,7 +322,7 @@ void LibraryWindow::doLayout() connect(noLibrariesWidget, &NoLibrariesWidget::addExistingLibrary, this, &LibraryWindow::showAddLibrary); // collapsible disabled in macosx (only temporaly) -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI sHorizontal->setCollapsible(0, false); #endif } @@ -445,7 +446,7 @@ void LibraryWindow::setUpShortcutsManagement() << showHideMarksAction << toogleShowRecentIndicatorAction #ifndef Q_OS_MAC - << toggleFullScreenAction + << toggleFullScreenAction // Think about what to do in macos if the default theme is used #endif << toggleComicsViewAction); @@ -974,7 +975,7 @@ void LibraryWindow::disableAllActions() void LibraryWindow::createToolBars() { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI // libraryToolBar->setIconSize(QSize(16,16)); //TODO make icon size dynamic libraryToolBar->addAction(backAction); @@ -1010,7 +1011,9 @@ void LibraryWindow::createToolBars() libraryToolBar->serverButton->setDefaultAction(serverConfigAction); libraryToolBar->helpButton->setDefaultAction(helpAboutAction); libraryToolBar->toggleComicsViewButton->setDefaultAction(toggleComicsViewAction); +#ifndef Q_OS_MAC libraryToolBar->fullscreenButton->setDefaultAction(toggleFullScreenAction); +#endif libraryToolBar->setSearchWidget(searchEdit); #endif @@ -1096,7 +1099,7 @@ void LibraryWindow::createMenus() selectedLibrary->addAction(importLibraryAction); // MacOSX app menus -#ifdef Q_OS_MACX +#ifdef Q_OS_MAC QMenuBar *menu = this->menuBar(); // about / preferences // TODO @@ -1279,7 +1282,7 @@ void LibraryWindow::createConnections() connect(optionsDialog, &YACReaderOptionsDialog::editShortcuts, editShortcutsDialog, &QWidget::show); // Search filter -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI connect(searchEdit, &YACReaderMacOSXSearchLineEdit::filterChanged, this, &LibraryWindow::setSearchFilter); #else connect(searchEdit, &YACReaderSearchLineEdit::filterChanged, this, &LibraryWindow::setSearchFilter); @@ -2092,7 +2095,7 @@ void LibraryWindow::onAddComicsToLabel() void LibraryWindow::setToolbarTitle(const QModelIndex &modelIndex) { -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI if (!modelIndex.isValid()) libraryToolBar->setCurrentFolderName(selectedLibrary->currentText()); else @@ -2361,7 +2364,7 @@ void LibraryWindow::rename(QString newName) // TODO replace selectedLibrary->renameCurrentLibrary(newName); libraries.save(); renameLibraryDialog->close(); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI if (!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid()) libraryToolBar->setCurrentFolderName(selectedLibrary->currentText()); #endif @@ -2506,7 +2509,7 @@ void LibraryWindow::toNormal() else showNormal(); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI auto timer = new QTimer(); timer->setSingleShot(true); timer->start(); @@ -2826,7 +2829,7 @@ void LibraryWindow::showNoLibrariesWidget() void LibraryWindow::showRootWidget() { -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI libraryToolBar->setDisabled(false); #endif searchEdit->setEnabled(true); @@ -2837,7 +2840,7 @@ void LibraryWindow::showImportingWidget() { disableAllActions(); importWidget->clear(); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI libraryToolBar->setDisabled(true); #endif searchEdit->setDisabled(true); diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index 3e300caf..8cba4ffc 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -6,6 +6,7 @@ #include #include +#include "yacreader_global.h" #include "yacreader_global_gui.h" #include "yacreader_libraries.h" @@ -20,7 +21,7 @@ #include #include -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI #include "yacreader_macosx_toolbar.h" #endif @@ -123,7 +124,7 @@ public: QSize slideSizeW; QSize slideSizeF; // search filter -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI YACReaderMacOSXSearchLineEdit *searchEdit; #else YACReaderSearchLineEdit *searchEdit; @@ -249,7 +250,7 @@ public: QAction *addToMenuAction; QAction *addToFavoritesAction; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI YACReaderMacOSXToolbar *libraryToolBar; #else YACReaderMainToolBar *libraryToolBar; diff --git a/YACReaderLibrary/no_search_results_widget.cpp b/YACReaderLibrary/no_search_results_widget.cpp index 30dd4bde..bda1096c 100644 --- a/YACReaderLibrary/no_search_results_widget.cpp +++ b/YACReaderLibrary/no_search_results_widget.cpp @@ -1,5 +1,7 @@ #include "no_search_results_widget.h" +#include "yacreader_global.h" + #include #include #include @@ -7,7 +9,7 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent) : QWidget(parent) { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI backgroundColor = "#FFFFFF"; #else backgroundColor = "#2A2A2A"; @@ -22,7 +24,7 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent) titleLabel = new QLabel("No results"); titleLabel->setAlignment(Qt::AlignCenter); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}"); #else titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}"); diff --git a/YACReaderLibrary/qml/FlowView.qml b/YACReaderLibrary/qml/FlowView.qml index 01f40057..908d52e8 100644 --- a/YACReaderLibrary/qml/FlowView.qml +++ b/YACReaderLibrary/qml/FlowView.qml @@ -126,7 +126,7 @@ Rectangle { samples: 17 color: "#BB000000" source: coverElement - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } Image { diff --git a/YACReaderLibrary/qml/FlowView6.qml b/YACReaderLibrary/qml/FlowView6.qml index ff8f82f6..7300fd8b 100644 --- a/YACReaderLibrary/qml/FlowView6.qml +++ b/YACReaderLibrary/qml/FlowView6.qml @@ -133,7 +133,7 @@ Rectangle { //samples: 17 color: "#BB000000" source: coverElement - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } Image { diff --git a/YACReaderLibrary/qml/GridComicsView.qml b/YACReaderLibrary/qml/GridComicsView.qml index 811a0a56..b43a0288 100644 --- a/YACReaderLibrary/qml/GridComicsView.qml +++ b/YACReaderLibrary/qml/GridComicsView.qml @@ -73,7 +73,7 @@ SplitView { samples: 17 color: "#FF000000" source: realCell - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } Rectangle { @@ -134,7 +134,7 @@ SplitView { rightMargin : commonBorder ? -commonBorderWidth : -rBorderwidth } - border.color: (Qt.platform.os === "osx") ? selectedBorderColor : "#ffcc00" + border.color: selectedBorderColor border.width: 3 opacity: (dummyValue || !dummyValue) && comicsSelectionHelper.isSelectedIndex(index) ? 1 : 0 @@ -432,7 +432,7 @@ SplitView { height: showCurrentComic ? 270 : 20 Rectangle { - color: (Qt.platform.os === "osx") ? "#88FFFFFF" : "#88000000" + color: currentComicBackgroundColor id: currentComicVisualView @@ -468,7 +468,7 @@ SplitView { samples: 17 color: "#FF000000" source: currentCoverElement - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } ColumnLayout @@ -678,7 +678,7 @@ SplitView { samples: 17 color: "#AA000000" source: readButton - visible: ((Qt.platform.os === "osx") ? false : true) && !readButton.pressed + visible: showDropShadow && !readButton.pressed } } } diff --git a/YACReaderLibrary/qml/GridComicsView6.qml b/YACReaderLibrary/qml/GridComicsView6.qml index 2967f46a..d01a85c4 100644 --- a/YACReaderLibrary/qml/GridComicsView6.qml +++ b/YACReaderLibrary/qml/GridComicsView6.qml @@ -76,7 +76,7 @@ SplitView { //samples: 17 color: "#FF000000" source: realCell - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } Rectangle { @@ -137,7 +137,7 @@ SplitView { rightMargin : commonBorder ? -commonBorderWidth : -rBorderwidth } - border.color: (Qt.platform.os === "osx") ? selectedBorderColor : "#ffcc00" + border.color: selectedBorderColor border.width: 3 opacity: (dummyValue || !dummyValue) && comicsSelectionHelper.isSelectedIndex(index) ? 1 : 0 @@ -435,7 +435,7 @@ SplitView { height: showCurrentComic ? 270 : 20 Rectangle { - color: (Qt.platform.os === "osx") ? "#88FFFFFF" : "#88000000" + color: currentComicBackgroundColor id: currentComicVisualView @@ -472,7 +472,7 @@ SplitView { //samples: 17 color: "#FF000000" source: currentCoverElement - visible: (Qt.platform.os === "osx") ? false : true; + visible: showDropShadow; } ColumnLayout @@ -686,7 +686,7 @@ SplitView { //samples: 17 color: "#AA000000" source: readButton - visible: ((Qt.platform.os === "osx") ? false : true) && !readButton.pressed + visible: showDropShadow && !readButton.pressed } } } diff --git a/YACReaderLibrary/yacreader_content_views_manager.cpp b/YACReaderLibrary/yacreader_content_views_manager.cpp index 3ab8b05b..7e1df5a1 100644 --- a/YACReaderLibrary/yacreader_content_views_manager.cpp +++ b/YACReaderLibrary/yacreader_content_views_manager.cpp @@ -1,5 +1,7 @@ #include "yacreader_content_views_manager.h" +#include "yacreader_global.h" + #include "library_window.h" #include "classic_comics_view.h" @@ -212,7 +214,7 @@ void YACReaderContentViewsManager::_toggleComicsView() QIcon icoViewsButton; icoViewsButton.addFile(addExtensionToIconPath(":/images/main_toolbar/info"), QSize(), QIcon::Normal); libraryWindow->toggleComicsViewAction->setIcon(icoViewsButton); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI libraryWindow->libraryToolBar->updateViewSelectorIcon(icoViewsButton); #endif if (gridComicsView == nullptr) @@ -229,7 +231,7 @@ void YACReaderContentViewsManager::_toggleComicsView() QIcon icoViewsButton; icoViewsButton.addFile(addExtensionToIconPath(":/images/main_toolbar/flow"), QSize(), QIcon::Normal); libraryWindow->toggleComicsViewAction->setIcon(icoViewsButton); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI libraryWindow->libraryToolBar->updateViewSelectorIcon(icoViewsButton); #endif if (infoComicsView == nullptr) @@ -245,7 +247,7 @@ void YACReaderContentViewsManager::_toggleComicsView() QIcon icoViewsButton; icoViewsButton.addFile(addExtensionToIconPath(":/images/main_toolbar/grid"), QSize(), QIcon::Normal); libraryWindow->toggleComicsViewAction->setIcon(icoViewsButton); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI libraryWindow->libraryToolBar->updateViewSelectorIcon(icoViewsButton); #endif if (classicComicsView == nullptr) diff --git a/YACReaderLibrary/yacreader_folders_view.cpp b/YACReaderLibrary/yacreader_folders_view.cpp index a6788bb3..c042a6e6 100644 --- a/YACReaderLibrary/yacreader_folders_view.cpp +++ b/YACReaderLibrary/yacreader_folders_view.cpp @@ -1,5 +1,7 @@ #include "yacreader_folders_view.h" +#include "yacreader_global.h" + #include "folder_item.h" #include "folder_model.h" @@ -80,7 +82,7 @@ void YACReaderFoldersViewItemDeletegate::paint(QPainter *painter, const QStyleOp { if (!index.data(FolderModel::CompletedRole).toBool()) { painter->save(); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI painter->setBrush(QBrush(QColor(85, 95, 127))); #else painter->setBrush(QBrush(QColor(237, 197, 24))); @@ -103,7 +105,7 @@ void YACReaderFoldersViewItemDeletegate::paint(QPainter *painter, const QStyleOp if (now - added < daysInSeconds || now - updated < daysInSeconds) { painter->save(); painter->setRenderHint(QPainter::Antialiasing); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI painter->setBrush(QBrush(QColor(85, 95, 127))); #else painter->setBrush(QBrush(QColor(237, 197, 24))); diff --git a/common/yacreader_global.cpp b/common/yacreader_global.cpp index 105e7372..6801af99 100644 --- a/common/yacreader_global.cpp +++ b/common/yacreader_global.cpp @@ -71,7 +71,7 @@ QString YACReader::labelColorToRGBString(LabelColors color) case YPink: return "#FF9FDD"; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI case YWhite: return "#E3E3E3"; #else diff --git a/common/yacreader_global.h b/common/yacreader_global.h index 89fd6751..d0d0d432 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -19,6 +19,10 @@ #define MAX_LIBRARIES_WARNING_NUM 10 +#ifdef Q_OS_MAC +#define Y_MAC_UI +#endif + namespace YACReader { enum YACReaderIPCMessages { diff --git a/common/yacreader_global_gui.cpp b/common/yacreader_global_gui.cpp index 77914910..77e27aea 100644 --- a/common/yacreader_global_gui.cpp +++ b/common/yacreader_global_gui.cpp @@ -57,7 +57,7 @@ QList YACReader::mimeDataToComicsIds(const QMimeData *data) QString YACReader::addExtensionToIconPath(const QString &path) { #ifdef YACREADER_LIBRARY -#ifdef Q_OS_MAC +#ifdef Q_OS_MAC // TODO_Y_MAC_UI return path + ".png"; #else return path + ".svg"; diff --git a/custom_widgets/yacreader_library_item_widget.cpp b/custom_widgets/yacreader_library_item_widget.cpp index 4a76ef00..f7cbec8e 100644 --- a/custom_widgets/yacreader_library_item_widget.cpp +++ b/custom_widgets/yacreader_library_item_widget.cpp @@ -1,5 +1,6 @@ #include "yacreader_library_item_widget.h" +#include "yacreader_global.h" #include "yacreader_global_gui.h" #include @@ -56,7 +57,7 @@ YACReaderLibraryItemWidget::YACReaderLibraryItemWidget(QString n /*ame*/, QStrin mainLayout->addWidget(down);*/ setLayout(mainLayout); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI QString styleSheet = "background-color:transparent; color:#DDDFDF;"; setStyleSheet(styleSheet); #endif @@ -117,7 +118,7 @@ bool YACReaderLibraryItemWidget::eventFilter(QObject *object, QEvent *event){ void YACReaderLibraryItemWidget::deselect() { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI QString styleSheet = "background-color:transparent;"; setStyleSheet(styleSheet); #else @@ -137,7 +138,7 @@ void YACReaderLibraryItemWidget::deselect() void YACReaderLibraryItemWidget::select() { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI // 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;"; QString styleSheet = "color: white; background-color:#91c4f4; border-bottom:1px solid #91c4f4;"; #else diff --git a/custom_widgets/yacreader_search_line_edit.cpp b/custom_widgets/yacreader_search_line_edit.cpp index aa3936e4..e1e105b8 100644 --- a/custom_widgets/yacreader_search_line_edit.cpp +++ b/custom_widgets/yacreader_search_line_edit.cpp @@ -1,4 +1,6 @@ #include "yacreader_search_line_edit.h" + +#include "yacreader_global.h" #include "yacreader_global_gui.h" #include @@ -13,7 +15,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) clearButton = new QToolButton(this); searchLabel = new QLabel(this); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI QPixmap clearIcon; QPixmap searchIcon; @@ -41,7 +43,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) clearButton->setIcon(QIcon(clearIcon)); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI clearButton->setIconSize(QSize(14, 14)); #else clearButton->setIconSize(QSize(12, 12)); @@ -53,7 +55,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) connect(clearButton, &QAbstractButton::clicked, this, &QLineEdit::clear); connect(this, &QLineEdit::textChanged, this, &YACReaderSearchLineEdit::updateCloseButton); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI setStyleSheet(QString("QLineEdit {border-top:1px solid #9F9F9F; border-bottom:1px solid #ACACAC; border-right:1px solid #ACACAC; border-left:1px solid #ACACAC; border-radius: 4px; background-color:#EEEEEE; padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-bottom: 1px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6).arg(clearButton->sizeHint().width() + frameWidth + 2)); #else setStyleSheet(QString("QLineEdit {color: #ABABAB; border:none; border-radius: 4px; background-color:#404040; padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-right: 9px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6 + 5).arg(clearButton->sizeHint().width() + frameWidth + 2)); @@ -62,7 +64,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent) setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2), qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2)); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI setMaximumWidth(212); setFixedHeight(26); #else @@ -90,7 +92,7 @@ const QString YACReaderSearchLineEdit::text() void YACReaderSearchLineEdit::resizeEvent(QResizeEvent *) { -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI QSize sz = clearButton->sizeHint(); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); clearButton->move(rect().right() - frameWidth - sz.width(), diff --git a/custom_widgets/yacreader_sidebar.cpp b/custom_widgets/yacreader_sidebar.cpp index c02be81a..13f72dc5 100644 --- a/custom_widgets/yacreader_sidebar.cpp +++ b/custom_widgets/yacreader_sidebar.cpp @@ -8,6 +8,8 @@ #include "yacreader_library_list_widget.h" #include "yacreader_search_line_edit.h" #include "yacreader_titled_toolbar.h" + +#include "yacreader_global.h" #include "yacreader_global_gui.h" YACReaderSideBar::YACReaderSideBar(QWidget *parent) @@ -23,7 +25,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) readingListsView = new YACReaderReadingListsView; selectedLibrary = new YACReaderLibraryListWidget; -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI librariesTitle = new YACReaderTitledToolBar(tr("Libraries")); foldersTitle = new YACReaderTitledToolBar(tr("Folders")); readingListsTitle = new YACReaderTitledToolBar(tr("Reading Lists")); @@ -36,7 +38,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) splitter = new QSplitter(this); splitter->setOrientation(Qt::Vertical); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI splitter->setStyleSheet("QSplitter::handle { " " image: none; background-color = black; " " }" @@ -55,20 +57,20 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) l->setContentsMargins(0, 0, 0, 0); // LIBRARIES------------------------------------------------------- -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI l->addSpacing(5); #endif l->addWidget(librariesTitle); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI l->addSpacing(4); l->addWidget(new YACReaderSideBarSeparator(this)); l->addSpacing(3); #endif l->addWidget(selectedLibrary); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI l->addSpacing(11); #else l->addSpacing(6); @@ -82,7 +84,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) foldersLayout->setContentsMargins(0, 0, 0, 0); foldersLayout->setSpacing(0); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI // foldersLayout->addSpacing(6); // foldersLayout->addSpacing(5); @@ -94,7 +96,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) foldersLayout->addWidget(foldersTitle); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI foldersLayout->addSpacing(4); foldersLayout->addWidget(new YACReaderSideBarSeparator(this)); foldersLayout->addSpacing(4); @@ -114,7 +116,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) readingListsHeaderLayout->setContentsMargins(0, 0, 0, 0); readingListsHeaderLayout->setSpacing(0); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI // readingListsHeaderLayout->addSpacing(6); // readingListsHeaderLayout->addSpacing(5); @@ -126,7 +128,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) readingListsHeaderLayout->addWidget(readingListsTitle); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI readingListsHeaderLayout->addSpacing(4); readingListsHeaderLayout->addWidget(new YACReaderSideBarSeparator(this)); readingListsHeaderLayout->addSpacing(4); @@ -152,7 +154,7 @@ void YACReaderSideBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI QPainter painter(this); painter.fillRect(0, 0, width(), height(), QColor("#F1F1F1")); diff --git a/custom_widgets/yacreader_table_view.cpp b/custom_widgets/yacreader_table_view.cpp index bcfef266..b4eca069 100644 --- a/custom_widgets/yacreader_table_view.cpp +++ b/custom_widgets/yacreader_table_view.cpp @@ -1,5 +1,8 @@ #include "yacreader_table_view.h" +#include "yacreader_global.h" +#include "yacreader_global_gui.h" + #include #include #include @@ -13,7 +16,6 @@ #include "QsLog.h" #include "comic_item.h" -#include "yacreader_global_gui.h" YACReaderTableView::YACReaderTableView(QWidget *parent) : QTableView(parent), showDelete(false), editing(false), myeditor(0) @@ -24,7 +26,7 @@ YACReaderTableView::YACReaderTableView(QWidget *parent) "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:1px solid #B8B8B8;border-right:none;}" -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI "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; }" diff --git a/custom_widgets/yacreader_titled_toolbar.cpp b/custom_widgets/yacreader_titled_toolbar.cpp index 516cc643..79bb43c4 100644 --- a/custom_widgets/yacreader_titled_toolbar.cpp +++ b/custom_widgets/yacreader_titled_toolbar.cpp @@ -1,5 +1,7 @@ #include "yacreader_titled_toolbar.h" +#include "yacreader_global.h" + #include #include #include @@ -40,7 +42,7 @@ void DropShadowLabel::paintEvent(QPaintEvent *event) QPainter painter(this); painter.setFont(font()); -#ifndef Q_OS_MAC +#ifndef Y_MAC_UI drawTextEffect(&painter, QPoint(contentsMargins().left(), 1)); #endif drawText(&painter, QPoint(contentsMargins().left(), 0)); @@ -68,7 +70,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa nameLabel = new DropShadowLabel(this); nameLabel->setText(title); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}"; nameLabel->setColor(QColor("#808080")); // nameLabel->setDropShadowColor(QColor("#F9FAFB")); @@ -94,7 +96,7 @@ void YACReaderTitledToolBar::addAction(QAction *action) QHBoxLayout *mainLayout = dynamic_cast(layout()); // fix for QToolButton and retina support in OSX -#ifdef Q_OS_MAC +#ifdef Q_OS_MAC // TODO_Y_MAC_UI QPushButton *pb = new QPushButton(this); pb->setCursor(QCursor(Qt::ArrowCursor)); pb->setIcon(action->icon()); @@ -128,7 +130,7 @@ void YACReaderTitledToolBar::addSepartor() QWidget *w = new QWidget(this); w->setFixedSize(1, 14); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI w->setStyleSheet("QWidget {background-color:#AFAFAF;}"); #else w->setStyleSheet("QWidget {background-color:#6F6F6F;}"); diff --git a/custom_widgets/yacreader_treeview.cpp b/custom_widgets/yacreader_treeview.cpp index 1a70a4d4..2a9799f2 100644 --- a/custom_widgets/yacreader_treeview.cpp +++ b/custom_widgets/yacreader_treeview.cpp @@ -1,5 +1,7 @@ #include "yacreader_treeview.h" +#include "yacreader_global.h" + YACReaderTreeView::YACReaderTreeView(QWidget *parent) : QTreeView(parent), clicking(false) { @@ -18,7 +20,7 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent) setSelectionBehavior(QAbstractItemView::SelectRows); setAttribute(Qt::WA_MacShowFocusRect, false); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI setStyleSheet("QTreeView {background-color:transparent; border: none;}" "QTreeView::item:selected {background-color:#91c4f4; border-top: 1px solid #91c4f4; border-left:none;border-right:none;border-bottom:1px solid #91c4f4;}" diff --git a/shortcuts_management/edit_shortcuts_dialog.cpp b/shortcuts_management/edit_shortcuts_dialog.cpp index cd3109fa..33ffb3c6 100644 --- a/shortcuts_management/edit_shortcuts_dialog.cpp +++ b/shortcuts_management/edit_shortcuts_dialog.cpp @@ -1,5 +1,7 @@ #include "edit_shortcuts_dialog.h" +#include "yacreader_global.h" + #include "actions_groups_model.h" #include "actions_shortcuts_model.h" #include "edit_shortcut_item_delegate.h" @@ -61,7 +63,7 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) connect(actionsGroupsListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &EditShortcutsDialog::loadShortcuts); // clicked(QModelIndex) doesn't work :S connect(actionsModel, &ActionsShortcutsModel::conflict, this, &EditShortcutsDialog::processConflict); -#ifdef Q_OS_MAC +#ifdef Y_MAC_UI setFixedSize(760, 500); #else setFixedSize(804, 500); // extra width for modifiers