From 61c0174fecea43afc9e9d3e7b8f7593f5dd3d918 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 26 Apr 2023 08:34:24 -0400 Subject: [PATCH] Browser+Ladybird: Render text in the JS console with a monospace font --- Ladybird/ConsoleWidget.cpp | 4 +++- Userland/Applications/Browser/ConsoleWidget.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Ladybird/ConsoleWidget.cpp b/Ladybird/ConsoleWidget.cpp index 00eb559b94a..e272ecd7eb3 100644 --- a/Ladybird/ConsoleWidget.cpp +++ b/Ladybird/ConsoleWidget.cpp @@ -12,6 +12,7 @@ #include "WebContentView.h" #include #include +#include #include #include #include @@ -41,7 +42,7 @@ ConsoleWidget::ConsoleWidget() if (is_using_dark_system_theme(*this)) m_output_view->update_palette(WebContentView::PaletteMode::Dark); - m_output_view->load("data:text/html,"sv); + m_output_view->load("data:text/html,"sv); // Wait until our output WebView is loaded, and then request any messages that occurred before we existed m_output_view->on_load_finish = [this](auto&) { if (on_request_messages) @@ -56,6 +57,7 @@ ConsoleWidget::ConsoleWidget() layout()->addWidget(bottom_container); m_input = new QLineEdit(bottom_container); + m_input->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); bottom_container->layout()->addWidget(m_input); QObject::connect(m_input, &QLineEdit::returnPressed, [this] { diff --git a/Userland/Applications/Browser/ConsoleWidget.cpp b/Userland/Applications/Browser/ConsoleWidget.cpp index cce5ce4c138..b01c0fb20ec 100644 --- a/Userland/Applications/Browser/ConsoleWidget.cpp +++ b/Userland/Applications/Browser/ConsoleWidget.cpp @@ -25,7 +25,7 @@ ConsoleWidget::ConsoleWidget() set_fill_with_background_color(true); m_output_view = add(); - m_output_view->load("data:text/html,"sv); + m_output_view->load("data:text/html,"sv); // Wait until our output WebView is loaded, and then request any messages that occurred before we existed m_output_view->on_load_finish = [this](auto&) { if (on_request_messages)