From fdca1a95f036b3e88270ebdfb6254e3f906edb34 Mon Sep 17 00:00:00 2001 From: aiekick Date: Sun, 7 Jan 2024 21:07:54 +0100 Subject: [PATCH] [ADD] : add the feature #157, for display a custom tooltip for a file in a column --- ImGuiFileDialog | 2 +- README.md | 22 ++++++++++++++++++++-- doc/file_tooltip_message.png | Bin 0 -> 17334 bytes main.cpp | 22 ++++++++++++++++++++-- 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 doc/file_tooltip_message.png diff --git a/ImGuiFileDialog b/ImGuiFileDialog index 8ba5dd9..5237093 160000 --- a/ImGuiFileDialog +++ b/ImGuiFileDialog @@ -1 +1 @@ -Subproject commit 8ba5dd995c6a7bc4ae6ebd42b33633b15cb2d72d +Subproject commit 523709351d496e9bf35bf7100e73eb1281b1eeba diff --git a/README.md b/README.md index 4835ed2..105b64b 100644 --- a/README.md +++ b/README.md @@ -1040,11 +1040,29 @@ config.userFileAttributes = [](IGFD::FileInfos* vFileInfosPtr, IGFD::UserDatas v Before the User of the userAttribute callback : -![user_files_attributes_before.gif](https://github.com/aiekick/ImGuiFileDialog/blob/DemoApp/doc/user_files_attributes_before.png) +![user_files_attributes_before.png](https://github.com/aiekick/ImGuiFileDialog/blob/DemoApp/doc/user_files_attributes_before.png) After : -![user_files_attributes_after.gif](https://github.com/aiekick/ImGuiFileDialog/blob/DemoApp/doc/user_files_attributes_after.png) +![user_files_attributes_after.png](https://github.com/aiekick/ImGuiFileDialog/blob/DemoApp/doc/user_files_attributes_after.png) + +You can also display a tootlip for a file displayed when the mouse is over a dedicated column + +you juste need to set your message for the FileDialogConfig.tooltipMessage +and specify the column in FileDialogConfig.tooltipColumn + +ex code from the DemoApp branch for display the decomposition of gltf total size + +syntax : +```cpp +vFileInfosPtr->tooltipMessage = toStr("%s : %s\n%s : %s", // + (vFileInfosPtr->fileNameLevels[0] + ".gltf").c_str(), // + IGFD::Utils::FormatFileSize(vFileInfosPtr->fileSize).c_str(), // + (vFileInfosPtr->fileNameLevels[0] + ".bin").c_str(), // + IGFD::Utils::FormatFileSize((size_t)statInfos.st_size).c_str()); // +vFileInfosPtr->tooltipColumn = 1; // column of file size +``` +![file_tooltip_message.png](https://github.com/aiekick/ImGuiFileDialog/blob/DemoApp/doc/file_tooltip_message.png) diff --git a/doc/file_tooltip_message.png b/doc/file_tooltip_message.png new file mode 100644 index 0000000000000000000000000000000000000000..30e61486635a56a8d6758f84b88a4e7154bc2ef6 GIT binary patch literal 17334 zcmb7s2UwHm*SFPHS`|`6ucC@vs4KxV3J!jKUVLZB8Uj6z(9vI9k; zKq7>&AzB0kWCsGlfU*J!LkLL-VSIPc_W%9g@4epZd%doDHF=)g&wb8)&hPxrc#K0> znoDm}*tTiYCh7C%OfPTRv>6TlfARaR;P2JDo#5|H-vnJYKf8(4t~3QceCu(>;>@N^ z#rW+jH@*X(f4FtdE@;yxnR>~8-!%CXT{mrlUp#Mm=IU+d8P-(!LAT^Xx0WvoIod4M zBaD*1hi5MSOn80w+cPtNaRSwS_CDP8ru(cWLRM?n{pN3^Ol2E>xccq4t+KoKn!dhs zX78@6yYAcl_&_uq+m1ado`8vsF*N_TaY6p+L0J$QdX!bKD9ipcpiFg zTB%HoXiJKVjg7S#vTN%y$7CITIOLM_?C1I1?P@|B>8XSQ1GjfLA&Qdfn- zcCc`?jA7`&9jQ#Ccmh+Q3U4CN4L9ZzWU$JLoH1^j{&0`6c$y-YWH8~-QCndO{%E*W z5&W1pEJgeLs4<4nJ}Oj28hv)F;r#oPkG5n~tO~?ws_RSTE_I*pq0-7sgEv0nK;5J$}fndq7dCUtaRRIstP?$V1yxeEeQF}|WJeCWi6P7M?5&RBnLD1Wz z{hn3NhTkrXQYcZ4Cm-xWWs~(=z;aq7KRC-`q& zaw~^xrfUDZmSz@(1=>IK37;%3zO#?liX3A3Fc-&*Ykz!U z7Vs%3gk{^_vdkpTJTlaHc_!daAnXZWPFA)}RfjH}wQ``D+gIdZEeB_5M+SHV_1|FY zhJKj;=y{sBkER*We*>vF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Nju!@zA+7iG7tc!_K%|PH+#JOYX^E~Iie0s zMrz8(Eu(~z$)zVnXPR^|7c|4O5RRZLtQOGPh|Pcs5KazxL!g{jQsEI)ruVmvq{m!< zX$wB^b|)OCqhD;ip!9zYLH);4VIWji`#qwRI09s84I6AUn=;h=dQP7~S=Mgf78V$o z_v}<}Se`5xkb7VVy7zUBO_JJ8YhU(gD)iuFQ&OSd_|4 z2XLwgqy+t9W`&c-->RbDf9G*mS<;*M!Q}dm?-auOHZQ6aJ=cqFxBvaCulyOaSvnYu zMaIO}zdiOD`}*ro>*+t5ZprwFNVzX>NiZ(jQ3rARdcb$Qsm<)4Hm3b@zWeR#DlcuW zcxB6hk)%DFz6$ipUQ2gN#`R=^4DC0731A`}2PT${B-6N(k1n5oqjrOr&3@k)4($4u wv1`$vWgGWfT1wuyFkL+x&6qAkt(hE(|J7|*cTt$+U*b4#W@$<~`|I!j2S)5{k^lez literal 0 HcmV?d00001 diff --git a/main.cpp b/main.cpp index 7fdd00c..d2fbe4c 100644 --- a/main.cpp +++ b/main.cpp @@ -238,6 +238,18 @@ class CustomDrawReadOnlyCheckBoxFileDialog : public ImGuiFileDialog { } }; +std::string toStr(const char* fmt, ...) { + va_list args; + va_start(args, fmt); + char TempBuffer[3072 + 1]; // 3072 = 1024 * 3 + const int w = vsnprintf(TempBuffer, 3072, fmt, args); + va_end(args); + if (w) { + return std::string(TempBuffer, (size_t)w); + } + return std::string(); +} + int main(int, char**) { #ifdef _MSC_VER // active memory leak detector @@ -736,7 +748,7 @@ int main(int, char**) { config.path = "."; config.countSelectionMax = 0; config.flags = flags; - /*config.userFileAttributes = [](IGFD::FileInfos* vFileInfosPtr, IGFD::UserDatas vUserDatas) -> bool { + config.userFileAttributes = [](IGFD::FileInfos* vFileInfosPtr, IGFD::UserDatas vUserDatas) -> bool { if (vFileInfosPtr != nullptr) { // this demo not take into account .gltf who have data insise. besauce keepd easy just for demo if (vFileInfosPtr->SearchForExt(".gltf", true)) { @@ -745,6 +757,12 @@ int main(int, char**) { char timebuf[100]; int result = stat(bin_file_path_name.c_str(), &statInfos); if (!result) { + vFileInfosPtr->tooltipMessage = toStr("%s : %s\n%s : %s", // + (vFileInfosPtr->fileNameLevels[0] + ".gltf").c_str(), // + IGFD::Utils::FormatFileSize(vFileInfosPtr->fileSize).c_str(), // + (vFileInfosPtr->fileNameLevels[0] + ".bin").c_str(), // + IGFD::Utils::FormatFileSize((size_t)statInfos.st_size).c_str()); // + vFileInfosPtr->tooltipColumn = 1; vFileInfosPtr->fileSize += (size_t)statInfos.st_size; } else { // no bin, so escaped. @@ -755,7 +773,7 @@ int main(int, char**) { } } return true; - };*/ + }; ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", ICON_IGFD_FOLDER_OPEN " Choose a File", filters, config); } }