Mac OS proxy icon.
--HG-- branch : develop
This commit is contained in:
parent
7054714114
commit
830c43a89d
4
dist/macx/tape/Info.plist
vendored
4
dist/macx/tape/Info.plist
vendored
|
@ -75,6 +75,8 @@
|
||||||
<array>
|
<array>
|
||||||
<string>vit</string>
|
<string>vit</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>text/xml</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -95,6 +97,8 @@
|
||||||
<array>
|
<array>
|
||||||
<string>vst</string>
|
<string>vst</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>text/xml</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
|
14
dist/macx/valentina/Info.plist
vendored
14
dist/macx/valentina/Info.plist
vendored
|
@ -42,7 +42,7 @@
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>Editor</string>
|
<string>Viewer</string>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>measurements.icns</string>
|
<string>measurements.icns</string>
|
||||||
<key>LSItemContentTypes</key>
|
<key>LSItemContentTypes</key>
|
||||||
|
@ -52,11 +52,11 @@
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Valentina individual measurements</string>
|
<string>Valentina individual measurements</string>
|
||||||
<key>LSHandlerRank</key>
|
<key>LSHandlerRank</key>
|
||||||
<string>Owner</string>
|
<string>Alternate</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>Editor</string>
|
<string>Viewer</string>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>measurements.icns</string>
|
<string>measurements.icns</string>
|
||||||
<key>LSItemContentTypes</key>
|
<key>LSItemContentTypes</key>
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Valentina standard measurements</string>
|
<string>Valentina standard measurements</string>
|
||||||
<key>LSHandlerRank</key>
|
<key>LSHandlerRank</key>
|
||||||
<string>Owner</string>
|
<string>Alternate</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>UTExportedTypeDeclarations</key>
|
<key>UTExportedTypeDeclarations</key>
|
||||||
|
@ -89,6 +89,8 @@
|
||||||
<array>
|
<array>
|
||||||
<string>val</string>
|
<string>val</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>text/xml</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -109,6 +111,8 @@
|
||||||
<array>
|
<array>
|
||||||
<string>vit</string>
|
<string>vit</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>text/xml</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -129,6 +133,8 @@
|
||||||
<array>
|
<array>
|
||||||
<string>vst</string>
|
<string>vst</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>text/xml</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
|
|
@ -223,7 +223,9 @@ MApplication::MApplication(int &argc, char **argv)
|
||||||
setOrganizationDomain(VER_COMPANYDOMAIN_STR);
|
setOrganizationDomain(VER_COMPANYDOMAIN_STR);
|
||||||
// Setting the Application version
|
// Setting the Application version
|
||||||
setApplicationVersion(APP_VERSION_STR);
|
setApplicationVersion(APP_VERSION_STR);
|
||||||
|
#if !defined(Q_OS_MAC)
|
||||||
setWindowIcon(QIcon(":/tapeicon/64x64/logo.png"));
|
setWindowIcon(QIcon(":/tapeicon/64x64/logo.png"));
|
||||||
|
#endif // !defined(Q_OS_MAC)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -553,81 +553,6 @@ void TMainWindow::showEvent(QShowEvent *event)
|
||||||
isInitialized = true;//first show windows are held
|
isInitialized = true;//first show windows are held
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
bool TMainWindow::event(QEvent *event)
|
|
||||||
{
|
|
||||||
if (not isActiveWindow())
|
|
||||||
{
|
|
||||||
return QMainWindow::event(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->type())
|
|
||||||
{
|
|
||||||
case QEvent::IconDrag:
|
|
||||||
{
|
|
||||||
event->accept();
|
|
||||||
const Qt::KeyboardModifiers currentModifiers = qApp->keyboardModifiers();
|
|
||||||
|
|
||||||
if (currentModifiers == Qt::NoModifier)
|
|
||||||
{
|
|
||||||
QDrag *drag = new QDrag(this);
|
|
||||||
QMimeData *data = new QMimeData();
|
|
||||||
data->setUrls(QList<QUrl>() << QUrl::fromLocalFile(curFile));
|
|
||||||
drag->setMimeData(data);
|
|
||||||
const QPixmap cursorPixmap = style()->standardPixmap(QStyle::SP_FileIcon, 0, this);
|
|
||||||
drag->setPixmap(cursorPixmap);
|
|
||||||
|
|
||||||
QPoint hotspot(cursorPixmap.width() - 5, 5);
|
|
||||||
drag->setHotSpot(hotspot);
|
|
||||||
|
|
||||||
drag->start(Qt::LinkAction | Qt::CopyAction);
|
|
||||||
}
|
|
||||||
else if (currentModifiers == Qt::ControlModifier)
|
|
||||||
{
|
|
||||||
QMenu menu(this);
|
|
||||||
connect(&menu, &QMenu::triggered, this, &TMainWindow::OpenAt);
|
|
||||||
|
|
||||||
QFileInfo info(curFile);
|
|
||||||
QAction *action = menu.addAction(info.fileName());
|
|
||||||
action->setIcon(QIcon(QApplication::applicationDirPath() +
|
|
||||||
QLatin1Literal("/../Resources/measurements.icns")));
|
|
||||||
const QStringList folders = info.absolutePath().split('/');
|
|
||||||
QStringListIterator it(folders);
|
|
||||||
|
|
||||||
it.toBack();
|
|
||||||
while (it.hasPrevious())
|
|
||||||
{
|
|
||||||
QString string = it.previous();
|
|
||||||
QIcon icon;
|
|
||||||
|
|
||||||
if (not string.isEmpty())
|
|
||||||
{
|
|
||||||
icon = style()->standardIcon(QStyle::SP_DirClosedIcon, 0, this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // At the root
|
|
||||||
string = "/";
|
|
||||||
icon = style()->standardIcon(QStyle::SP_DriveHDIcon, 0, this);
|
|
||||||
}
|
|
||||||
action = menu.addAction(string);
|
|
||||||
action->setIcon(icon);
|
|
||||||
}
|
|
||||||
QPoint pos(QCursor::pos().x() - 20, frameGeometry().y());
|
|
||||||
menu.exec(pos);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event->ignore();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return QMainWindow::event(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif //defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::FileSave()
|
void TMainWindow::FileSave()
|
||||||
{
|
{
|
||||||
|
@ -2094,6 +2019,7 @@ void TMainWindow::SetCurrentFile(const QString &fileName)
|
||||||
}
|
}
|
||||||
shownName += "[*]";
|
shownName += "[*]";
|
||||||
setWindowTitle(shownName);
|
setWindowTitle(shownName);
|
||||||
|
setWindowFilePath(curFile);
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
|
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
|
||||||
|
|
|
@ -74,9 +74,6 @@ protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||||
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
|
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
|
||||||
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
virtual bool event(QEvent *event) Q_DECL_OVERRIDE;
|
|
||||||
#endif //defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void FileSave();
|
void FileSave();
|
||||||
|
|
|
@ -56,7 +56,9 @@ int main(int argc, char *argv[])
|
||||||
app.InitOptions();
|
app.InitOptions();
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
#if !defined(Q_OS_MAC)
|
||||||
app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png"));
|
app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png"));
|
||||||
|
#endif // !defined(Q_OS_MAC)
|
||||||
app.setMainWindow(&w);
|
app.setMainWindow(&w);
|
||||||
|
|
||||||
QTimer::singleShot(0, &w, SLOT(ProcessCMD()));
|
QTimer::singleShot(0, &w, SLOT(ProcessCMD()));
|
||||||
|
|
|
@ -1122,82 +1122,6 @@ void MainWindow::customEvent(QEvent *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
bool MainWindow::event(QEvent *event)
|
|
||||||
{
|
|
||||||
if (not isActiveWindow())
|
|
||||||
{
|
|
||||||
return MainWindowsNoGUI::event(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->type())
|
|
||||||
{
|
|
||||||
case QEvent::IconDrag:
|
|
||||||
{
|
|
||||||
event->accept();
|
|
||||||
const Qt::KeyboardModifiers currentModifiers = qApp->keyboardModifiers();
|
|
||||||
|
|
||||||
if (currentModifiers == Qt::NoModifier)
|
|
||||||
{
|
|
||||||
QDrag *drag = new QDrag(this);
|
|
||||||
QMimeData *data = new QMimeData();
|
|
||||||
data->setUrls(QList<QUrl>() << QUrl::fromLocalFile(curFile));
|
|
||||||
drag->setMimeData(data);
|
|
||||||
const QPixmap cursorPixmap = style()->standardPixmap(QStyle::SP_FileIcon, 0, this);
|
|
||||||
drag->setPixmap(cursorPixmap);
|
|
||||||
|
|
||||||
QPoint hotspot(cursorPixmap.width() - 5, 5);
|
|
||||||
drag->setHotSpot(hotspot);
|
|
||||||
|
|
||||||
drag->start(Qt::LinkAction | Qt::CopyAction);
|
|
||||||
}
|
|
||||||
else if (currentModifiers == Qt::ControlModifier)
|
|
||||||
{
|
|
||||||
QMenu menu(this);
|
|
||||||
connect(&menu, &QMenu::triggered, this, &MainWindow::OpenAt);
|
|
||||||
|
|
||||||
QFileInfo info(curFile);
|
|
||||||
QAction *action = menu.addAction(info.fileName());
|
|
||||||
action->setIcon(QIcon(QApplication::applicationDirPath() +
|
|
||||||
QLatin1Literal("/../Resources/measurements.icns")));
|
|
||||||
const QStringList folders = info.absolutePath().split('/');
|
|
||||||
QStringListIterator it(folders);
|
|
||||||
|
|
||||||
it.toBack();
|
|
||||||
while (it.hasPrevious())
|
|
||||||
{
|
|
||||||
QString string = it.previous();
|
|
||||||
QIcon icon;
|
|
||||||
|
|
||||||
if (not string.isEmpty())
|
|
||||||
{
|
|
||||||
icon = style()->standardIcon(QStyle::SP_DirClosedIcon, 0, this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // At the root
|
|
||||||
string = "/";
|
|
||||||
icon = style()->standardIcon(QStyle::SP_DriveHDIcon, 0, this);
|
|
||||||
}
|
|
||||||
action = menu.addAction(string);
|
|
||||||
action->setIcon(icon);
|
|
||||||
}
|
|
||||||
QPoint pos(QCursor::pos().x() - 20, frameGeometry().y());
|
|
||||||
menu.exec(pos);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event->ignore();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return MainWindowsNoGUI::event(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif //defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::CleanLayout()
|
void MainWindow::CleanLayout()
|
||||||
{
|
{
|
||||||
|
@ -2980,30 +2904,6 @@ void MainWindow::setCurrentFile(const QString &fileName)
|
||||||
settings->SetRestoreFileList(restoreFiles);
|
settings->SetRestoreFileList(restoreFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
|
|
||||||
QLatin1Literal("/../Resources/measurements.icns"));
|
|
||||||
QIcon icon;
|
|
||||||
if (not curFile.isEmpty())
|
|
||||||
{
|
|
||||||
if (not isWindowModified())
|
|
||||||
{
|
|
||||||
icon = fileIcon;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
static QIcon darkIcon;
|
|
||||||
|
|
||||||
if (darkIcon.isNull())
|
|
||||||
{
|
|
||||||
darkIcon = QIcon(darkenPixmap(fileIcon.pixmap(16, 16)));
|
|
||||||
}
|
|
||||||
icon = darkIcon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setWindowIcon(icon);
|
|
||||||
#endif //defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
UpdateWindowTitle();
|
UpdateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4131,4 +4031,29 @@ QString MainWindow::GetMeasurementFileName()
|
||||||
void MainWindow::UpdateWindowTitle()
|
void MainWindow::UpdateWindowTitle()
|
||||||
{
|
{
|
||||||
setWindowTitle(GetPatternFileName()+GetMeasurementFileName());
|
setWindowTitle(GetPatternFileName()+GetMeasurementFileName());
|
||||||
|
setWindowFilePath(curFile);
|
||||||
|
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
|
||||||
|
QLatin1Literal("/../Resources/Valentina.icns"));
|
||||||
|
QIcon icon;
|
||||||
|
if (not curFile.isEmpty())
|
||||||
|
{
|
||||||
|
if (not isWindowModified())
|
||||||
|
{
|
||||||
|
icon = fileIcon;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static QIcon darkIcon;
|
||||||
|
|
||||||
|
if (darkIcon.isNull())
|
||||||
|
{
|
||||||
|
darkIcon = QIcon(darkenPixmap(fileIcon.pixmap(16, 16)));
|
||||||
|
}
|
||||||
|
icon = darkIcon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setWindowIcon(icon);
|
||||||
|
#endif //defined(Q_OS_MAC)
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,10 +159,6 @@ protected:
|
||||||
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||||
virtual void customEvent(QEvent * event) Q_DECL_OVERRIDE;
|
virtual void customEvent(QEvent * event) Q_DECL_OVERRIDE;
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
virtual bool event(QEvent *event) Q_DECL_OVERRIDE;
|
|
||||||
#endif //defined(Q_OS_MAC)
|
|
||||||
|
|
||||||
virtual void CleanLayout() Q_DECL_OVERRIDE;
|
virtual void CleanLayout() Q_DECL_OVERRIDE;
|
||||||
virtual void PrepareSceneList() Q_DECL_OVERRIDE;
|
virtual void PrepareSceneList() Q_DECL_OVERRIDE;
|
||||||
private slots:
|
private slots:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user