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/iconsviewsettingspage.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/iconsviewsettingspage.cpp')
| -rw-r--r-- | src/iconsviewsettingspage.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp index 2cd56043f..86823ede0 100644 --- a/src/iconsviewsettingspage.cpp +++ b/src/iconsviewsettingspage.cpp @@ -93,7 +93,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, const bool leftToRightArrangement = (settings->arrangement() == QListView::LeftToRight); int textWidthIndex = 0; - const int remainingWidth = settings->gridWidth() - settings->iconSize(); + const int remainingWidth = settings->itemWidth() - settings->iconSize(); if (leftToRightArrangement) { textWidthIndex = (remainingWidth - LeftToRightBase) / LeftToRightInc; } else { @@ -154,7 +154,7 @@ void IconsViewSettingsPage::applySettings() settings->setPreviewSize(m_previewSize); const QFont font = m_fontRequester->font(); - const int fontSize = font.pointSize(); + const int fontHeight = QFontMetrics(font).height(); const int arrangement = (m_arrangementBox->currentIndex() == 0) ? QListView::LeftToRight : @@ -164,21 +164,21 @@ void IconsViewSettingsPage::applySettings() const int numberOfTextlines = m_textlinesCountBox->value(); const int defaultSize = settings->iconSize(); - int gridWidth = defaultSize; - int gridHeight = defaultSize; + int itemWidth = defaultSize; + int itemHeight = defaultSize; const int textSizeIndex = m_textWidthBox->currentIndex(); if (arrangement == QListView::TopToBottom) { - gridWidth += TopToBottomBase + textSizeIndex * TopToBottomInc; - gridHeight += fontSize * (2 + numberOfTextlines); + itemWidth += TopToBottomBase + textSizeIndex * TopToBottomInc; + itemHeight += fontHeight * numberOfTextlines + 16; } else { - gridWidth += LeftToRightBase + textSizeIndex * LeftToRightInc; + itemWidth += LeftToRightBase + textSizeIndex * LeftToRightInc; } - settings->setGridWidth(gridWidth); - settings->setGridHeight(gridHeight); + settings->setItemWidth(itemWidth); + settings->setItemHeight(itemHeight); settings->setFontFamily(font.family()); - settings->setFontSize(fontSize); + settings->setFontSize(font.pointSize()); settings->setItalicFont(font.italic()); settings->setBoldFont(font.bold()); |
