summaryrefslogtreecommitdiff
path: root/Userland/Applications/TerminalSettings/TerminalSettingsWidget.h
blob: 4f97f15a7c88a966f1fc241dba82c9a685e455e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;
};