diff --git a/src/ui/windows/mining_controls.cpp b/src/ui/windows/mining_controls.cpp index 6b266c3..f358881 100644 --- a/src/ui/windows/mining_controls.cpp +++ b/src/ui/windows/mining_controls.cpp @@ -143,6 +143,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo& auto applyThreads = [&](int tc) { tc = std::clamp(tc, 1, max_threads); if (tc == s_selected_threads) return; + if (s_benchmark.active()) return; // the benchmark owns the thread count while it runs (as the grid) s_selected_threads = tc; // shown at once; the App applies it ~0.5 s after the last change app->selectMiningThreads(tc); }; @@ -189,7 +190,7 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo& // "-" button (disabled at 1 thread) if (rectStepBtn("##ThreadMinus", ICON_MD_REMOVE, sx, TR("mining_threads_minus_tooltip"), - s_selected_threads <= 1)) + s_selected_threads <= 1 || s_benchmark.active())) applyThreads(s_selected_threads - 1); sx += sideW + g; @@ -202,15 +203,18 @@ void RenderMiningControls(App* app, const WalletState& state, const MiningInfo& ImGui::SetCursorScreenPos(ImVec2(sx, sy)); ImGui::SetNextItemWidth(fieldW); int tc = s_selected_threads; + const bool benchLocked = s_benchmark.active(); // read-only while the benchmark runs (as -/+) + ImGui::BeginDisabled(benchLocked); if (ImGui::InputInt("##ThreadCountInput", &tc, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) applyThreads(tc); if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("mining_threads_input_tooltip")); + ImGui::EndDisabled(); ImGui::PopStyleVar(); sx += fieldW + g; // "+" button (disabled at max_threads) if (rectStepBtn("##ThreadPlus", ICON_MD_ADD, sx, TR("mining_threads_plus_tooltip"), - s_selected_threads >= max_threads)) + s_selected_threads >= max_threads || s_benchmark.active())) applyThreads(s_selected_threads + 1); ImGui::SetCursorScreenPos(savedCur);