┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-10-02 22:04:36 +0000
committerPeter Penz <[email protected]>2007-10-02 22:04:36 +0000
commit3c1c185400a55103cea3ed567de167df87b59945 (patch)
treecb795f1bb1582e9728634f31d66e1fc989a7c087 /src/dolphiniconsview.cpp
parentba150e5735bd336752f713df1e9f66b7ed90e6ae (diff)
Allow showing additional information like type, size and date in parallel for the icons view (thanks to Fredrik for the extension of KFileItemDelegate!).
svn path=/trunk/KDE/kdebase/apps/; revision=720283
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 9e2d3ee02..6b584612c 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -64,8 +64,8 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(showPreviewChanged(bool)),
this, SLOT(slotShowPreviewChanged(bool)));
- connect(controller, SIGNAL(showAdditionalInfoChanged(bool)),
- this, SLOT(slotShowAdditionalInfoChanged(bool)));
+ connect(controller, SIGNAL(additionalInfoCountChanged(int)),
+ this, SLOT(slotAdditionalInfoCountChanged(int)));
connect(controller, SIGNAL(zoomIn()),
this, SLOT(zoomIn()));
connect(controller, SIGNAL(zoomOut()),
@@ -84,7 +84,7 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
m_viewOptions.font = font;
setWordWrap(settings->numberOfTextlines() > 1);
- updateGridSize(controller->showPreview(), controller->showAdditionalInfo());
+ updateGridSize(controller->showPreview(), controller->additionalInfoCount());
if (settings->arrangement() == QListView::TopToBottom) {
setFlow(QListView::LeftToRight);
@@ -230,12 +230,12 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
void DolphinIconsView::slotShowPreviewChanged(bool showPreview)
{
- updateGridSize(showPreview, m_controller->showAdditionalInfo());
+ updateGridSize(showPreview, m_controller->additionalInfoCount());
}
-void DolphinIconsView::slotShowAdditionalInfoChanged(bool showAdditionalInfo)
+void DolphinIconsView::slotAdditionalInfoCountChanged(int count)
{
- updateGridSize(m_controller->showPreview(), showAdditionalInfo);
+ updateGridSize(m_controller->showPreview(), count);
}
void DolphinIconsView::zoomIn()
@@ -264,7 +264,7 @@ void DolphinIconsView::zoomIn()
settings->setItemWidth(settings->itemWidth() + diff);
settings->setItemHeight(settings->itemHeight() + diff);
- updateGridSize(showPreview, m_controller->showAdditionalInfo());
+ updateGridSize(showPreview, m_controller->additionalInfoCount());
}
}
@@ -295,7 +295,7 @@ void DolphinIconsView::zoomOut()
settings->setItemWidth(settings->itemWidth() - diff);
settings->setItemHeight(settings->itemHeight() - diff);
- updateGridSize(showPreview, m_controller->showAdditionalInfo());
+ updateGridSize(showPreview, m_controller->additionalInfoCount());
}
}
@@ -341,7 +341,7 @@ int DolphinIconsView::decreasedIconSize(int size) const
return decSize;
}
-void DolphinIconsView::updateGridSize(bool showPreview, bool showAdditionalInfo)
+void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
{
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
Q_ASSERT(settings != 0);
@@ -360,9 +360,8 @@ void DolphinIconsView::updateGridSize(bool showPreview, bool showAdditionalInfo)
size = previewSize;
}
- if (showAdditionalInfo) {
- itemHeight += m_viewOptions.font.pointSize() * 2;
- }
+ Q_ASSERT(additionalInfoCount >= 0);
+ itemHeight += additionalInfoCount * m_viewOptions.font.pointSize() * 2;
if (settings->arrangement() == QListView::TopToBottom) {
// The decoration width indirectly defines the maximum