Calculator: Set a fixed-width font on the text box

GUI::TextEditor does not yet support right-aligned variable-width fonts
so just switch this to a fixed-width font for now.
This commit is contained in:
Andreas Kling 2020-05-18 16:41:29 +02:00
parent a6e2125727
commit 22cd861c7e
Notes: sideshowbarker 2024-07-19 06:29:51 +09:00

View File

@ -29,6 +29,7 @@
#include <LibGUI/Button.h> #include <LibGUI/Button.h>
#include <LibGUI/Label.h> #include <LibGUI/Label.h>
#include <LibGUI/TextBox.h> #include <LibGUI/TextBox.h>
#include <LibGfx/Font.h>
CalculatorWidget::CalculatorWidget() CalculatorWidget::CalculatorWidget()
{ {
@ -37,6 +38,7 @@ CalculatorWidget::CalculatorWidget()
m_entry = add<GUI::TextBox>(); m_entry = add<GUI::TextBox>();
m_entry->set_relative_rect(5, 5, 244, 26); m_entry->set_relative_rect(5, 5, 244, 26);
m_entry->set_text_alignment(Gfx::TextAlignment::CenterRight); m_entry->set_text_alignment(Gfx::TextAlignment::CenterRight);
m_entry->set_font(Gfx::Font::default_fixed_width_font());
m_label = add<GUI::Label>(); m_label = add<GUI::Label>();
m_label->set_relative_rect(12, 42, 27, 27); m_label->set_relative_rect(12, 42, 27, 27);