diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-01-01 19:26:15 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-01 15:02:42 +0100 |
| commit | 19c8bf98885074617f9cc0a0b2f60ebf47ddf714 (patch) | |
| tree | 570b591a687e574bddd0c79009e2829d9f496f78 /src/dialogs/settingsdialog.cpp | |
| parent | 808288ce691a3c1520db513c7cff79fd22d3c53f (diff) | |
| download | kristall-19c8bf98885074617f9cc0a0b2f60ebf47ddf714.tar.gz | |
Added UI density option.
'Compact' is the default - saves screen space a bit. The old layout is available in the 'Classic' option
Diffstat (limited to 'src/dialogs/settingsdialog.cpp')
| -rw-r--r-- | src/dialogs/settingsdialog.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 95fc0e9..f18065f 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -34,6 +34,10 @@ 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->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))); + setGeminiStyle(DocumentStyle { }); this->predefined_styles.clear(); @@ -186,6 +190,14 @@ void SettingsDialog::setOptions(const GenericSettings &options) } } + 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)) { + this->ui->ui_density->setCurrentIndex(i); + break; + } + } + this->ui->start_page->setText(this->current_options.start_page); if(this->current_options.gophermap_display == GenericSettings::PlainText) { @@ -576,6 +588,13 @@ void SettingsDialog::on_ui_theme_currentIndexChanged(int index) kristall::setTheme(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()); + + kristall::setUiDensity(this->current_options.ui_density, true); +} + void SettingsDialog::on_fancypants_on_clicked() { this->current_options.text_display = GenericSettings::FormattedText; |
