mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 02:47:34 +00:00
Terminal: Modernize terminal settings as a standalone application
The settings for Terminal are extracted into their own application, TerminalSettings, which is reachable over the normal Settings menu as well as the same place in the Terminal menu. The font settings are moved into these settings as well, which are now split up into the "Terminal" and "View" tabs. The font settings themselves receive an option to override the selected font with the system default on the user side. The live update behavior of all of the terminal settings is retained. The layout of the new TerminalSettings is based around the other Settings applications, but pixel-perfectness is missing in some places. It's a bit fiddly and I'd like to have some better GUI::Label auto-size behavior, but oh well :^)
This commit is contained in:
parent
12468e036b
commit
1ff48a3ca4
11 changed files with 546 additions and 193 deletions
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/CheckBox.h>
|
||||
#include <LibGUI/ComboBox.h>
|
||||
#include <LibGUI/SettingsWindow.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibVT/TerminalWidget.h>
|
||||
|
||||
class TerminalSettingsMainWidget final : public GUI::SettingsWindow::Tab {
|
||||
C_OBJECT(TerminalSettingsMainWidget)
|
||||
public:
|
||||
virtual void apply_settings() override;
|
||||
virtual void cancel_settings() override;
|
||||
|
||||
private:
|
||||
TerminalSettingsMainWidget();
|
||||
void write_back_settings() const;
|
||||
|
||||
static VT::TerminalWidget::BellMode parse_bell(StringView bell_string);
|
||||
static String stringify_bell(VT::TerminalWidget::BellMode bell_mode);
|
||||
|
||||
VT::TerminalWidget::BellMode m_bell_mode = VT::TerminalWidget::BellMode::Disabled;
|
||||
size_t m_max_history_size;
|
||||
|
||||
VT::TerminalWidget::BellMode m_original_bell_mode;
|
||||
size_t m_original_max_history_size;
|
||||
};
|
||||
|
||||
class TerminalSettingsViewWidget final : public GUI::SettingsWindow::Tab {
|
||||
C_OBJECT(TerminalSettingsViewWidget)
|
||||
public:
|
||||
virtual void apply_settings() override;
|
||||
virtual void cancel_settings() override;
|
||||
|
||||
private:
|
||||
TerminalSettingsViewWidget();
|
||||
void write_back_settings() const;
|
||||
|
||||
RefPtr<Gfx::Font> m_font;
|
||||
float m_opacity;
|
||||
String m_color_scheme;
|
||||
|
||||
RefPtr<Gfx::Font> m_original_font;
|
||||
float m_original_opacity;
|
||||
String m_original_color_scheme;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue