feat(console): toolbar toggle to hide per-line color accent bars
Adds a paint-bucket toggle button to the console toolbar (in the appearance cluster next to zoom) that shows/hides the per-line left color accent bars for a cleaner monochrome gutter. The icon reflects state (FORMAT_COLOR_FILL when on, a dimmed FORMAT_COLOR_RESET when off) with a tooltip. Session-only, like the console zoom factor; default on. Adds console_toggle_accents to the English source and all eight translations (no new CJK glyphs — the subset font already covers them). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,7 @@ ImU32 ConsoleTab::COLOR_DAEMON = IM_COL32(160, 160, 160, 180);
|
||||
ImU32 ConsoleTab::COLOR_INFO = IM_COL32(191, 209, 229, 255);
|
||||
ImU32 ConsoleTab::COLOR_RPC = IM_COL32(120, 180, 255, 210);
|
||||
bool ConsoleTab::s_scanline_enabled = true;
|
||||
bool ConsoleTab::s_line_accents_enabled = true;
|
||||
float ConsoleTab::s_console_zoom = 1.0f;
|
||||
bool ConsoleTab::s_daemon_messages_enabled = true;
|
||||
bool ConsoleTab::s_errors_only_enabled = false;
|
||||
@@ -544,6 +545,21 @@ void ConsoleTab::renderToolbar(ConsoleCommandExecutor& exec)
|
||||
// Output filter input
|
||||
drawFilterInput();
|
||||
|
||||
// Color-accent toggle: hide/show the per-line left accent bars (appearance, grouped with zoom).
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
{
|
||||
float btnSz = ImGui::GetFrameHeight();
|
||||
const char* icon = s_line_accents_enabled ? ICON_MD_FORMAT_COLOR_FILL : ICON_MD_FORMAT_COLOR_RESET;
|
||||
if (!s_line_accents_enabled)
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(OnSurfaceDisabled()));
|
||||
if (TactileButton(icon, ImVec2(btnSz, btnSz), Type().iconMed()))
|
||||
s_line_accents_enabled = !s_line_accents_enabled;
|
||||
if (!s_line_accents_enabled) ImGui::PopStyleColor();
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("console_toggle_accents"));
|
||||
}
|
||||
|
||||
// Zoom +/- buttons (right side of toolbar)
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
@@ -940,7 +956,8 @@ void ConsoleTab::drawVisibleLines(float padX, float lineHeight, bool hasTextFilt
|
||||
|
||||
// Left-edge channel accent bar, drawn in the padX margin so it never overlaps
|
||||
// the text or the selection highlight. Same color that tints the toolbar toggle.
|
||||
if (line.channel != ConsoleChannel::None) {
|
||||
// Suppressed when the toolbar's color-accent toggle is off (cleaner monochrome gutter).
|
||||
if (s_line_accents_enabled && line.channel != ConsoleChannel::None) {
|
||||
ImU32 barCol = channelAccentColor(line.channel);
|
||||
if (barCol != 0) {
|
||||
float barW = 3.0f * Layout::hScale();
|
||||
|
||||
@@ -69,6 +69,9 @@ public:
|
||||
// Console output zoom factor (1.0 = default caption font size)
|
||||
static float s_console_zoom;
|
||||
|
||||
// Draw the per-line left color accent bars (channel-colored). Toggled from the toolbar.
|
||||
static bool s_line_accents_enabled;
|
||||
|
||||
// Show/hide daemon output messages
|
||||
static bool s_daemon_messages_enabled;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user