Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to change font size #193

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fm/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ MainWindow::MainWindow()
settings->setValue("clearCache", false);
}

//qApp.setStyleSheet( settings->value("darkTheme") );

// Dark theme?
if (settings->value("darkTheme").toBool()) {
qApp->setPalette(Common::darkTheme());
Expand Down Expand Up @@ -491,6 +493,9 @@ void MainWindow::loadSettings(bool wState, bool hState, bool tabState, bool thum
// Load terminal command
term = settings->value("term", "xterm").toString();

QString font_size = "* {font-size:" + settings->value("font_size", "16pt").toString() + ";}";
qApp->setStyleSheet(font_size);

// custom actions
#ifndef Q_OS_MAC
firstRunCustomActions(isFirstRun);
Expand Down
5 changes: 5 additions & 0 deletions fm/src/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ QWidget *SettingsDialog::createAppearanceSettings()
// Appearance
QGroupBox* grpAppear = new QGroupBox(tr("Appearance"), widget);
QFormLayout* layoutAppear = new QFormLayout(grpAppear);
editFontSize = new QLineEdit(grpAppear);
#ifndef Q_OS_MAC
cmbIconTheme = new QComboBox(grpAppear);
#endif
Expand All @@ -192,6 +193,7 @@ QWidget *SettingsDialog::createAppearanceSettings()
showNewTabButton = new QCheckBox(grpAppear);
showTerminalButton = new QCheckBox(grpAppear);

layoutAppear->addRow(tr("Font size: "), editFontSize);
#ifndef Q_OS_MAC
layoutAppear->addRow(tr("Fallback Icon theme:"), cmbIconTheme);
#endif
Expand Down Expand Up @@ -692,6 +694,7 @@ void SettingsDialog::readSettings() {
showHomeButton->setChecked(settingsPtr->value("home_button", true).toBool());
showNewTabButton->setChecked(settingsPtr->value("newtab_button", false).toBool());
showTerminalButton->setChecked(settingsPtr->value("terminal_button", true).toBool());
editFontSize->setText(settingsPtr->value("font_size", "16pt").toString());
#if QT_VERSION >= 0x050000
#ifdef DEPLOY
checkDarkTheme->setChecked(settingsPtr->value("darkTheme", true).toBool());
Expand Down Expand Up @@ -913,6 +916,8 @@ bool SettingsDialog::saveSettings() {
settingsPtr->setValue("copyXof", editCopyX->text());
settingsPtr->setValue("copyXofTS", editCopyTS->text());

settingsPtr->setValue("font_size", editFontSize->text());

settingsPtr->setValue("dad", comboDAD->currentIndex());
settingsPtr->setValue("dad_alt", comboDADalt->currentIndex());
settingsPtr->setValue("dad_ctrl", comboDADctl->currentIndex());
Expand Down
1 change: 1 addition & 0 deletions fm/src/settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ protected slots:
QComboBox* comboDADshift;
QComboBox* comboDADalt;
QLineEdit* editTerm;
QLineEdit* editFontSize;
QComboBox* cmbIconTheme;
QComboBox* cmbDefaultMimeApps;
QComboBox* comboSingleClick;
Expand Down