From e22441e00b8595617b55d89dee8a7b5b6f1b87ae Mon Sep 17 00:00:00 2001 From: aiekick Date: Thu, 17 Feb 2022 22:23:14 +0100 Subject: [PATCH] [FIX] : fix some warnings --- ImGuiFileDialog.cpp | 16 ++++++++++------ ImGuiFileDialogConfig.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ImGuiFileDialog.cpp b/ImGuiFileDialog.cpp index d63fda8..a9e4a39 100644 --- a/ImGuiFileDialog.cpp +++ b/ImGuiFileDialog.cpp @@ -141,7 +141,8 @@ namespace IGFD #define okCancelButtonAlignement 0.0f #endif // okCancelButtonAlignement #ifndef invertOkAndCancelButtons -#define invertOkAndCancelButtons false +// 0 => disabled, 1 => enabled +#define invertOkAndCancelButtons 0 #endif // invertOkAndCancelButtons #ifndef resetButtonString #define resetButtonString "R" @@ -4116,8 +4117,10 @@ namespace IGFD return true; } - if (!invertOkAndCancelButtons) - ImGui::SameLine(); +#if !invertOkAndCancelButtons + ImGui::SameLine(); +#endif + } return false; @@ -4131,9 +4134,10 @@ namespace IGFD prFileDialogInternal.puIsOk = false; return true; } - - if (invertOkAndCancelButtons) - ImGui::SameLine(); + +#if invertOkAndCancelButtons + ImGui::SameLine(); +#endif return false; } diff --git a/ImGuiFileDialogConfig.h b/ImGuiFileDialogConfig.h index b30e327..d7d6256 100644 --- a/ImGuiFileDialogConfig.h +++ b/ImGuiFileDialogConfig.h @@ -78,7 +78,7 @@ //#define cancelButtonWidth 0.0f //alignement [0:1], 0.0 is left, 0.5 middle, 1.0 right, and other ratios //#define okCancelButtonAlignement 0.0f -//#define invertOkAndCancelButtons false +//#define invertOkAndCancelButtons 0 // DateTimeFormat // see strftime functionin for customize