mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
LibVT+Terminal: Add the option to disable the bell
This commit is contained in:
parent
0cc970bd07
commit
f1d7d864ae
4 changed files with 46 additions and 10 deletions
|
@ -812,7 +812,10 @@ void TerminalWidget::terminal_did_resize(u16 columns, u16 rows)
|
|||
|
||||
void TerminalWidget::beep()
|
||||
{
|
||||
if (m_should_beep) {
|
||||
if (m_bell_mode == BellMode::Disabled) {
|
||||
return;
|
||||
}
|
||||
if (m_bell_mode == BellMode::AudibleBeep) {
|
||||
sysbeep();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -61,8 +61,15 @@ public:
|
|||
|
||||
void set_opacity(u8);
|
||||
float opacity() { return m_opacity; };
|
||||
bool should_beep() { return m_should_beep; }
|
||||
void set_should_beep(bool sb) { m_should_beep = sb; };
|
||||
|
||||
enum class BellMode {
|
||||
Visible,
|
||||
AudibleBeep,
|
||||
Disabled
|
||||
};
|
||||
|
||||
BellMode bell_mode() { return m_bell_mode; }
|
||||
void set_bell_mode(BellMode bm) { m_bell_mode = bm; };
|
||||
|
||||
RefPtr<Core::ConfigFile> config() const { return m_config; }
|
||||
|
||||
|
@ -151,7 +158,7 @@ private:
|
|||
// Snapshot of m_hovered_href when opening a context menu for a hyperlink.
|
||||
String m_context_menu_href;
|
||||
|
||||
bool m_should_beep { false };
|
||||
BellMode m_bell_mode { BellMode::Visible };
|
||||
bool m_belling { false };
|
||||
bool m_alt_key_held { false };
|
||||
bool m_rectangle_selection { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue