diff options
| author | Peter Penz <[email protected]> | 2007-02-27 20:46:21 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-02-27 20:46:21 +0000 |
| commit | f8dd060cadecd9f4c36b79d53dbae706dadf99f6 (patch) | |
| tree | ecc4dbc1066658782ead831fae94b6b8ccde1c36 /src/dolphindetailsview.cpp | |
| parent | 6c4e3aee2a65969d25813d9809bffca23fbe18d3 (diff) | |
The icons view and details view don't use hardcoded (test-) values anymore, instead the settings for fonts, grid size, ... are read out. The settings dialogs itself will be reworked later if it is clear what should be configurable in which manner. At least the current settings dialog allows to play with the new capabilities we got by KFileItemDelegate, just lets see what we can improve later on...
svn path=/trunk/KDE/kdebase/apps/; revision=637792
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 0b350f8b2..f0d93425b 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -21,9 +21,12 @@ #include "dolphindetailsview.h" #include "dolphincontroller.h" +#include "dolphinsettings.h" #include "dolphinsortfilterproxymodel.h" #include "viewproperties.h" +#include "dolphin_detailsmodesettings.h" + #include <assert.h> #include <kdirmodel.h> #include <QHeaderView> @@ -53,6 +56,15 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr connect(this, SIGNAL(clicked(const QModelIndex&)), controller, SLOT(triggerItem(const QModelIndex&))); + + // apply the details mode settings to the widget + const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings(); + assert(settings != 0); + + m_viewOptions = QTreeView::viewOptions(); + m_viewOptions.font = QFont(settings->fontFamily(), settings->fontSize()); + const int iconSize = settings->iconSize(); + m_viewOptions.decorationSize = QSize(iconSize, iconSize); } DolphinDetailsView::~DolphinDetailsView() @@ -75,17 +87,7 @@ bool DolphinDetailsView::event(QEvent* event) } QStyleOptionViewItem DolphinDetailsView::viewOptions() const { - return QTreeView::viewOptions(); - - // TODO: the view options should been read from the settings; - // the following code is just for testing... - //QStyleOptionViewItem options = QTreeView::viewOptions(); - //options.decorationAlignment = Qt::AlignRight; - //options.decorationPosition = QStyleOptionViewItem::Right; - //options.decorationSize = QSize(100, 100); - //options.showDecorationSelected = true; - //options.state = QStyle::State_MouseOver; - //return options; + return m_viewOptions; } void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event) |
