OpenToonz - An open-source full-featured 2D animation creation software
C
Added a desktop icon to the file browser (#348)
turtletoothbc1f437e8ac2
diff --git a/toonz/sources/toonz/Resources/desktop.png b/toonz/sources/toonz/Resources/desktop.pngnew file mode 100644index 000000000..82373b8d8Binary files /dev/null and b/toonz/sources/toonz/Resources/desktop.png differdiff --git a/toonz/sources/toonz/filebrowsermodel.cpp b/toonz/sources/toonz/filebrowsermodel.cppindex 59356b7ee..d6c6e9649 100644--- a/toonz/sources/toonz/filebrowsermodel.cpp+++ b/toonz/sources/toonz/filebrowsermodel.cpp@@ -53,6 +53,31 @@ TFilePath getMyDocumentsPath()return TFilePath();#endif}++//Desktop Path+TFilePath getDesktopPath()+{+#ifdef _WIN32+ WCHAR szPath[MAX_PATH];+ if (SHGetSpecialFolderPath(NULL, szPath, CSIDL_DESKTOP, 0)) {+ return TFilePath(szPath);+ }+ return TFilePath();+#elif defined MACOSX+ NSArray *foundref = NSSearchPathForDirectoriesInDomains(+ NSDesktopDirectory,+ NSUserDomainMask,+ YES);+ if (!foundref)+ return TFilePath();+ int c = [foundref count];+ assert(c == 1);+ NSString *desktopDirectory = [foundref objectAtIndex : 0];+ return TFilePath((const char *)[desktopDirectory cStringUsingEncoding : NSASCIIStringEncoding]);+#else+ return TFilePath();+#endif+}}//=============================================================================@@ -1188,6 +1213,10 @@ void DvDirModelRootNode::refreshChildren()child->setPixmap(QPixmap(":Resources/my_documents.png"));addChild(child);+ child = new DvDirModelSpecialFileFolderNode(this, L"Desktop", getDesktopPath());+ child->setPixmap(QPixmap(":Resources/desktop.png"));+ addChild(child);+child = new DvDirModelSpecialFileFolderNode(this, L"Library", ToonzFolder::getLibraryFolder());child->setPixmap(QPixmap(":Resources/library.png"));addChild(child);diff --git a/toonz/sources/toonz/toonz.qrc b/toonz/sources/toonz/toonz.qrcindex 65935918e..ad154ce2d 100644--- a/toonz/sources/toonz/toonz.qrc+++ b/toonz/sources/toonz/toonz.qrc@@ -68,6 +68,7 @@<file>Resources/cutter_rollover.svg</file><file>Resources/paintbrush.svg</file><file>Resources/paintbrush_rollover.svg</file>+ <file>Resources/desktop.png</file><file>Resources/downTitle.png</file><file>Resources/edit.svg</file><file>Resources/edit_rollover.svg</file>