- don't show a focused border above all columns
- provide a small gap between the columns
- assure that the background of inactive columns works well with more complex styles like Oxygen
CCMAIL: cbr@boemann.dk
svn path=/trunk/KDE/kdebase/apps/; revision=726042
m_index(-1),
m_contentX(0),
m_columns(),
m_index(-1),
m_contentX(0),
m_columns(),
m_animation(0)
{
Q_ASSERT(controller != 0);
m_animation(0)
{
Q_ASSERT(controller != 0);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setSelectionMode(ExtendedSelection);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setSelectionMode(ExtendedSelection);
+ setFocusPolicy(Qt::NoFocus);
+ setFrameShape(QFrame::NoFrame);
connect(this, SIGNAL(entered(const QModelIndex&)),
controller, SLOT(emitItemEntered(const QModelIndex&)));
connect(this, SIGNAL(entered(const QModelIndex&)),
controller, SLOT(emitItemEntered(const QModelIndex&)));
m_columns.append(column);
setActiveColumnIndex(0);
m_columns.append(column);
setActiveColumnIndex(0);
+ m_emptyViewport = new QFrame(viewport());
+ m_emptyViewport->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
+
updateDecorationSize();
updateColumnsBackground(true);
}
updateDecorationSize();
updateColumnsBackground(true);
}
m_active = active;
// dim the background of the viewport
m_active = active;
// dim the background of the viewport
- QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
- color.setAlpha(150);
-
- palette.setColor(viewport()->backgroundRole(), color);
+ palette.setColor(viewport()->backgroundRole(), QColor(0, 0, 0, 0));
viewport()->setPalette(palette);
foreach (DolphinColumnWidget* column, m_columns) {
viewport()->setPalette(palette);
foreach (DolphinColumnWidget* column, m_columns) {
void DolphinColumnView::layoutColumns()
{
void DolphinColumnView::layoutColumns()
{
ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
const int columnWidth = settings->columnWidth();
ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
const int columnWidth = settings->columnWidth();
+
+ QRect emptyViewportRect;
if (isRightToLeft()) {
int x = viewport()->width() - columnWidth + m_contentX;
foreach (DolphinColumnWidget* column, m_columns) {
if (isRightToLeft()) {
int x = viewport()->width() - columnWidth + m_contentX;
foreach (DolphinColumnWidget* column, m_columns) {
- column->setGeometry(QRect(x, 0, columnWidth, viewport()->height()));
+ column->setGeometry(QRect(x, 0, columnWidth - gap, viewport()->height()));
+ emptyViewportRect = QRect(0, 0, x + columnWidth - gap, viewport()->height());
} else {
int x = m_contentX;
foreach (DolphinColumnWidget* column, m_columns) {
} else {
int x = m_contentX;
foreach (DolphinColumnWidget* column, m_columns) {
- column->setGeometry(QRect(x, 0, columnWidth, viewport()->height()));
+ column->setGeometry(QRect(x, 0, columnWidth - gap, viewport()->height()));
+ emptyViewportRect = QRect(x, 0, viewport()->width() - x - gap, viewport()->height());
+ }
+
+ if (emptyViewportRect.isValid()) {
+ m_emptyViewport->show();
+ m_emptyViewport->setGeometry(emptyViewportRect);
+ } else {
+ m_emptyViewport->hide();
}
}
void DolphinColumnView::updateScrollBar()
{
}
}
void DolphinColumnView::updateScrollBar()
{
- int contentWidth = 0;
- foreach (DolphinColumnWidget* column, m_columns) {
- contentWidth += column->width();
- }
+ ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
+ const int contentWidth = m_columns.count() * settings->columnWidth();
horizontalScrollBar()->setPageStep(contentWidth);
horizontalScrollBar()->setRange(0, contentWidth - viewport()->width());
horizontalScrollBar()->setPageStep(contentWidth);
horizontalScrollBar()->setRange(0, contentWidth - viewport()->width());
{
const int viewportWidth = viewport()->width();
const int x = activeColumn()->x();
{
const int viewportWidth = viewport()->width();
const int x = activeColumn()->x();
- const int width = activeColumn()->width();
+
+ ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
+ const int width = settings->columnWidth();
+
if (x + width > viewportWidth) {
const int newContentX = m_contentX - x - width + viewportWidth;
if (isRightToLeft()) {
if (x + width > viewportWidth) {
const int newContentX = m_contentX - x - width + viewportWidth;
if (isRightToLeft()) {
class DolphinController;
class DolphinModel;
class QAbstractProxyModel;
class DolphinController;
class DolphinModel;
class QAbstractProxyModel;
int m_index;
int m_contentX;
QList<DolphinColumnWidget*> m_columns;
int m_index;
int m_contentX;
QList<DolphinColumnWidget*> m_columns;
+ QFrame* m_emptyViewport;
QTimeLine* m_animation;
friend class DolphinColumnWidget;
QTimeLine* m_animation;
friend class DolphinColumnWidget;
setSelectionMode(QAbstractItemView::ExtendedSelection);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
- setFocusPolicy(Qt::NoFocus);
// 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.
// 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.
{
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
if (!m_active || !m_view->m_active) {
{
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
if (!m_active || !m_view->m_active) {
}
QPalette palette = viewport()->palette();
palette.setColor(viewport()->backgroundRole(), color);
}
QPalette palette = viewport()->palette();
palette.setColor(viewport()->backgroundRole(), color);
void DolphinColumnWidget::activate()
{
void DolphinColumnWidget::activate()
{
- if (m_view->hasFocus()) {
- setFocus(Qt::OtherFocusReason);
- }
- m_view->setFocusProxy(this);
+ setFocus(Qt::OtherFocusReason);
// TODO: Connecting to the signal 'activated()' is not possible, as kstyle
// does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is
// TODO: Connecting to the signal 'activated()' is not possible, as kstyle
// does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is
void DolphinColumnWidget::deactivate()
{
void DolphinColumnWidget::deactivate()
{
// TODO: Connecting to the signal 'activated()' is not possible, as kstyle
// does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is
// necessary connecting the signal 'singleClick()' or 'doubleClick'.
// TODO: Connecting to the signal 'activated()' is not possible, as kstyle
// does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is
// necessary connecting the signal 'singleClick()' or 'doubleClick'.
#endif
updateDecorationSize();
#endif
updateDecorationSize();
}
DolphinDetailsView::~DolphinDetailsView()
}
DolphinDetailsView::~DolphinDetailsView()
m_categoryDrawer = new DolphinCategoryDrawer();
setCategoryDrawer(m_categoryDrawer);
m_categoryDrawer = new DolphinCategoryDrawer();
setCategoryDrawer(m_categoryDrawer);
}
DolphinIconsView::~DolphinIconsView()
}
DolphinIconsView::~DolphinIconsView()
- itemView()->setFocus();
-
emit startedPathLoading(url);
}
emit startedPathLoading(url);
}
this, SLOT(emitContentsMoved()));
connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(emitContentsMoved()));
this, SLOT(emitContentsMoved()));
connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(emitContentsMoved()));
}
QAbstractItemView* DolphinView::itemView() const
}
QAbstractItemView* DolphinView::itemView() const