#include "sidebartreeview.h"
-#include <kdirmodel.h>
-#include <kfileitemdelegate.h>
+#include "dolphincontroller.h"
+#include "dolphinmodel.h"
+#include <kfileitemdelegate.h>
#include <QKeyEvent>
#include <QPainter>
#include <QHeaderView>
viewport()->setAttribute(Qt::WA_Hover);
+ QPalette palette = viewport()->palette();
+ palette.setColor(viewport()->backgroundRole(), Qt::transparent);
+ viewport()->setPalette(palette);
+
KFileItemDelegate* delegate = new KFileItemDelegate(this);
setItemDelegate(delegate);
}
{
if (event->type() == QEvent::Polish) {
// hide all columns except of the 'Name' column
- hideColumn(KDirModel::Size);
- hideColumn(KDirModel::ModifiedTime);
- hideColumn(KDirModel::Permissions);
- hideColumn(KDirModel::Owner);
- hideColumn(KDirModel::Group);
- hideColumn(KDirModel::Type);
+ hideColumn(DolphinModel::Size);
+ hideColumn(DolphinModel::ModifiedTime);
+ hideColumn(DolphinModel::Permissions);
+ hideColumn(DolphinModel::Owner);
+ hideColumn(DolphinModel::Group);
+ hideColumn(DolphinModel::Type);
+ hideColumn(DolphinModel::Rating);
+ hideColumn(DolphinModel::Tags);
header()->hide();
}
{
QTreeView::paintEvent(event);
+ // TODO: remove this code when the issue #160611 is solved in Qt 4.4
if (m_dragging) {
- // TODO: remove this code when the issue #160611 is solved in Qt 4.4
- QPainter painter(viewport());
- painter.save();
- QBrush brush(palette().brush(QPalette::Normal, QPalette::Highlight));
- QColor color = brush.color();
- color.setAlpha(64);
- brush.setColor(color);
- painter.fillRect(m_dropRect, brush);
- painter.restore();
+ const QBrush& brush = palette().brush(QPalette::Normal, QPalette::Highlight);
+ DolphinController::drawHoverIndication(viewport(), m_dropRect, brush);
}
}