From 23feba7e5a1396110d543a676e018bcbdfa50d39 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sat, 27 Feb 2021 09:23:59 +1100 Subject: Adds emoji toggle preference. --- src/dialogs/settingsdialog.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/dialogs/settingsdialog.cpp') diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index e9c0e45..4bd0f8c 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -301,6 +301,24 @@ void SettingsDialog::setOptions(const GenericSettings &options) this->ui->urlbarhl_none->setChecked(true); } + if (kristall::EMOJIS_SUPPORTED && this->current_options.emojis_enabled) + { + this->ui->emojis_on->setChecked(true); + } + else + { + this->ui->emojis_off->setChecked(true); + + // Grey out emoji options on unsupported emoji builds + if (!kristall::EMOJIS_SUPPORTED) + { + this->ui->emojis_on->setEnabled(false); + this->ui->emojis_off->setEnabled(false); + this->ui->emojis_label->setToolTip( + this->ui->emojis_label->toolTip() + " (not supported in this build)"); + } + } + if(this->current_options.fancy_quotes) { this->ui->fancyquotes_on->setChecked(true); } else { @@ -831,6 +849,16 @@ void SettingsDialog::on_urlbarhl_none_clicked() this->current_options.fancy_urlbar = false; } +void SettingsDialog::on_emojis_on_clicked() +{ + this->current_options.emojis_enabled = true; +} + +void SettingsDialog::on_emojis_off_clicked() +{ + this->current_options.emojis_enabled = false; +} + void SettingsDialog::on_fancyquotes_on_clicked() { this->current_options.fancy_quotes = true; -- cgit v1.2.3