10#include <IconsForkAwesome.h>
12#include <imgui_stdlib.h>
17 _fileOpenDialog(false, true)
33 const U32 flags = ImGuiWindowFlags_NoResize |
34 ImGuiWindowFlags_NoCollapse |
35 ImGuiWindowFlags_AlwaysAutoResize |
36 ImGuiWindowFlags_NoDocking |
37 (
_openDialog ? ImGuiWindowFlags_NoBringToFrontOnFocus : ImGuiWindowFlags_Tooltip);
40 if (!ImGui::Begin(
"Editor options",
nullptr, flags))
47 ImGui::Text(ICON_FK_PLUS_SQUARE_O);
49 if (ImGui::SliderFloat(
"Grid axis width", &axisWidth, 0.01f, 10.0f,
"%.3f"))
56 if (ImGui::SliderFloat(
"Grid scale", &gridLineWidth, 1.f, 10.f,
"%.3f"))
63 I32 selection = crtThemeIdx;
70 undo.
_name =
"Theme Selection";
86 ImGui::Text(
"Text Editor:" ); ImGui::SameLine();
87 if (ImGui::InputText(
"##Text Editor:", &externalTextEditorPath, ImGuiInputTextFlags_ReadOnly))
92 const bool openDialog = ImGui::Button(
"Select");
102 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
115 ImGui::SetItemDefaultFocus();
117 if (ImGui::Button(ICON_FK_FLOPPY_O
" Save", ImVec2(120, 0)))
128 if (ImGui::Button(
"Defaults", ImVec2(120, 0)))
139 externalTextEditorPath =
_fileOpenDialog.
chooseFileDialog(openDialog,
nullptr,
nullptr,
"Choose text editor", ImVec2(-1, -1), ImGui::GetMainViewport()->WorkPos);
#define PROFILE_SCOPE_AUTO(CATEGORY)
static ImGuiStyleEnum getTheme(const Editor &editor) noexcept
static void setTheme(Editor &editor, const ImGuiStyleEnum newTheme) noexcept
static const ResourcePath & externalTextEditorPath(const Editor &editor) noexcept
size_t UndoStackSize() const noexcept
void registerUndoEntry(const UndoEntry< T > &entry)
void infiniteGridScale(const F32 value) noexcept
void infiniteGridAxisWidth(const F32 value) noexcept
ImGuiFs::Dialog _fileOpenDialog
void update(U64 deltaTimeUS)
EditorOptionsWindow(PlatformContext &context)
PlatformContext & _context
Editor & editor() noexcept
constexpr Optick::Category::Type GUI
Handle console commands that start with a forward slash.
constexpr I32 to_I32(const T value)
bool ResetStyle(int styleEnum, ImGuiStyle &style)
const char ** GetDefaultStyleNames()
StringReturnType< N > string() const noexcept
DELEGATE_STD< void, const T & > _dataSetter
IMGUI_API const char * chooseFileDialog(bool dialogTriggerButton, const char *directory=NULL, const char *fileFilterExtensionString=NULL, const char *windowTitle=NULL, const ImVec2 &windowSize=ImVec2(-1,-1), const ImVec2 &windowPos=ImVec2(-1,-1), const float windowAlpha=0.875f)
IMGUI_API bool hasUserJustCancelledDialog() const
static ImVec4 WindowLTRBOffsets