diff options
| -rw-r--r-- | build_win32.bat | 2 | ||||
| -rw-r--r-- | imgui/LICENSE (renamed from imgui/LICENSE.txt) | 0 | ||||
| -rw-r--r-- | imspinner/LICENSE | 21 | ||||
| -rw-r--r-- | imspinner/imspinner.h (renamed from imgui/imspinner.h) | 4 | ||||
| -rw-r--r-- | src/definitions.h | 6 | ||||
| -rw-r--r-- | src/main.cpp | 55 |
6 files changed, 77 insertions, 11 deletions
diff --git a/build_win32.bat b/build_win32.bat index d1e9705..3ec3c7a 100644 --- a/build_win32.bat +++ b/build_win32.bat @@ -7,7 +7,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary @set SOURCES=imgui/imgui*.cpp src/*.cpp @set LIBS=opengl32.lib Advapi32.lib Shell32.lib bin/debug/data.obj bin/debug/icon.res windres misc/icon.rc -O coff -o bin/debug/icon.res -ld -r -b binary -o bin/debug/data.obj LICENSE misc/logo_64.png +ld -r -b binary -o bin/debug/data.obj LICENSE misc/logo_64.png imgui/LICENSE imspinner/LICENSE mkdir %OUT_DIR% cl /nologo /Zi /MD /EHsc /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fd%OUT_DIR%/vc140.pdb /Fo%OUT_DIR%/ /link %LIBS% if "%1"=="-r" call "bin/debug/text-search.exe" diff --git a/imgui/LICENSE.txt b/imgui/LICENSE index 3282f5b..3282f5b 100644 --- a/imgui/LICENSE.txt +++ b/imgui/LICENSE diff --git a/imspinner/LICENSE b/imspinner/LICENSE new file mode 100644 index 0000000..d278648 --- /dev/null +++ b/imspinner/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021-2022 Dalerank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/imgui/imspinner.h b/imspinner/imspinner.h index a35a7b1..d79ba81 100644 --- a/imgui/imspinner.h +++ b/imspinner/imspinner.h @@ -34,8 +34,8 @@ #include <cctype> // imgui headers -#include "imgui.h" -#include "imgui_internal.h" +#include "../imgui/imgui.h" +#include "../imgui/imgui_internal.h" namespace ImSpinner { diff --git a/src/definitions.h b/src/definitions.h index 491f67c..a078c09 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -9,6 +9,12 @@ extern "C" extern unsigned char _binary_LICENSE_start[]; extern unsigned char _binary_LICENSE_end[]; +extern unsigned char _binary_imgui_LICENSE_start[]; +extern unsigned char _binary_imgui_LICENSE_end[]; + +extern unsigned char _binary_imspinner_LICENSE_start[]; +extern unsigned char _binary_imspinner_LICENSE_end[]; + extern unsigned char _binary_misc_logo_64_png_start[]; extern unsigned char _binary_misc_logo_64_png_end[]; } diff --git a/src/main.cpp b/src/main.cpp index 317a56e..40874c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,7 @@ #include "../imgui/imgui.h" #include "../imgui/imgui_spectrum.h" #include "../imgui/imgui_impl_opengl3_loader.h" -#include "../imgui/imspinner.h" +#include "../imspinner/imspinner.h" #include "../utf8.h" #include "definitions.h" #include "search.h" @@ -59,14 +59,53 @@ static void _ts_create_popups() { // About window if (ImGui::BeginPopupModal("About Text-Search", NULL, ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove)) { - ImGui::SetWindowSize({600, 0}); + ImGui::SetWindowSize({600, 400}); - //ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 64 - 10); - //ImGui::Image((void*)(intptr_t)img_logo.id, {64, 64}); + char* name = "Text-Search"; + char* link = "https://github.com/aldrik-ramaekers/text-search"; + + ImGui::SetCursorPosX((ImGui::GetWindowWidth() - 64) / 2.0f); + ImGui::Image((void*)(intptr_t)img_logo.id, {64, 64}); + ImGui::Dummy({0, 20}); + + ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize(name).x)/2.0f); + ImGui::Text(name); + ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize(link).x)/2.0f); + ImGui::Text(link); + ImGui::Dummy({0, 20}); - char* license = (char*)_binary_LICENSE_start; - int license_length = _binary_LICENSE_end - _binary_LICENSE_start; - ImGui::Text("%.*s", license_length, license); + if (ImGui::CollapsingHeader("License")) { + char* license = (char*)_binary_LICENSE_start; + int license_length = _binary_LICENSE_end - _binary_LICENSE_start; + ImGui::Text("%.*s", license_length, license); + } + + ImGui::SeparatorText("Dependencies"); + { + if (ImGui::TreeNode("https://github.com/ocornut/imgui")) { + char* license = (char*)_binary_imgui_LICENSE_start; + int license_length = _binary_imgui_LICENSE_end - _binary_imgui_LICENSE_start; + ImGui::Text("%.*s", license_length, license); + ImGui::TreePop(); + } + + if (ImGui::TreeNode("https://github.com/dalerank/imspinner")) { + char* license = (char*)_binary_imspinner_LICENSE_start; + int license_length = _binary_imspinner_LICENSE_end - _binary_imspinner_LICENSE_start; + ImGui::Text("%.*s", license_length, license); + ImGui::TreePop(); + } + + if (ImGui::TreeNode("https://github.com/nothings/stb/blob/master/stb_image.h")) { + ImGui::Text("public domain"); + ImGui::TreePop(); + } + + if (ImGui::TreeNode("https://github.com/sheredom/utf8.h")) { + ImGui::Text("public domain"); + ImGui::TreePop(); + } + } ImGui::Dummy({0, 70}); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); @@ -74,7 +113,7 @@ static void _ts_create_popups() { open_about_window = false; ImGui::CloseCurrentPopup(); } - ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::CalcTextSize(TS_VERSION).x - 15); + ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::CalcTextSize(TS_VERSION).x - 25); ImGui::Text(TS_VERSION); ImGui::PopStyleVar(); |
