Set font family for info page. (KDE only)

This commit is contained in:
craig
2012-03-29 15:46:44 +00:00
committed by craig
parent 118b371296
commit 303f6b5b83
3 changed files with 38 additions and 10 deletions

View File

@@ -24,17 +24,18 @@
14. Fix crash when quiting Cantata whilst devices are being scanned.
15. Disable JavaScript for webview, this removes the 'Show'/'Hide' buttons from
wikipedia pages.
16. Adjust min and max sizes for sidebar.
17. Add basic lyrics editing.
18. Fix order of items added from playlist to playqueue, when individual items
16. Set font family for info page. (KDE only)
17. Adjust min and max sizes for sidebar.
18. Add basic lyrics editing.
19. Fix order of items added from playlist to playqueue, when individual items
of the list were selected.
19. Fix logic of replacing play queue - the clear message is sent in the MPD
20. Fix logic of replacing play queue - the clear message is sent in the MPD
thread just before the add message.
20. Improve albums page responsiveness when loading covers.
21. Better searching - search on all strings, in any order.
22. Automatically expand treeview items when searching.
23. Add custom icons for library and info pages.
24. Use cd icon (without music note) for albums page.
21. Improve albums page responsiveness when loading covers.
22. Better searching - search on all strings, in any order.
23. Automatically expand treeview items when searching.
24. Add custom icons for library and info pages.
25. Use CD icon (without music note) for albums page.
0.5.1
-----

View File

@@ -1,4 +1,4 @@
/*
/*
* Cantata
*
* Copyright (c) 2011-2012 Craig Drummond <craig.p.drummond@gmail.com>
@@ -36,6 +36,7 @@
#include <KDE/KWebView>
#include <KDE/KLocale>
#include <KDE/KFileDialog>
#include <KDE/KGlobalSettings>
#else
#include <QtGui/QFileDialog>
#include <QtWebKit/QWebView>
@@ -113,6 +114,11 @@ InfoPage::InfoPage(QWidget *parent)
view->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
view->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
#ifdef ENABLE_KDE_SUPPORT
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(updateFonts()));
updateFonts();
#endif
}
void InfoPage::save()
@@ -171,6 +177,12 @@ void InfoPage::googleAnswer(const QString &ans)
wikiInfo.addQueryItem("action", "view");
wikiInfo.addQueryItem("useskin", "monobook");
wikiInfo.addQueryItem("useformat", "mobile");
// view->settings()->resetFontSize(QWebSettings::MinimumFontSize);
// view->settings()->resetFontSize(QWebSettings::MinimumLogicalFontSize);
// view->settings()->resetFontSize(QWebSettings::DefaultFontSize);
// view->settings()->resetFontSize(QWebSettings::DefaultFixedFontSize);
// view->settings()->resetFontFamily(QWebSettings::StandardFont);
view->setUrl(wikiInfo);
}
@@ -226,3 +238,15 @@ void InfoPage::downloadingFinished()
file.write(reply->readAll());
}
}
#ifdef ENABLE_KDE_SUPPORT
void InfoPage::updateFonts()
{
view->settings()->setFontFamily(QWebSettings::StandardFont, KGlobalSettings::generalFont().family());
view->settings()->setFontFamily(QWebSettings::SerifFont, KGlobalSettings::generalFont().family());
view->settings()->setFontFamily(QWebSettings::SansSerifFont, KGlobalSettings::generalFont().family());
view->settings()->setFontFamily(QWebSettings::FixedFont, KGlobalSettings::fixedFont().family());
}
#endif

View File

@@ -52,6 +52,9 @@ private Q_SLOTS:
void googleAnswer(const QString &answer);
void downloadRequested(const QNetworkRequest &);
void downloadingFinished();
#ifdef ENABLE_KDE_SUPPORT
void updateFonts();
#endif
private:
WebView *view;