diff --git a/src/imgui/taskbar.cpp b/src/imgui/taskbar.cpp index ace7e8c..c58bc76 100644 --- a/src/imgui/taskbar.cpp +++ b/src/imgui/taskbar.cpp @@ -262,7 +262,7 @@ namespace anm2ed::imgui auto& rows = settings.generateRows; auto& columns = settings.generateColumns; auto& count = settings.generateCount; - auto& delay = settings.generateDelay; + auto& delay = settings.generateDuration; auto& zoom = settings.generateZoom; auto& zoomStep = settings.inputZoomStep; @@ -278,7 +278,7 @@ namespace anm2ed::imgui input_int_range("Count", count, anm2::FRAME_NUM_MIN, rows * columns); - ImGui::InputInt("Delay", &delay, STEP, STEP_FAST); + ImGui::InputInt("Duration", &delay, STEP, STEP_FAST); } ImGui::EndChild(); @@ -513,6 +513,11 @@ namespace anm2ed::imgui settings = editSettings; imgui::theme_set((theme::Type)editSettings.theme); manager.chords_set(settings); + + ImGui::GetIO().KeyRepeatDelay = settings.keyboardRepeatDelay; + ImGui::GetIO().KeyRepeatRate = settings.keyboardRepeatRate; + ImGui::GetStyle().FontScaleMain = settings.uiScale; + SnapshotStack::max_size_set(settings.fileSnapshotStackSize); for (auto& document : manager.documents) document.snapshots.apply_limit(); diff --git a/src/imgui/window/frame_properties.cpp b/src/imgui/window/frame_properties.cpp index 2135663..f0339c9 100644 --- a/src/imgui/window/frame_properties.cpp +++ b/src/imgui/window/frame_properties.cpp @@ -137,7 +137,7 @@ namespace anm2ed::imgui auto& isPivot = settings.changeIsPivot; auto& isScale = settings.changeIsScale; auto& isRotation = settings.changeIsRotation; - auto& isDelay = settings.changeIsDelay; + auto& isDuration = settings.changeIsDuration; auto& isTint = settings.changeIsTint; auto& isColorOffset = settings.changeIsColorOffset; auto& isVisibleSet = settings.changeIsVisibleSet; @@ -148,7 +148,7 @@ namespace anm2ed::imgui auto& pivot = settings.changePivot; auto& scale = settings.changeScale; auto& rotation = settings.changeRotation; - auto& duration = settings.changeDelay; + auto& duration = settings.changeDuration; auto& tint = settings.changeTint; auto& colorOffset = settings.changeColorOffset; auto& isVisible = settings.changeIsVisible; @@ -190,7 +190,7 @@ namespace anm2ed::imgui float2_value("##Is Pivot", "Pivot", isPivot, pivot); float2_value("##Is Scale", "Scale", isScale, scale); float_value("##Is Rotation", "Rotation", isRotation, rotation); - duration_value("##Is Delay", "Delay", isDelay, duration); + duration_value("##Is Duration", "Duration", isDuration, duration); color4_value("##Is Tint", "Tint", isTint, tint); color3_value("##Is Color Offset", "Color Offset", isColorOffset, colorOffset); bool_value("##Is Visible", "Visible", isVisibleSet, isVisible); @@ -206,7 +206,7 @@ namespace anm2ed::imgui if (isPivot) frameChange.pivot = std::make_optional(pivot); if (isScale) frameChange.scale = std::make_optional(scale); if (isRotation) frameChange.rotation = std::make_optional(rotation); - if (isDelay) frameChange.duration = std::make_optional(duration); + if (isDuration) frameChange.duration = std::make_optional(duration); if (isTint) frameChange.tint = std::make_optional(tint); if (isColorOffset) frameChange.colorOffset = std::make_optional(colorOffset); if (isVisibleSet) frameChange.isVisible = std::make_optional(isVisible); diff --git a/src/loader.cpp b/src/loader.cpp index ab517c1..88949f4 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -193,6 +193,9 @@ namespace anm2ed io.IniFilename = nullptr; io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; + io.KeyRepeatDelay = settings.keyboardRepeatDelay; + io.KeyRepeatRate = settings.keyboardRepeatRate; + ImGui::GetStyle().FontScaleMain = settings.uiScale; io.ConfigWindowsMoveFromTitleBarOnly = true; ImGui::LoadIniSettingsFromDisk(settings_path().c_str()); diff --git a/src/settings.h b/src/settings.h index f281934..c3cd151 100644 --- a/src/settings.h +++ b/src/settings.h @@ -66,7 +66,7 @@ namespace anm2ed X(CHANGE_IS_PIVOT, changeIsPivot, "##Is Pivot", BOOL, false) \ X(CHANGE_IS_SCALE, changeIsScale, "##Is Scale", BOOL, false) \ X(CHANGE_IS_ROTATION, changeIsRotation, "##Is Rotation", BOOL, false) \ - X(CHANGE_IS_DELAY, changeIsDelay, "##Is Delay", BOOL, false) \ + X(CHANGE_IS_DURATION, changeIsDuration, "##Is Duration", BOOL, false) \ X(CHANGE_IS_TINT, changeIsTint, "##Is Tint", BOOL, false) \ X(CHANGE_IS_COLOR_OFFSET, changeIsColorOffset, "##Is Color Offset", BOOL, false) \ X(CHANGE_IS_VISIBLE_SET, changeIsVisibleSet, "##Is Visible", BOOL, false) \ @@ -77,7 +77,7 @@ namespace anm2ed X(CHANGE_PIVOT, changePivot, "Pivot", VEC2, {}) \ X(CHANGE_SCALE, changeScale, "Scale", VEC2, {}) \ X(CHANGE_ROTATION, changeRotation, "Rotation", FLOAT, 0.0f) \ - X(CHANGE_DELAY, changeDelay, "Delay", INT, 0) \ + X(CHANGE_DURATION, changeDuration, "Duration", INT, 0) \ X(CHANGE_TINT, changeTint, "Tint", VEC4, {}) \ X(CHANGE_COLOR_OFFSET, changeColorOffset, "Color Offset", VEC3, {}) \ X(CHANGE_IS_VISIBLE, changeIsVisible, "Visible", BOOL, false) \ @@ -109,7 +109,7 @@ namespace anm2ed X(GENERATE_ROWS, generateRows, "Rows", INT, 4) \ X(GENERATE_COLUMNS, generateColumns, "Columns", INT, 4) \ X(GENERATE_COUNT, generateCount, "Count", INT, 16) \ - X(GENERATE_DELAY, generateDelay, "Delay", INT, 1) \ + X(GENERATE_DURATION, generateDuration, "Duration", INT, 1) \ X(GENERATE_ZOOM, generateZoom, "Zoom", FLOAT, 100.0f) \ \ X(EDITOR_IS_GRID, editorIsGrid, "Grid", BOOL, true) \ diff --git a/src/state.cpp b/src/state.cpp index 89bef5a..e358b37 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -86,9 +86,6 @@ namespace anm2ed dockspace.update(taskbar, documents, manager, settings, resources, dialog, clipboard); toasts.update(); - ImGui::GetStyle().FontScaleMain = settings.uiScale; - ImGui::GetIO().KeyRepeatDelay = settings.keyboardRepeatDelay; - ImGui::GetIO().KeyRepeatRate = settings.keyboardRepeatRate; SDL_GetWindowSize(window, &settings.windowSize.x, &settings.windowSize.y); if (isQuitting && manager.documents.empty()) isQuit = true;