Skip to content

Commit

Permalink
Merge pull request #133 from alxbilger/icons
Browse files Browse the repository at this point in the history
[icons] Upgrade to font awesome 6
  • Loading branch information
hugtalbot authored Oct 2, 2024
2 parents 566ce49 + 3da4a40 commit 47dbe95
Show file tree
Hide file tree
Showing 9 changed files with 5,931 additions and 3,421 deletions.
5 changes: 3 additions & 2 deletions SofaImGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ FetchContent_MakeAvailable(ImPlot)

FetchContent_Declare(IconFontCppHeaders
GIT_REPOSITORY https://github.com/juliettef/IconFontCppHeaders
GIT_TAG 1856754666dff0db6c1af489a977f0ea2269f520
GIT_TAG bf610efb2e5d4361df799d0dfb5ae3977d7bba2e
)
FetchContent_MakeAvailable(IconFontCppHeaders)

Expand All @@ -55,7 +55,8 @@ set(IMGUI_HEADER_FILES
${imgui_SOURCE_DIR}/imgui_internal.h
${implot_SOURCE_DIR}/implot.h
${implot_SOURCE_DIR}/implot_internal.h
${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome5.h
${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome4.h
${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome6.h
${simpleini_SOURCE_DIR}/SimpleIni.h
resources/fa-regular-400.h
resources/fa-solid-900.h
Expand Down
1,236 changes: 783 additions & 453 deletions SofaImGui/resources/fa-regular-400.h

Large diffs are not rendered by default.

8,061 changes: 5,120 additions & 2,941 deletions SofaImGui/resources/fa-solid-900.h

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#include <backends/imgui_impl_glfw.h>
#include <backends/imgui_impl_opengl3.h>
#include <backends/imgui_impl_opengl2.h>
#include <IconsFontAwesome5.h>
#include <IconsFontAwesome4.h>
#include <IconsFontAwesome6.h>
#include <fa-regular-400.h>
#include <fa-solid-900.h>
#include <filesystem>
Expand Down Expand Up @@ -249,11 +249,11 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
static constexpr auto windowNamePerformances = ICON_FA_CHART_LINE " Performances";
static constexpr auto windowNameProfiler = ICON_FA_HOURGLASS " Profiler";
static constexpr auto windowNameSceneGraph = ICON_FA_SITEMAP " Scene Graph";
static constexpr auto windowNameDisplayFlags = ICON_FA_EYE " Display Flags";
static constexpr auto windowNamePlugins = ICON_FA_PLUS_CIRCLE " Plugins";
static constexpr auto windowNameDisplayFlags = ICON_FA_EYE " Display Flags" ;
static constexpr auto windowNamePlugins = ICON_FA_CIRCLE_PLUS " Plugins";
static constexpr auto windowNameComponents = ICON_FA_LIST " Components";
static constexpr auto windowNameLog = ICON_FA_TERMINAL " Log";
static constexpr auto windowNameSettings = ICON_FA_SLIDERS_H " Settings";
static constexpr auto windowNameSettings = ICON_FA_SLIDERS " Settings";


if (!*firstRunState.getStatePtr())
Expand Down Expand Up @@ -332,7 +332,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
}

const auto filename = baseGUI->getFilename();
if (ImGui::MenuItem(ICON_FA_REDO " Reload File"))
if (ImGui::MenuItem(ICON_FA_ROTATE_RIGHT " Reload File"))
{
if (!filename.empty() && helper::system::FileSystem::exists(filename))
{
Expand All @@ -347,7 +347,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
ImGui::EndTooltip();
}

if (ImGui::MenuItem(ICON_FA_TIMES_CIRCLE " Close Simulation"))
if (ImGui::MenuItem(ICON_FA_CIRCLE_XMARK " Close Simulation"))
{
sofa::simulation::node::unload(groot);
baseGUI->setSimulationIsRunning(false);
Expand Down Expand Up @@ -417,7 +417,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
ImGui::EndDisabled();

ImGui::Separator();
if (ImGui::MenuItem(ICON_FA_SAVE" Save Screenshot"))
if (ImGui::MenuItem(ICON_FA_FLOPPY_DISK" Save Screenshot"))
{
nfdchar_t *outPath;
std::array<nfdfilteritem_t, 1> filterItem{ {"Image", "jpg,png"} };
Expand Down Expand Up @@ -447,7 +447,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
}
}
ImGui::Separator();
if (ImGui::MenuItem(ICON_FA_REFRESH " Reset UI Layout"))
if (ImGui::MenuItem(ICON_FA_ARROWS_ROTATE " Reset UI Layout"))
{
resetView(dockspace_id,windowNameSceneGraph,windowNameLog,windowNameViewport);
}
Expand Down Expand Up @@ -488,7 +488,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
}
if (ImGui::Button(ICON_FA_STEP_FORWARD))
if (ImGui::Button(ICON_FA_FORWARD_STEP))
{
if (!animate)
{
Expand All @@ -506,7 +506,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
ImGui::PopStyleVar();
}
ImGui::SameLine();
if (ImGui::Button(ICON_FA_REDO_ALT))
if (ImGui::Button(ICON_FA_ROTATE_RIGHT))
{
groot->setTime(0.);
sofa::simulation::node::reset ( groot.get() );
Expand Down
6 changes: 3 additions & 3 deletions SofaImGui/src/SofaImGui/windows/Components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sofa/simulation/Simulation.h>
#include <imgui.h>
#include <nfd.h>
#include <IconsFontAwesome5.h>
#include <IconsFontAwesome6.h>
#include <SofaImGui/ImGuiDataWidget.h>
#include <sofa/type/vector.h>
#include <sofa/core/ObjectFactory.h>
Expand Down Expand Up @@ -319,7 +319,7 @@ namespace windows
}
ImGui::Text("%d loaded components", nbLoadedComponents);

if (ImGui::Button(ICON_FA_SAVE" "))
if (ImGui::Button(ICON_FA_FLOPPY_DISK" "))
{
nfdchar_t *outPath;
const nfdresult_t result = NFD_SaveDialog(&outPath, nullptr, 0, nullptr, "log.txt");
Expand Down Expand Up @@ -384,4 +384,4 @@ namespace windows
}


}
}
6 changes: 3 additions & 3 deletions SofaImGui/src/SofaImGui/windows/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <sofa/helper/AdvancedTimer.h>
#include <imgui.h>
#include <nfd.h>
#include <IconsFontAwesome5.h>
#include <IconsFontAwesome6.h>
#include <SofaImGui/ImGuiDataWidget.h>
#include <sofa/core/visual/VisualParams.h>
#include <sofa/component/visual/LineAxis.h>
Expand Down Expand Up @@ -68,7 +68,7 @@ namespace windows
ImGui::Checkbox("Show Info", &showInfo);
ImGui::SameLine();

if (ImGui::Button(ICON_FA_SAVE" "))
if (ImGui::Button(ICON_FA_FLOPPY_DISK" "))
{
nfdchar_t *outPath;
const nfdresult_t result = NFD_SaveDialog(&outPath, nullptr, 0, nullptr, "log.txt");
Expand Down Expand Up @@ -185,4 +185,4 @@ namespace windows
}


}
}
4 changes: 2 additions & 2 deletions SofaImGui/src/SofaImGui/windows/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <implot.h>

