mirror of
https://github.com/zealdocs/zeal.git
synced 2024-12-02 09:44:14 +03:00
change the minium font size globally
This commit is contained in:
parent
e4d3aa22e5
commit
4290f73fca
@ -126,7 +126,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(ui->splitter, &QSplitter::splitterMoved, [=](int, int) {
|
||||
settings.setValue("splitter", ui->splitter->saveState());
|
||||
});
|
||||
ui->webView->settings()->setFontSize(QWebSettings::MinimumFontSize, settings.value("minFontSize").toInt());
|
||||
|
||||
applyWebPageStyle();
|
||||
ZealNetworkAccessManager * zealNaManager = new ZealNetworkAccessManager();
|
||||
zealNaManager->setProxy(settingsDialog.httpProxy());
|
||||
ui->webView->page()->setNetworkAccessManager(zealNaManager);
|
||||
@ -146,6 +147,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
connect(&settingsDialog, SIGNAL(refreshRequested()), this, SLOT(refreshRequest()));
|
||||
connect(&settingsDialog, SIGNAL(minFontSizeChanged(int)), this, SLOT(changeMinFontSize(int)));
|
||||
connect(&settingsDialog, SIGNAL(webPageStyleUpdated()), this, SLOT(applyWebPageStyle()));
|
||||
|
||||
connect(ui->action_Options, &QAction::triggered, [=]() {
|
||||
settingsDialog.setHotKey(hotKey);
|
||||
@ -850,5 +852,13 @@ void MainWindow::refreshRequest(){
|
||||
}
|
||||
|
||||
void MainWindow::changeMinFontSize(int minFont){
|
||||
ui->webView->settings()->setFontSize(QWebSettings::MinimumFontSize, minFont);
|
||||
QWebSettings::globalSettings()->setFontSize(QWebSettings::MinimumFontSize, minFont);
|
||||
}
|
||||
|
||||
void MainWindow::applyWebPageStyle()
|
||||
{
|
||||
if (settings.contains("minFontSize")) {
|
||||
int minFont = settings.value("minFontSize").toInt();
|
||||
QWebSettings::globalSettings()->setFontSize(QWebSettings::MinimumFontSize, minFont);
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ private:
|
||||
ZealNativeEventFilter nativeFilter;
|
||||
ZealSettingsDialog settingsDialog;
|
||||
QSystemTrayIcon *trayIcon;
|
||||
|
||||
#ifdef USE_LIBAPPINDICATOR
|
||||
AppIndicator *indicator; //for Unity
|
||||
#endif
|
||||
@ -111,6 +112,7 @@ private slots:
|
||||
void saveTabState();
|
||||
void goToTab(int index);
|
||||
void closeTab(int index);
|
||||
void applyWebPageStyle();
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) {
|
||||
settings.setValue("geometry", saveGeometry());
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <QWebPage>
|
||||
#include "searchablewebview.h"
|
||||
|
||||
|
||||
SearchableWebView::SearchableWebView(QWidget *parent) :
|
||||
QWidget(parent), lineEdit(this), webView(this)
|
||||
{
|
||||
|
@ -771,6 +771,8 @@ void ZealSettingsDialog::saveSettings(){
|
||||
settings.setValue("httpProxyUser", ui->m_httpProxyUser->text());
|
||||
settings.setValue("httpProxyPass", ui->m_httpProxyPass->text());
|
||||
settings.setValue("prefixes", prefixes);
|
||||
|
||||
webPageStyleUpdated();
|
||||
}
|
||||
|
||||
void ZealSettingsDialog::on_tabWidget_currentChanged(int current)
|
||||
|
@ -62,6 +62,7 @@ private:
|
||||
signals:
|
||||
void refreshRequested();
|
||||
void minFontSizeChanged(int minFont);
|
||||
void webPageStyleUpdated();
|
||||
|
||||
private slots:
|
||||
void downloadDocsetList();
|
||||
|
Loading…
Reference in New Issue
Block a user