Skip to content

Commit

Permalink
[FIX] : fix last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Mar 9, 2024
1 parent 2a45c4b commit f96f05e
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Leak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ImGuiFileDialog_App_Unix_${{ matrix.fs }}_FS
path: build/ImGuiFileDialog_App_Unix
path: bin/ImGuiFileDialog_App_Unix
2 changes: 1 addition & 1 deletion .github/workflows/Linux_Clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ImGuiFileDialog_App_Linux_${{ matrix.fs }}_FS
path: build/ImGuiFileDialog_App_Unix
path: bin/ImGuiFileDialog_App_Unix
2 changes: 1 addition & 1 deletion .github/workflows/Linux_Gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ImGuiFileDialog_App_Linux_${{ matrix.fs }}_FS
path: build/ImGuiFileDialog_App_Unix
path: bin/ImGuiFileDialog_App_Unix
2 changes: 1 addition & 1 deletion .github/workflows/Osx_Clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ImGuiFileDialog_App_Linux_${{ matrix.fs }}_FS
path: build/ImGuiFileDialog_App_Unix
path: bin/ImGuiFileDialog_App_Unix
2 changes: 1 addition & 1 deletion .github/workflows/Osx_Gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ImGuiFileDialog_App_Linux_${{ matrix.fs }}_FS
path: build/ImGuiFileDialog_App_Unix
path: bin/ImGuiFileDialog_App_Unix
2 changes: 1 addition & 1 deletion .github/workflows/Win_Clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ImGuiFileDialog_App_Win32_${{ matrix.fs }}_FS
path: build\Release\ImGuiFileDialog_App_Win32.exe
path: bin\ImGuiFileDialog_App_Win32.exe
2 changes: 1 addition & 1 deletion .github/workflows/Win_Msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ImGuiFileDialog_App_Win32_${{ matrix.fs }}_FS
path: build\Release\ImGuiFileDialog_App_Win32.exe
path: bin\ImGuiFileDialog_App_Win32.exe
27 changes: 26 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ option(USE_DIRENT_FILESYSTEM "Enable the default filesystem with dirent" ON)
option(USE_STD_FILESYSTEM "Enable std::filesystem use for path and ImGuiFileDialog" OFF)
option(USE_BOOST_FILESYSTEM "Enable the demo of custom filesystem here with boost" OFF)

## some defines for debug mode (before 3rdparty.cmake)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")

## some defines for debug mode (before 3rdparty.cmake)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")

set(FINAL_BIN_DIR ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_PDB_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}/debug")

set(CMAKE_INSTALL_PREFIX .)
set(CMAKE_INSTALL_BINDIR .)

if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX _debug)
endif()

if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(USE_STD_FILESYSTEM ON CACHE BOOL "" FORCE)
endif()
Expand Down Expand Up @@ -154,6 +170,11 @@ add_executable(${PROJECT}
${IMGUIIMPL_SOURCES})
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}")
install(TARGETS ${PROJECT} DESTINATION ${CMAKE_INSTALL_PREFIX})

if(UNIX)
target_compile_options(${PROJECT} PUBLIC -Wno-unknown-pragmas)
Expand Down Expand Up @@ -234,4 +255,8 @@ target_include_directories(ImGuiFileDialog PRIVATE
if (USE_TEST)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
endif()
endif()

set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}")
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}")
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}")
30 changes: 24 additions & 6 deletions DemoDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ImGuiFileDialog.h"
#include "CustomFont.cpp"
#include "Roboto_Medium.cpp"
//#include "HanyISentyPagodaRegular.cpp"
#include <cstdio>
#include <sstream>
#include <fstream>
Expand Down Expand Up @@ -319,12 +320,29 @@ void DemoDialog::init(const float& vFontSize) {
});
#endif // USE_THUMBNAILS

ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_RM, vFontSize);
static const ImWchar icons_ranges[] = {ICON_MIN_IGFD, ICON_MAX_IGFD, 0};
ImFontConfig icons_config;
icons_config.MergeMode = true;
icons_config.PixelSnapH = true;
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_IGFD, vFontSize, &icons_config, icons_ranges);
// Fonts
{
static const ImWchar icons_ranges_0[] = {0, ICON_MAX_RM, 0};
ImFontConfig icons_config_0;
icons_config_0.GlyphRanges = ImGui::GetIO().Fonts->GetGlyphRangesChineseFull();
// ImGui::GetIO().Fonts->AddFontDefault(&icons_config_0);
}
{
static const ImWchar icons_ranges_1[] = {0, ICON_MAX_RM, 0};
ImFontConfig icons_config_1;
icons_config_1.GlyphRanges = ImGui::GetIO().Fonts->GetGlyphRangesChineseFull();
// ImGui::GetIO().Fonts->AddFontFromFileTTF("HanyiSentyPagodaRegular.ttf", vFontSize, &icons_config_1);
}
{ // Boboto Font
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_RM, vFontSize);
}
{ // glyphs
static const ImWchar icons_ranges_3[] = {ICON_MIN_IGFD, ICON_MAX_IGFD, 0};
ImFontConfig icons_config_3;
icons_config_3.MergeMode = true;
icons_config_3.PixelSnapH = true;
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_IGFD, vFontSize, &icons_config_3, icons_ranges_3);
}

// Our state

Expand Down

0 comments on commit f96f05e

Please sign in to comment.