aboutsummaryrefslogtreecommitdiff
path: root/src/dialogs
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-02-27 09:23:59 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-02-27 11:47:39 +0100
commit23feba7e5a1396110d543a676e018bcbdfa50d39 (patch)
treed4e2a6fed26a490a5ba2df4f755f6ad90b2203b1 /src/dialogs
parent435532d97dcfbb23e46f51f690914fd910cc65ee (diff)
downloadkristall-23feba7e5a1396110d543a676e018bcbdfa50d39.tar.gz
Adds emoji toggle preference.
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/settingsdialog.cpp28
-rw-r--r--src/dialogs/settingsdialog.hpp3
-rw-r--r--src/dialogs/settingsdialog.ui63
3 files changed, 81 insertions, 13 deletions
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;
diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp
index adeb004..114396e 100644
--- a/src/dialogs/settingsdialog.hpp
+++ b/src/dialogs/settingsdialog.hpp
@@ -149,6 +149,9 @@ private slots:
void on_fancyquotes_on_clicked();
void on_fancyquotes_off_clicked();
+ void on_emojis_on_clicked();
+ void on_emojis_off_clicked();
+
void on_redirection_mode_currentIndexChanged(int index);
void on_max_redirects_valueChanged(int arg1);
diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui
index cccb3f5..04db3e2 100644
--- a/src/dialogs/settingsdialog.ui
+++ b/src/dialogs/settingsdialog.ui
@@ -373,37 +373,71 @@
</layout>
</item>
<item row="13" column="0">
+ <widget class="QLabel" name="emojis_label">
+ <property name="text">
+ <string>Render emojis</string>
+ </property>
+ <property name="toolTip">
+ <string>Whether to render emojis in a page.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="13" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_17">
+ <item>
+ <widget class="QRadioButton" name="emojis_on">
+ <property name="text">
+ <string>On</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">emojisBtnGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="emojis_off">
+ <property name="text">
+ <string>Off</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">emojisBtnGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="14" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Max. Number of Redirections</string>
</property>
</widget>
</item>
- <item row="13" column="1">
+ <item row="14" column="1">
<widget class="QSpinBox" name="max_redirects">
<property name="value">
<number>5</number>
</property>
</widget>
</item>
- <item row="14" column="0">
+ <item row="15" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Redirection Handling</string>
</property>
</widget>
</item>
- <item row="14" column="1">
+ <item row="15" column="1">
<widget class="QComboBox" name="redirection_mode"/>
</item>
- <item row="15" column="0">
+ <item row="16" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Network Timeout</string>
</property>
</widget>
</item>
- <item row="15" column="1">
+ <item row="16" column="1">
<widget class="QSpinBox" name="network_timeout">
<property name="suffix">
<string> ms</string>
@@ -416,14 +450,14 @@
</property>
</widget>
</item>
- <item row="16" column="0">
+ <item row="17" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Additional toolbar buttons</string>
</property>
</widget>
</item>
- <item row="16" column="1">
+ <item row="17" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_99">
<item>
<widget class="QCheckBox" name="enable_home_btn">
@@ -455,7 +489,7 @@
</item>
</layout>
</item>
- <item row="17" column="0">
+ <item row="18" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Total cache size limit</string>
@@ -465,7 +499,7 @@
</property>
</widget>
</item>
- <item row="17" column="1">
+ <item row="18" column="1">
<widget class="QSpinBox" name="cache_limit">
<property name="suffix">
<string> KiB</string>
@@ -479,7 +513,7 @@
</widget>
</item>
- <item row="18" column="0">
+ <item row="19" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Cached item size threshold</string>
@@ -489,7 +523,7 @@
</property>
</widget>
</item>
- <item row="18" column="1">
+ <item row="19" column="1">
<widget class="QSpinBox" name="cache_threshold">
<property name="suffix">
<string> KiB</string>
@@ -503,7 +537,7 @@
</widget>
</item>
- <item row="19" column="0">
+ <item row="20" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Cached item life</string>
@@ -513,7 +547,7 @@
</property>
</widget>
</item>
- <item row="19" column="1">
+ <item row="20" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_25">
<item>
<widget class="QSpinBox" name="cache_life">
@@ -1503,6 +1537,8 @@
<tabstop>urlbarhl_none</tabstop>
<tabstop>fancyquotes_on</tabstop>
<tabstop>fancyquotes_off</tabstop>
+ <tabstop>emojis_on</tabstop>
+ <tabstop>emojis_off</tabstop>
<tabstop>max_redirects</tabstop>
<tabstop>redirection_mode</tabstop>
<tabstop>network_timeout</tabstop>
@@ -1598,5 +1634,6 @@
<buttongroup name="hiddenFilesBtnGroup"/>
<buttongroup name="urlbarBtnGroup"/>
<buttongroup name="quotesBtnGroup"/>
+ <buttongroup name="emojisBtnGroup"/>
</buttongroups>
</ui>