#include <IconsFontAwesome5.h>
#include <IconsFontAwesome6.h>

#include <sofa/helper/Utils.h>
#include <sofa/simulation/Node.h>
Expand Down Expand Up @@ -318,4 +318,4 @@ namespace windows {
}
}

}
}
8 changes: 4 additions & 4 deletions SofaImGui/src/SofaImGui/windows/SceneGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <sofa/simulation/Simulation.h>
#include <sofa/helper/AdvancedTimer.h>
#include <imgui.h>
#include <IconsFontAwesome5.h>
#include <IconsFontAwesome6.h>
#include <SofaImGui/ImGuiDataWidget.h>
#include <sofa/type/vector.h>
#include <sofa/simulation/Node.h>
Expand Down Expand Up @@ -58,7 +58,7 @@ namespace windows
const bool collapse = ImGui::Button(ICON_FA_COMPRESS);
ImGui::SameLine();
static bool showSearch = false;
if (ImGui::Button(ICON_FA_SEARCH))
if (ImGui::Button(ICON_FA_MAGNIFYING_GLASS))
{
showSearch = !showSearch;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace windows
}
else if (object->countLoggedMessages({sofa::helper::logging::Message::Warning})!=0)
{
icon = ICON_FA_EXCLAMATION_TRIANGLE;
icon = ICON_FA_TRIANGLE_EXCLAMATION;
objectColor = ImVec4(1.f, 0.5f, 0.f, 1.f); //orange
}
else if (object->countLoggedMessages({sofa::helper::logging::Message::Info, sofa::helper::logging::Message::Deprecated, sofa::helper::logging::Message::Advice})!=0)
Expand Down Expand Up @@ -523,4 +523,4 @@ namespace windows
}


}
}
6 changes: 3 additions & 3 deletions SofaImGui/src/SofaImGui/windows/ViewPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sofa/simulation/SceneLoaderFactory.h>
#include <sofa/simulation/Simulation.h>
#include <imgui.h>
#include <IconsFontAwesome5.h>
#include <IconsFontAwesome6.h>
#include <sofa/simulation/Node.h>
#include <sofa/component/visual/VisualGrid.h>
#include <sofa/component/visual/LineAxis.h>
Expand Down Expand Up @@ -90,7 +90,7 @@ namespace windows

if (ImGui::Begin("viewportSettingsMenuWindow", winManagerViewPort.getStatePtr(), window_flags))
{
if (ImGui::Button(ICON_FA_COG))
if (ImGui::Button(ICON_FA_GEAR))
{
ImGui::OpenPopup("viewportSettingsMenu");
}
Expand All @@ -116,7 +116,7 @@ namespace windows
grid->d_enable.setValue(!grid->d_enable.getValue());
}
}
if (ImGui::Selectable(ICON_FA_ARROWS_ALT " Show Axis"))
if (ImGui::Selectable(ICON_FA_UP_DOWN_LEFT_RIGHT " Show Axis"))
{
auto axis = groot->get<sofa::component::visual::LineAxis>();
if (!axis)
Expand Down

0 comments on commit 47dbe95

Please sign in to comment.