mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Fix macos macros
This commit is contained in:
parent
21e237ccf9
commit
b6eedd4e05
@ -18,7 +18,7 @@ bool YACReader::openComic(const ComicDB &comic,
|
|||||||
labelParam = QString("--readingListId=%1").arg(source.sourceId);
|
labelParam = QString("--readingListId=%1").arg(source.sourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
QStringList possiblePaths { QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../../../") };
|
QStringList possiblePaths { QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../../../") };
|
||||||
possiblePaths += QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
|
possiblePaths += QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "yacreader_libraries.h"
|
#include "yacreader_libraries.h"
|
||||||
#include "exit_check.h"
|
#include "exit_check.h"
|
||||||
#include "opengl_checker.h"
|
#include "opengl_checker.h"
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
#include "trayhandler.h"
|
#include "trayhandler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ int main(int argc, char **argv)
|
|||||||
if (!settings->value(START_TO_TRAY, false).toBool() || !settings->value(CLOSE_TO_TRAY, false).toBool()) {
|
if (!settings->value(START_TO_TRAY, false).toBool() || !settings->value(CLOSE_TO_TRAY, false).toBool()) {
|
||||||
mw->show();
|
mw->show();
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
else {
|
else {
|
||||||
OSXHideDockIcon();
|
OSXHideDockIcon();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
#include "trayhandler.h"
|
#include "trayhandler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ TrayIconController::TrayIconController(QSettings *settings, LibraryWindow *windo
|
|||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
trayIcon.setIcon(QIcon(":/icon.ico"));
|
trayIcon.setIcon(QIcon(":/icon.ico"));
|
||||||
#else
|
#else
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
auto icon = QIcon(":/macostrayicon.svg");
|
auto icon = QIcon(":/macostrayicon.svg");
|
||||||
icon.setIsMask(true);
|
icon.setIsMask(true);
|
||||||
trayIcon.setIcon(icon);
|
trayIcon.setIcon(icon);
|
||||||
@ -69,7 +69,7 @@ void TrayIconController::updateIconVisibility()
|
|||||||
|
|
||||||
bool TrayIconController::handleCloseToTrayIcon(QCloseEvent *event)
|
bool TrayIconController::handleCloseToTrayIcon(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
if (!event->spontaneous() || !window->isVisible()) {
|
if (!event->spontaneous() || !window->isVisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ bool TrayIconController::handleCloseToTrayIcon(QCloseEvent *event)
|
|||||||
"of the system tray icon."));
|
"of the system tray icon."));
|
||||||
settings->setValue(CLOSE_TO_TRAY_NOTIFIED, true);
|
settings->setValue(CLOSE_TO_TRAY_NOTIFIED, true);
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
OSXHideDockIcon();
|
OSXHideDockIcon();
|
||||||
#endif
|
#endif
|
||||||
window->hide();
|
window->hide();
|
||||||
@ -96,7 +96,7 @@ bool TrayIconController::handleCloseToTrayIcon(QCloseEvent *event)
|
|||||||
|
|
||||||
void TrayIconController::showWindow()
|
void TrayIconController::showWindow()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACOSOS
|
#ifdef Q_OS_MACOS
|
||||||
OSXShowDockIcon();
|
OSXShowDockIcon();
|
||||||
window->showNormal();
|
window->showNormal();
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user