summaryrefslogtreecommitdiff
path: root/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2022-01-14 20:40:30 -0800
committerAndreas Kling <kling@serenityos.org>2022-01-15 11:03:23 +0100
commitab4035e227ccd3b9cf81453f9387ca0dc0de1272 (patch)
treee98565c6a7510e504b06f8066dfa3fbaa066bfc8 /Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp
parent0e26ba59f7f0ff6f83df2b12ca6ea5e7bd261b57 (diff)
downloadserenity-ab4035e227ccd3b9cf81453f9387ca0dc0de1272.zip
TerminalSettings: Expose a CheckBox controlling scrollbar visibility
Diffstat (limited to 'Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp')
-rw-r--r--Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp b/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp
index 83551f5589..0399efe935 100644
--- a/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp
+++ b/Userland/Applications/TerminalSettings/TerminalSettingsWidget.cpp
@@ -74,6 +74,15 @@ TerminalSettingsMainWidget::TerminalSettingsMainWidget()
m_max_history_size = value;
Config::write_i32("Terminal", "Terminal", "MaxHistorySize", static_cast<i32>(m_max_history_size));
};
+
+ m_show_scrollbar = Config::read_bool("Terminal", "Terminal", "ShowScrollBar", true);
+ m_orignal_show_scrollbar = m_show_scrollbar;
+ auto& show_scrollbar_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("terminal_show_scrollbar");
+ show_scrollbar_checkbox.on_checked = [&](bool show_scrollbar) {
+ m_show_scrollbar = show_scrollbar;
+ Config::write_bool("Terminal", "Terminal", "ShowScrollBar", show_scrollbar);
+ };
+ show_scrollbar_checkbox.set_checked(m_show_scrollbar);
}
TerminalSettingsViewWidget::TerminalSettingsViewWidget()
@@ -175,12 +184,14 @@ String TerminalSettingsMainWidget::stringify_bell(VT::TerminalWidget::BellMode b
void TerminalSettingsMainWidget::apply_settings()
{
m_original_max_history_size = m_max_history_size;
+ m_orignal_show_scrollbar = m_show_scrollbar;
m_original_bell_mode = m_bell_mode;
write_back_settings();
}
void TerminalSettingsMainWidget::write_back_settings() const
{
Config::write_i32("Terminal", "Terminal", "MaxHistorySize", static_cast<i32>(m_original_max_history_size));
+ Config::write_bool("Terminal", "Terminal", "ShowScrollBar", m_orignal_show_scrollbar);
Config::write_string("Terminal", "Window", "Bell", stringify_bell(m_original_bell_mode));
}