diff options
author | Christopher Dumas <christopherdumas@gmail.com> | 2019-05-25 16:43:15 -0700 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-27 21:40:53 +0200 |
commit | e3f81bce498523cc722524fc795f33e7d5c23c3e (patch) | |
tree | 135f279eb7919a61418a7dd261df2f144d317208 /Applications/Terminal/Terminal.cpp | |
parent | 63486b8438a9d1ec001adc1476a75b276ee308b3 (diff) | |
download | serenity-e3f81bce498523cc722524fc795f33e7d5c23c3e.zip |
IRC client setttings, Terminal settings, more WM settings
Diffstat (limited to 'Applications/Terminal/Terminal.cpp')
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 4f1f23905f..2b987e8b21 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -17,21 +17,30 @@ //#define TERMINAL_DEBUG -Terminal::Terminal(int ptm_fd) +Terminal::Terminal(int ptm_fd, RetainPtr<CConfigFile> config) : m_ptm_fd(ptm_fd) , m_notifier(ptm_fd, CNotifier::Read) + , m_config(config) { set_frame_shape(FrameShape::Container); set_frame_shadow(FrameShadow::Sunken); set_frame_thickness(2); - m_cursor_blink_timer.set_interval(500); + dbgprintf("Terminal: Load config file from %s\n", m_config->file_name().characters()); + m_cursor_blink_timer.set_interval(m_config->read_num_entry("Text", + "CursorBlinkInterval", + 500)); m_cursor_blink_timer.on_timeout = [this] { m_cursor_blink_state = !m_cursor_blink_state; update_cursor(); }; - set_font(Font::default_fixed_width_font()); + auto font_entry = m_config->read_entry("Text", "Font", "default"); + if (font_entry == "default") + set_font(Font::default_fixed_width_font()); + else + set_font(Font::load_from_file(font_entry)); + m_notifier.on_ready_to_read = [this]{ byte buffer[BUFSIZ]; ssize_t nread = read(m_ptm_fd, buffer, sizeof(buffer)); @@ -53,7 +62,8 @@ Terminal::Terminal(int ptm_fd) m_line_height = font().glyph_height() + m_line_spacing; - set_size(80, 25); + set_size(m_config->read_num_entry("Window", "Width", 80), + m_config->read_num_entry("Window", "Height", 25)); } Terminal::Line::Line(word columns) |