From: Peter Penz Date: Wed, 28 Feb 2007 06:32:56 +0000 (+0000) Subject: Instead of using the ListMode of the icon view for the left to right alignment, still... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/524eff1a245758f2b1111595a1ef3fc20dabeb1f Instead of using the ListMode of the icon view for the left to right alignment, still use the IconMode and adjust the alignment properties. Minor issue open: it seems that KFileItemDelegate currently does not care about the alignment properties of QStyleOptionViewItem, it always centers the the icons + text; I'll have a look on this... svn path=/trunk/KDE/kdebase/apps/; revision=637907 --- diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 71bf7c76f..d89bb3650 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -35,6 +35,7 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle m_controller(controller) { assert(controller != 0); + setViewMode(QListView::IconMode); setResizeMode(QListView::Adjust); connect(this, SIGNAL(clicked(const QModelIndex&)), @@ -44,13 +45,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings(); assert(settings != 0); - if (settings->arrangement() == QListView::TopToBottom) { - setViewMode(QListView::IconMode); - } - else { - setViewMode(QListView::ListMode); - } - setGridSize(QSize(settings->gridWidth(), settings->gridHeight())); setSpacing(settings->gridSpacing()); @@ -58,6 +52,15 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle m_viewOptions.font = QFont(settings->fontFamily(), settings->fontSize()); const int iconSize = settings->iconSize(); m_viewOptions.decorationSize = QSize(iconSize, iconSize); + + if (settings->arrangement() == QListView::TopToBottom) { + setFlow(QListView::TopToBottom); + m_viewOptions.decorationPosition = QStyleOptionViewItem::Top; + } + else { + setFlow(QListView::LeftToRight); + m_viewOptions.decorationPosition = QStyleOptionViewItem::Left; + } } DolphinIconsView::~DolphinIconsView()