feat(settings): surface the console color toggles as checkboxes
Add "Color accents" and "Text colors" checkboxes under the effects section (both layout variants) so the console output display prefs are discoverable outside the console toolbar. They mirror the toolbar buttons — bound live to the ConsoleTab statics and written through to settings on change. Unlike scanline/theme-effects they carry no GPU cost, so a small helper closes the effects row's BeginDisabled(low_spec), draws them on their own always- enabled row, and reopens it for the acrylic sliders (net-balanced). Adds console_accents / console_text_colors labels + 8 translations; the tooltips reuse the existing toggle keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -492,6 +492,31 @@ static void saveSettingsPageState(config::Settings* settings) {
|
||||
settings->save();
|
||||
}
|
||||
|
||||
// Console output color toggles (accent bars + per-channel text color), shown on their own row under
|
||||
// the effects checkboxes. They mirror the console toolbar buttons and carry no GPU cost, so — unlike
|
||||
// scanline/theme-effects — they stay enabled in low-spec: the caller has an open
|
||||
// BeginDisabled(low_spec) around the effects row, so close it, draw these live-bound to the ConsoleTab
|
||||
// statics, then reopen it. Persisted immediately (the startup restore in App loads them on launch).
|
||||
static void renderConsoleColorToggles(App* app) {
|
||||
ImGui::EndDisabled();
|
||||
bool accents = ConsoleTab::s_line_accents_enabled;
|
||||
if (ImGui::Checkbox(TrId("console_accents", "con_accents").c_str(), &accents)) {
|
||||
ConsoleTab::s_line_accents_enabled = accents;
|
||||
app->settings()->setConsoleLineAccents(accents);
|
||||
app->settings()->save();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("console_toggle_accents"));
|
||||
ImGui::SameLine(0, Layout::spacingLg());
|
||||
bool textColor = ConsoleTab::s_line_text_color_enabled;
|
||||
if (ImGui::Checkbox(TrId("console_text_colors", "con_textcol").c_str(), &textColor)) {
|
||||
ConsoleTab::s_line_text_color_enabled = textColor;
|
||||
app->settings()->setConsoleTextColor(textColor);
|
||||
app->settings()->save();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("console_toggle_text_color"));
|
||||
ImGui::BeginDisabled(s_settingsState.low_spec_mode);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Settings Page Renderer
|
||||
// ============================================================================
|
||||
@@ -874,6 +899,9 @@ void RenderSettingsPage(App* app) {
|
||||
}
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_theme_effects"));
|
||||
|
||||
// Console output color toggles (own row — no GPU cost, enabled even in low-spec).
|
||||
renderConsoleColorToggles(app);
|
||||
|
||||
// Row 1: Acrylic preset slider + Noise slider (side by side, labels above)
|
||||
float effCtrlMinW = S.drawElement("components.settings-page", "effects-input-min-width").size;
|
||||
float halfW = (contentW - Layout::spacingLg()) * 0.5f;
|
||||
@@ -1126,6 +1154,9 @@ void RenderSettingsPage(App* app) {
|
||||
}
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_theme_effects"));
|
||||
|
||||
// Console output color toggles (own row — no GPU cost, enabled even in low-spec).
|
||||
renderConsoleColorToggles(app);
|
||||
|
||||
float ctrlW = std::max(S.drawElement("components.settings-page", "effects-input-min-width").size,
|
||||
availWidth - pad * 2.0f);
|
||||
ImGui::TextUnformatted(TR("acrylic"));
|
||||
|
||||
@@ -1292,6 +1292,8 @@ void I18n::loadBuiltinEnglish()
|
||||
strings_["console_zoom_out"] = "Zoom out";
|
||||
strings_["console_toggle_accents"] = "Toggle line color accents";
|
||||
strings_["console_toggle_text_color"] = "Toggle line text colors";
|
||||
strings_["console_accents"] = "Color accents";
|
||||
strings_["console_text_colors"] = "Text colors";
|
||||
|
||||
// --- Export All Keys Dialog ---
|
||||
strings_["export_keys_btn"] = "Export Keys";
|
||||
|
||||
Reference in New Issue
Block a user