aboutsummaryrefslogtreecommitdiff
path: root/src/dialogs
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-02-16 20:40:36 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-02-16 11:11:23 +0100
commit9bf17318f91b0d5a42c970491d0963178fd23938 (patch)
tree97c525fc9e3b1042dd7a659102fa1cace206fae9 /src/dialogs
parent7820c0fb5cbfb5d41fa484aa5f9d0481318cfbeb (diff)
downloadkristall-9bf17318f91b0d5a42c970491d0963178fd23938.tar.gz
Add seperate 'icon theme' preference
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/settingsdialog.cpp22
-rw-r--r--src/dialogs/settingsdialog.hpp2
-rw-r--r--src/dialogs/settingsdialog.ui81
3 files changed, 70 insertions, 35 deletions
diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp
index 36e4291..4cc0ed6 100644
--- a/src/dialogs/settingsdialog.cpp
+++ b/src/dialogs/settingsdialog.cpp
@@ -34,6 +34,11 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
this->ui->ui_theme->addItem(tr("Light"), QVariant::fromValue<int>(int(Theme::light)));
this->ui->ui_theme->addItem(tr("Dark"), QVariant::fromValue<int>(int(Theme::dark)));
+ this->ui->icon_theme->clear();
+ this->ui->icon_theme->addItem(tr("Automatic"), QVariant::fromValue<int>(int(IconTheme::automatic)));
+ this->ui->icon_theme->addItem(tr("Light"), QVariant::fromValue<int>(int(IconTheme::light)));
+ this->ui->icon_theme->addItem(tr("Dark"), QVariant::fromValue<int>(int(IconTheme::dark)));
+
this->ui->ui_density->clear();
this->ui->ui_density->addItem(tr("Compact"), QVariant::fromValue<int>(int(UIDensity::compact)));
this->ui->ui_density->addItem(tr("Classic"), QVariant::fromValue<int>(int(UIDensity::classic)));
@@ -209,6 +214,15 @@ void SettingsDialog::setOptions(const GenericSettings &options)
}
}
+ this->ui->icon_theme->setCurrentIndex(0);
+ for(int i = 0; i < this->ui->icon_theme->count(); i++) {
+ if(this->ui->icon_theme->itemData(i).toInt() == int(options.icon_theme)) {
+ this->ui->icon_theme->setCurrentIndex(i);
+ break;
+ }
+ }
+
+
this->ui->ui_density->setCurrentIndex(0);
for(int i = 0; i < this->ui->ui_density->count(); ++i) {
if (this->ui->ui_density->itemData(i).toInt() == int(options.ui_density)) {
@@ -700,6 +714,14 @@ void SettingsDialog::on_ui_theme_currentIndexChanged(int index)
kristall::setTheme(this->current_options.theme);
}
+void SettingsDialog::on_icon_theme_currentIndexChanged(int index)
+{
+ this->current_options.icon_theme = IconTheme(this->ui->icon_theme->itemData(index).toInt());
+
+ kristall::setIconTheme(this->current_options.icon_theme, this->current_options.theme);
+}
+
+
void SettingsDialog::on_ui_density_currentIndexChanged(int index)
{
this->current_options.ui_density = UIDensity(this->ui->ui_density->itemData(index).toInt());
diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp
index cc7c302..226abed 100644
--- a/src/dialogs/settingsdialog.hpp
+++ b/src/dialogs/settingsdialog.hpp
@@ -120,6 +120,8 @@ private slots:
void on_ui_theme_currentIndexChanged(int index);
+ void on_icon_theme_currentIndexChanged(int index);
+
void on_ui_density_currentIndexChanged(int index);
void on_fancypants_on_clicked();
diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui
index 56bbcaf..b1890e3 100644
--- a/src/dialogs/settingsdialog.ui
+++ b/src/dialogs/settingsdialog.ui
@@ -43,52 +43,62 @@
<widget class="QComboBox" name="ui_theme"/>
</item>
<item row="1" column="0">
+ <widget class="QLabel" name="label_34">
+ <property name="text">
+ <string>Icon Theme</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="icon_theme"/>
+ </item>
+ <item row="2" column="0">
<widget class="QLabel" name="label_1">
<property name="text">
<string>UI Density</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QComboBox" name="ui_density"/>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Start Page:</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QLineEdit" name="start_page">
<property name="placeholderText">
<string>about://blank</string>
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_40">
<property name="text">
<string>Search engine:</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QComboBox" name="search_engine">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Enabled Protocols</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="enable_gemini">
@@ -133,14 +143,14 @@
</item>
</layout>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Text Rendering</string>
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QRadioButton" name="fancypants_on">
@@ -167,14 +177,14 @@
</item>
</layout>
</item>
- <item row="6" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Enable text highlights</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="texthl_on">
@@ -201,14 +211,14 @@
</item>
</layout>
</item>
- <item row="7" column="0">
+ <item row="8" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Gopher Map</string>
</property>
</widget>
</item>
- <item row="7" column="1">
+ <item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="gophermap_icon">
@@ -235,14 +245,14 @@
</item>
</layout>
</item>
- <item row="8" column="0">
+ <item row="9" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Unknown Scheme</string>
</property>
</widget>
</item>
- <item row="8" column="1">
+ <item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QRadioButton" name="scheme_os_default">
@@ -266,14 +276,14 @@
</item>
</layout>
</item>
- <item row="9" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="label_23">
<property name="text">
<string>Hidden files in file:// directories</string>
</property>
</widget>
</item>
- <item row="9" column="1">
+ <item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QRadioButton" name="show_hidden_files">
@@ -297,14 +307,14 @@
</item>
</layout>
</item>
- <item row="10" column="0">
+ <item row="11" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>URL bar highlights</string>
</property>
</widget>
</item>
- <item row="10" column="1">
+ <item row="11" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QRadioButton" name="urlbarhl_fancy">
@@ -328,7 +338,7 @@
</item>
</layout>
</item>
- <item row="11" column="0">
+ <item row="12" column="0">
<widget class="QLabel" name="label_39">
<property name="text">
<string>Use typographer's quotes</string>
@@ -338,7 +348,7 @@
</property>
</widget>
</item>
- <item row="11" column="1">
+ <item row="12" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QRadioButton" name="fancyquotes_on">
@@ -362,38 +372,38 @@
</item>
</layout>
</item>
- <item row="12" column="0">
+ <item row="13" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Max. Number of Redirections</string>
</property>
</widget>
</item>
- <item row="12" column="1">
+ <item row="13" column="1">
<widget class="QSpinBox" name="max_redirects">
<property name="value">
<number>5</number>
</property>
</widget>
</item>
- <item row="13" column="0">
+ <item row="14" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Redirection Handling</string>
</property>
</widget>
</item>
- <item row="13" column="1">
+ <item row="14" column="1">
<widget class="QComboBox" name="redirection_mode"/>
</item>
- <item row="14" column="0">
+ <item row="15" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Network Timeout</string>
</property>
</widget>
</item>
- <item row="14" column="1">
+ <item row="15" column="1">
<widget class="QSpinBox" name="network_timeout">
<property name="suffix">
<string> ms</string>
@@ -406,14 +416,14 @@
</property>
</widget>
</item>
- <item row="15" column="0">
+ <item row="16" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Additional toolbar buttons</string>
</property>
</widget>
</item>
- <item row="15" column="1">
+ <item row="16" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_99">
<item>
<widget class="QCheckBox" name="enable_home_btn">
@@ -431,7 +441,7 @@
</item>
</layout>
</item>
- <item row="16" column="0">
+ <item row="17" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Total cache size limit</string>
@@ -441,7 +451,7 @@
</property>
</widget>
</item>
- <item row="16" column="1">
+ <item row="17" column="1">
<widget class="QSpinBox" name="cache_limit">
<property name="suffix">
<string> KiB</string>
@@ -455,7 +465,7 @@
</widget>
</item>
- <item row="17" column="0">
+ <item row="18" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Cached item size threshold</string>
@@ -465,7 +475,7 @@
</property>
</widget>
</item>
- <item row="17" column="1">
+ <item row="18" column="1">
<widget class="QSpinBox" name="cache_threshold">
<property name="suffix">
<string> KiB</string>
@@ -479,7 +489,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 life</string>
@@ -489,7 +499,7 @@
</property>
</widget>
</item>
- <item row="18" column="1">
+ <item row="19" column="1">
<widget class="QSpinBox" name="cache_life">
<property name="suffix">
<string> minutes</string>
@@ -1384,6 +1394,7 @@
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>ui_theme</tabstop>
+ <tabstop>icon_theme</tabstop>
<tabstop>ui_density</tabstop>
<tabstop>start_page</tabstop>
<tabstop>search_engine</tabstop>