Skip to content

Commit

Permalink
Update to Dear ImGui v1.91.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mtheall committed Nov 17, 2024
1 parent cedd983 commit d4050d3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
cmake_minimum_required(VERSION 3.12)

project(ftpd VERSION 3.2.0)
project(ftpd VERSION 3.2.1)

if(CMAKE_EXPORT_COMPILE_COMMANDS)
list(APPEND CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
list(APPEND CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
endif()

include(FetchContent)
cmake_policy(SET CMP0169 OLD)

FetchContent_Declare(gsl
GIT_REPOSITORY https://github.com/microsoft/GSL.git
GIT_TAG v4.0.0
URL https://github.com/microsoft/GSL/archive/refs/tags/v4.1.0.tar.gz
URL_HASH MD5=7e6883a254e73a8b2368a0d26efe68a7
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
FetchContent_Populate(gsl)

FetchContent_Declare(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.91.4
URL https://github.com/ocornut/imgui/archive/refs/tags/v1.91.5.tar.gz
URL_HASH MD5=264b2c35eaa1ab1595eb9afe080b4e1a
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
PATCH_COMMAND patch -i ${CMAKE_CURRENT_SOURCE_DIR}/imgui.patch
)
FetchContent_Populate(imgui)

Expand Down
16 changes: 16 additions & 0 deletions imgui.patch
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions source/3ds/imgui_ctru.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ void updateKeyboard (ImGuiIO &io_)
swkbdInit (&kbd, SWKBD_TYPE_NORMAL, 2, -1);
swkbdSetButton (&kbd, SWKBD_BUTTON_LEFT, "Cancel", false);
swkbdSetButton (&kbd, SWKBD_BUTTON_RIGHT, "OK", true);
swkbdSetInitialText (
&kbd, std::string (textState.InitialTextA.Data, textState.InitialTextA.Size).c_str ());
swkbdSetInitialText (&kbd,
std::string (textState.TextToRevertTo.Data, textState.TextToRevertTo.Size).c_str ());

if (textState.Flags & ImGuiInputTextFlags_Password)
swkbdSetPasswordMode (&kbd, SWKBD_PASSWORD_HIDE_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions source/switch/imgui_nx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,8 +1571,8 @@ void updateKeyboard (HidKeyboardState const &kbState_, ImGuiIO &io_)
SwkbdConfig kbd;
swkbdCreate (&kbd, 0);
swkbdConfigMakePresetDefault (&kbd);
swkbdConfigSetInitialText (
&kbd, std::string (textState.InitialTextA.Data, textState.InitialTextA.Size).c_str ());
swkbdConfigSetInitialText (&kbd,
std::string (textState.TextToRevertTo.Data, textState.TextToRevertTo.Size).c_str ());

char buffer[32];
if (R_SUCCEEDED (swkbdShow (&kbd, buffer, sizeof (buffer))))
Expand Down

0 comments on commit d4050d3

Please sign in to comment.