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:
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "Stoppt",
|
||||
"console_status_unknown": "Unbekannt",
|
||||
"console_tab_completion": "Tab zur Vervollständigung",
|
||||
"console_toggle_accents": "Farbakzente der Zeilen umschalten",
|
||||
"console_type_help": "Geben Sie 'help' ein für verfügbare Befehle",
|
||||
"console_welcome": "Willkommen bei ObsidianDragon Konsole",
|
||||
"console_zoom_in": "Vergrößern",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "Deteniendo",
|
||||
"console_status_unknown": "Desconocido",
|
||||
"console_tab_completion": "Tab para completar",
|
||||
"console_toggle_accents": "Alternar acentos de color de línea",
|
||||
"console_type_help": "Escribe 'help' para ver los comandos disponibles",
|
||||
"console_welcome": "Bienvenido a la Consola de ObsidianDragon",
|
||||
"console_zoom_in": "Acercar",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "Arrêt",
|
||||
"console_status_unknown": "Inconnu",
|
||||
"console_tab_completion": "Tab pour compléter",
|
||||
"console_toggle_accents": "Basculer les accents de couleur des lignes",
|
||||
"console_type_help": "Tapez 'help' pour les commandes disponibles",
|
||||
"console_welcome": "Bienvenue dans la console ObsidianDragon",
|
||||
"console_zoom_in": "Agrandir",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "停止中",
|
||||
"console_status_unknown": "不明",
|
||||
"console_tab_completion": "Tabで補完",
|
||||
"console_toggle_accents": "行のカラーアクセントを切り替え",
|
||||
"console_type_help": "'help'と入力して利用可能なコマンドを表示",
|
||||
"console_welcome": "ObsidianDragonコンソールへようこそ",
|
||||
"console_zoom_in": "拡大",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "중지 중",
|
||||
"console_status_unknown": "알 수 없음",
|
||||
"console_tab_completion": "Tab으로 자동 완성",
|
||||
"console_toggle_accents": "줄 색상 강조 전환",
|
||||
"console_type_help": "'help'를 입력하여 사용 가능한 명령어 보기",
|
||||
"console_welcome": "ObsidianDragon 콘솔에 오신 것을 환영합니다",
|
||||
"console_zoom_in": "확대",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "Parando",
|
||||
"console_status_unknown": "Desconhecido",
|
||||
"console_tab_completion": "Tab para completar",
|
||||
"console_toggle_accents": "Alternar destaques de cor das linhas",
|
||||
"console_type_help": "Digite 'help' para comandos disponíveis",
|
||||
"console_welcome": "Bem-vindo ao Console ObsidianDragon",
|
||||
"console_zoom_in": "Aumentar zoom",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "Остановка",
|
||||
"console_status_unknown": "Неизвестно",
|
||||
"console_tab_completion": "Tab для дополнения",
|
||||
"console_toggle_accents": "Переключить цветовые акценты строк",
|
||||
"console_type_help": "Введите 'help' для списка команд",
|
||||
"console_welcome": "Добро пожаловать в консоль ObsidianDragon",
|
||||
"console_zoom_in": "Увеличить",
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
"console_status_stopping": "停止中",
|
||||
"console_status_unknown": "未知",
|
||||
"console_tab_completion": "Tab 补全",
|
||||
"console_toggle_accents": "切换行颜色强调",
|
||||
"console_type_help": "输入 'help' 查看可用命令",
|
||||
"console_welcome": "欢迎使用 ObsidianDragon 控制台",
|
||||
"console_zoom_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;
|
||||
|
||||
|
||||
@@ -1290,6 +1290,7 @@ void I18n::loadBuiltinEnglish()
|
||||
strings_["console_welcome"] = "Welcome to ObsidianDragon Console";
|
||||
strings_["console_zoom_in"] = "Zoom in";
|
||||
strings_["console_zoom_out"] = "Zoom out";
|
||||
strings_["console_toggle_accents"] = "Toggle line color accents";
|
||||
|
||||
// --- Export All Keys Dialog ---
|
||||
strings_["export_keys_btn"] = "Export Keys";
|
||||
|
||||
Reference in New Issue
Block a user