diff options
| author | Peter Penz <[email protected]> | 2007-05-15 20:24:56 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-05-15 20:24:56 +0000 |
| commit | 91f03ab07b894ef37864c9c5a1552b48b38f40ee (patch) | |
| tree | 65beb2b0df844734a95f657e350f9fe7600a9ffb /src/dolphiniconsview.cpp | |
| parent | c5f8d7ca78ad5cafc5464dc8eb44509b96da6ef0 (diff) | |
some finetuning for the icons view:
- rename gridWidth() and gridHeight() settings property to itemWidth() and itemHeight() to avoid confusion with the grid size property of QListView
- assure that the grid spacing is respected
- decrease default text width
- allow having more than 1 text line doing a proper wrapping
svn path=/trunk/KDE/kdebase/apps/; revision=665097
Diffstat (limited to 'src/dolphiniconsview.cpp')
| -rw-r--r-- | src/dolphiniconsview.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 6d2ca66a0..c80a58b6b 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -162,8 +162,8 @@ void DolphinIconsView::zoomIn() // increase also the grid size const int diff = newIconSize - oldIconSize; - settings->setGridWidth(settings->gridWidth() + diff); - settings->setGridHeight(settings->gridHeight() + diff); + settings->setItemWidth(settings->itemWidth() + diff); + settings->setItemHeight(settings->itemHeight() + diff); updateGridSize(showPreview, m_controller->showAdditionalInfo()); } @@ -193,8 +193,8 @@ void DolphinIconsView::zoomOut() // decrease also the grid size const int diff = oldIconSize - newIconSize; - settings->setGridWidth(settings->gridWidth() - diff); - settings->setGridHeight(settings->gridHeight() - diff); + settings->setItemWidth(settings->itemWidth() - diff); + settings->setItemHeight(settings->itemHeight() - diff); updateGridSize(showPreview, m_controller->showAdditionalInfo()); } @@ -249,26 +249,31 @@ void DolphinIconsView::updateGridSize(bool showPreview, bool showAdditionalInfo) const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings(); Q_ASSERT(settings != 0); - int gridWidth = settings->gridWidth(); - int gridHeight = settings->gridHeight(); + int itemWidth = settings->itemWidth(); + int itemHeight = settings->itemHeight(); int size = settings->iconSize(); if (showPreview) { const int previewSize = settings->previewSize(); const int diff = previewSize - size; Q_ASSERT(diff >= 0); - gridWidth += diff; - gridHeight += diff; + itemWidth += diff; + itemHeight += diff; size = previewSize; } if (showAdditionalInfo) { - gridHeight += m_viewOptions.font.pointSize() * 2; + itemHeight += m_viewOptions.font.pointSize() * 2; } - m_viewOptions.decorationSize = QSize(size, size); - setGridSize(QSize(gridWidth, gridHeight)); + // The decoration width indirectly defines the maximum + // width for the text wrapping. To use the maximum item width + // for text wrapping, it is used as decoration width. + m_viewOptions.decorationSize = QSize(itemWidth, size); + + const int spacing = settings->gridSpacing(); + setGridSize(QSize(itemWidth + spacing, itemHeight + spacing)); m_controller->setZoomInPossible(isZoomInPossible()); m_controller->setZoomOutPossible(isZoomOutPossible()); |
