┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-02-17 15:50:06 +0000
committerPeter Penz <[email protected]>2008-02-17 15:50:06 +0000
commit51cbeaf512da9ebaefb0bfcaa21cca0f47d1b79d (patch)
treeedc8cfe7ed230f4b017560efff561f6626bb9e91 /src/dolphiniconsview.cpp
parent98497a639a8ddba1bbe52ea96f54c5d40e53eef9 (diff)
* if the system font is changed during Dolphin is open, take care to update the used font of all views too (assuming that the user selected "system font" as font)
* store the font weight instead of a bool property "isBold" Thanks to Rafael for the patch! CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=776188
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index ccf4cbfc5..96f69436d 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -98,9 +98,14 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
Q_ASSERT(settings != 0);
- m_font = QFont(settings->fontFamily(), settings->fontSize());
- m_font.setItalic(settings->italicFont());
- m_font.setBold(settings->boldFont());
+ if (settings->useSystemFont()) {
+ m_font = KGlobalSettings::generalFont();
+ } else {
+ m_font = QFont(settings->fontFamily(),
+ settings->fontSize(),
+ settings->fontWeight(),
+ settings->italicFont());
+ }
setWordWrap(settings->numberOfTextlines() > 1);
updateGridSize(view->showPreview(), 0);
@@ -119,6 +124,9 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
setCategoryDrawer(m_categoryDrawer);
setFocus();
+
+ connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
+ this, SLOT(updateFont()));
}
DolphinIconsView::~DolphinIconsView()
@@ -407,6 +415,16 @@ void DolphinIconsView::requestActivation()
m_controller->requestActivation();
}
+void DolphinIconsView::updateFont()
+{
+ const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
+ Q_ASSERT(settings != 0);
+
+ if (settings->useSystemFont()) {
+ m_font = KGlobalSettings::generalFont();
+ }
+}
+
bool DolphinIconsView::isZoomInPossible() const
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();