m_elasticBandOrigin(),
m_elasticBandDestination()
{
+ const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
+ Q_ASSERT(settings != 0);
Q_ASSERT(controller != 0);
setAcceptDrops(true);
- setRootIsDecorated(false);
setSortingEnabled(true);
setUniformRowHeights(true);
setSelectionBehavior(SelectItems);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setAlternatingRowColors(true);
- setItemsExpandable(false);
+ setRootIsDecorated(settings->expandableFolders());
+ setItemsExpandable(settings->expandableFolders());
setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
this, SLOT(updateColumnVisibility()));
- // apply the details mode settings to the widget
- const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- Q_ASSERT(settings != 0);
-
- 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.
updateDecorationSize();
setFocus();
+
+ connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
+ this, SLOT(updateFont()));
}
DolphinDetailsView::~DolphinDetailsView()
setSelection(selRect, QItemSelectionModel::Select);
}
- QTreeView::mouseMoveEvent(event);
+ // TODO: see comment at end of method
+ // QTreeView::mouseMoveEvent(event);
+ QAbstractItemView::mouseMoveEvent(event);
updateElasticBand();
} else {
- QTreeView::mouseMoveEvent(event);
+ // TODO: see comment at end of method
+ //QTreeView::mouseMoveEvent(event);
+ QAbstractItemView::mouseMoveEvent(event);
}
+
+ // The original implementation of QTreeView::mouseMoveEvent() looks like this (Qt4.4):
+ //
+ // void QTreeView::mouseMoveEvent(QMouseEvent *event)
+ // {
+ // Q_D(QTreeView);
+ // if (d->itemDecorationAt(event->pos()) == -1) // ### what about expanding/collapsing state ?
+ // QAbstractItemView::mouseMoveEvent(event);
+ // }
+ //
+ // This prevents that the signal 'entered()' is emitted when the mouse is above a decoration,
+ // although the hovered item has changed. The SelectionManager is connected to 'entered()'
+ // and assumes that the old item is selected. This is currently bypassed by skipping
+ // the base implementation and invoking QAbstractItemView::mouseMoveEvent() directly.
+ // Submitted a bug report to Trolltech, bug ID is still pending.
}
void DolphinDetailsView::mouseReleaseEvent(QMouseEvent* event)
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();