From 9bf17318f91b0d5a42c970491d0963178fd23938 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Tue, 16 Feb 2021 20:40:36 +1100 Subject: Add seperate 'icon theme' preference --- src/dialogs/settingsdialog.cpp | 22 ++++++++++++ src/dialogs/settingsdialog.hpp | 2 ++ src/dialogs/settingsdialog.ui | 81 ++++++++++++++++++++++++------------------ 3 files changed, 70 insertions(+), 35 deletions(-) (limited to 'src/dialogs') 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(Theme::light))); this->ui->ui_theme->addItem(tr("Dark"), QVariant::fromValue(int(Theme::dark))); + this->ui->icon_theme->clear(); + this->ui->icon_theme->addItem(tr("Automatic"), QVariant::fromValue(int(IconTheme::automatic))); + this->ui->icon_theme->addItem(tr("Light"), QVariant::fromValue(int(IconTheme::light))); + this->ui->icon_theme->addItem(tr("Dark"), QVariant::fromValue(int(IconTheme::dark))); + this->ui->ui_density->clear(); this->ui->ui_density->addItem(tr("Compact"), QVariant::fromValue(int(UIDensity::compact))); this->ui->ui_density->addItem(tr("Classic"), QVariant::fromValue(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 @@ + + + Icon Theme + + + + + + + UI Density - + - + Start Page: - + about://blank - + Search engine: - + true - + Enabled Protocols - + @@ -133,14 +143,14 @@ - + Text Rendering - + @@ -167,14 +177,14 @@ - + Enable text highlights - + @@ -201,14 +211,14 @@ - + Gopher Map - + @@ -235,14 +245,14 @@ - + Unknown Scheme - + @@ -266,14 +276,14 @@ - + Hidden files in file:// directories - + @@ -297,14 +307,14 @@ - + URL bar highlights - + @@ -328,7 +338,7 @@ - + Use typographer's quotes @@ -338,7 +348,7 @@ - + @@ -362,38 +372,38 @@ - + Max. Number of Redirections - + 5 - + Redirection Handling - + - + Network Timeout - + ms @@ -406,14 +416,14 @@ - + Additional toolbar buttons - + @@ -431,7 +441,7 @@ - + Total cache size limit @@ -441,7 +451,7 @@ - + KiB @@ -455,7 +465,7 @@ - + Cached item size threshold @@ -465,7 +475,7 @@ - + KiB @@ -479,7 +489,7 @@ - + Cached item life @@ -489,7 +499,7 @@ - + minutes @@ -1384,6 +1394,7 @@ tabWidget ui_theme + icon_theme ui_density start_page search_engine -- cgit v1.2.3