From 51cbeaf512da9ebaefb0bfcaa21cca0f47d1b79d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 17 Feb 2008 15:50:06 +0000 Subject: * 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: ereslibre@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=776188 --- src/dolphindetailsview.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/dolphindetailsview.cpp') diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index ff4ce540f..75481fb36 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -120,7 +120,14 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()), this, SLOT(updateColumnVisibility())); - m_font = QFont(settings->fontFamily(), settings->fontSize()); + if (settings->useSystemFont()) { + m_font = KGlobalSettings::generalFont(); + } else { + m_font = QFont(settings->fontFamily(), + settings->fontSize(), + settings->fontWeight(), + settings->italicFont()); + } // TODO: Remove this check when 4.3.2 is released and KDE requires it... this // check avoids a division by zero happening on versions before 4.3.1. @@ -134,6 +141,9 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr updateDecorationSize(); setFocus(); + + connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), + this, SLOT(updateFont())); } DolphinDetailsView::~DolphinDetailsView() @@ -549,6 +559,16 @@ void DolphinDetailsView::requestActivation() m_controller->requestActivation(); } +void DolphinDetailsView::updateFont() +{ + const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings(); + Q_ASSERT(settings != 0); + + if (settings->useSystemFont()) { + m_font = KGlobalSettings::generalFont(); + } +} + bool DolphinDetailsView::isZoomInPossible() const { DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings(); -- cgit v1.3