┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-12-06 21:06:45 +0000
committerPeter Penz <[email protected]>2007-12-06 21:06:45 +0000
commite65154552769e648bcbe14429123ff9fcd48bd29 (patch)
tree83d9a825642bf72dc4e2bc2b13a94c6331a19ec3 /src/dolphindetailsview.cpp
parent4939ae662fad860d8355a799f2d7121fe538ee92 (diff)
Fixed wrong usage of QStyleOptionViewItem: caching of the file item in the constructor is too early (thanks to Fredrik for the hint!). This fixes 2 issues:
* the selection color of the details view now uses the correct selection color * changing the colors of KDE results in updating the colors of all Dolphin views CCMAIL: [email protected] CCMAIL: [email protected] CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=745700
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index f3d55a8c3..68b288b0b 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -44,6 +44,8 @@
DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* controller) :
QTreeView(parent),
m_controller(controller),
+ m_font(),
+ m_decorationSize(),
m_clearAdditionalInfo(false),
m_dragging(false),
m_showElasticBand(false),
@@ -107,13 +109,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
Q_ASSERT(settings != 0);
- m_viewOptions = QTreeView::viewOptions();
-
- QFont font(settings->fontFamily(), settings->fontSize());
- font.setItalic(settings->italicFont());
- font.setBold(settings->boldFont());
- m_viewOptions.font = font;
- m_viewOptions.showDecorationSelected = true;
+ m_font = QFont(settings->fontFamily(), settings->fontSize());
// 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.
@@ -163,7 +159,11 @@ bool DolphinDetailsView::event(QEvent* event)
QStyleOptionViewItem DolphinDetailsView::viewOptions() const
{
- return m_viewOptions;
+ QStyleOptionViewItem viewOptions = QTreeView::viewOptions();
+ viewOptions.font = m_font;
+ viewOptions.showDecorationSelected = true;
+ viewOptions.decorationSize = m_decorationSize;
+ return viewOptions;
}
void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event)
@@ -301,7 +301,7 @@ void DolphinDetailsView::paintEvent(QPaintEvent* event)
// TODO: remove this code when the issue #160611 is solved in Qt 4.4
if (m_dragging) {
- const QBrush& brush = m_viewOptions.palette.brush(QPalette::Normal, QPalette::Highlight);
+ const QBrush& brush = viewOptions().palette.brush(QPalette::Normal, QPalette::Highlight);
DragAndDropHelper::drawHoverIndication(viewport(), m_dropRect, brush);
}
}
@@ -516,7 +516,7 @@ void DolphinDetailsView::updateDecorationSize()
{
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
const int iconSize = settings->iconSize();
- m_viewOptions.decorationSize = QSize(iconSize, iconSize);
+ m_decorationSize = QSize(iconSize, iconSize);
m_controller->setZoomInPossible(isZoomInPossible());
m_controller->setZoomOutPossible(isZoomOutPossible());