Update to Dear ImGui v1.91.5

This commit is contained in:
Michael Theall 2024-11-17 01:19:41 -06:00
parent cedd983b4d
commit d4050d3e39
4 changed files with 29 additions and 9 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
project(ftpd VERSION 3.2.0) project(ftpd VERSION 3.2.1)
if(CMAKE_EXPORT_COMPILE_COMMANDS) if(CMAKE_EXPORT_COMPILE_COMMANDS)
list(APPEND CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}) list(APPEND CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
@ -8,16 +8,20 @@ if(CMAKE_EXPORT_COMPILE_COMMANDS)
endif() endif()
include(FetchContent) include(FetchContent)
cmake_policy(SET CMP0169 OLD)
FetchContent_Declare(gsl FetchContent_Declare(gsl
GIT_REPOSITORY https://github.com/microsoft/GSL.git URL https://github.com/microsoft/GSL/archive/refs/tags/v4.1.0.tar.gz
GIT_TAG v4.0.0 URL_HASH MD5=7e6883a254e73a8b2368a0d26efe68a7
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
) )
FetchContent_Populate(gsl) FetchContent_Populate(gsl)
FetchContent_Declare(imgui FetchContent_Declare(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git URL https://github.com/ocornut/imgui/archive/refs/tags/v1.91.5.tar.gz
GIT_TAG v1.91.4 URL_HASH MD5=264b2c35eaa1ab1595eb9afe080b4e1a
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
PATCH_COMMAND patch -i ${CMAKE_CURRENT_SOURCE_DIR}/imgui.patch
) )
FetchContent_Populate(imgui) FetchContent_Populate(imgui)

16
imgui.patch Normal file
View File

@ -0,0 +1,16 @@
--- imgui.cpp
+++ imgui.cpp
@@ -13711,7 +13711,13 @@
g.NavWindowingListWindow = FindWindowByName("###NavWindowingList");
const ImGuiViewport* viewport = GetMainViewport();
SetNextWindowSizeConstraints(ImVec2(viewport->Size.x * 0.20f, viewport->Size.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
+#ifdef __3DS__
+ // center on top screen
+ ImVec2 center = viewport->GetCenter();
+ SetNextWindowPos(ImVec2(center.x, center.y * 0.5f), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
+#else
SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
+#endif
PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f);
Begin("###NavWindowingList", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings);
if (g.ContextName[0] != 0)

View File

@ -173,8 +173,8 @@ void updateKeyboard (ImGuiIO &io_)
swkbdInit (&kbd, SWKBD_TYPE_NORMAL, 2, -1); swkbdInit (&kbd, SWKBD_TYPE_NORMAL, 2, -1);
swkbdSetButton (&kbd, SWKBD_BUTTON_LEFT, "Cancel", false); swkbdSetButton (&kbd, SWKBD_BUTTON_LEFT, "Cancel", false);
swkbdSetButton (&kbd, SWKBD_BUTTON_RIGHT, "OK", true); swkbdSetButton (&kbd, SWKBD_BUTTON_RIGHT, "OK", true);
swkbdSetInitialText ( swkbdSetInitialText (&kbd,
&kbd, std::string (textState.InitialTextA.Data, textState.InitialTextA.Size).c_str ()); std::string (textState.TextToRevertTo.Data, textState.TextToRevertTo.Size).c_str ());
if (textState.Flags & ImGuiInputTextFlags_Password) if (textState.Flags & ImGuiInputTextFlags_Password)
swkbdSetPasswordMode (&kbd, SWKBD_PASSWORD_HIDE_DELAY); swkbdSetPasswordMode (&kbd, SWKBD_PASSWORD_HIDE_DELAY);

View File

@ -1571,8 +1571,8 @@ void updateKeyboard (HidKeyboardState const &kbState_, ImGuiIO &io_)
SwkbdConfig kbd; SwkbdConfig kbd;
swkbdCreate (&kbd, 0); swkbdCreate (&kbd, 0);
swkbdConfigMakePresetDefault (&kbd); swkbdConfigMakePresetDefault (&kbd);
swkbdConfigSetInitialText ( swkbdConfigSetInitialText (&kbd,
&kbd, std::string (textState.InitialTextA.Data, textState.InitialTextA.Size).c_str ()); std::string (textState.TextToRevertTo.Data, textState.TextToRevertTo.Size).c_str ());
char buffer[32]; char buffer[32];
if (R_SUCCEEDED (swkbdShow (&kbd, buffer, sizeof (buffer)))) if (R_SUCCEEDED (swkbdShow (&kbd, buffer, sizeof (buffer))))