From f8dd060cadecd9f4c36b79d53dbae706dadf99f6 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 27 Feb 2007 20:46:21 +0000 Subject: The icons view and details view don't use hardcoded (test-) values anymore, instead the settings for fonts, grid size, ... are read out. The settings dialogs itself will be reworked later if it is clear what should be configurable in which manner. At least the current settings dialog allows to play with the new capabilities we got by KFileItemDelegate, just lets see what we can improve later on... svn path=/trunk/KDE/kdebase/apps/; revision=637792 --- src/iconsviewsettingspage.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/iconsviewsettingspage.cpp') diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp index 3433e8532..f4c8de577 100644 --- a/src/iconsviewsettingspage.cpp +++ b/src/iconsviewsettingspage.cpp @@ -38,8 +38,10 @@ #include #include +#include + #define GRID_SPACING_BASE 8 -#define GRID_SPACING_INC 12 +#define GRID_SPACING_INC 24 IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent) : @@ -148,7 +150,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow, gridGroup->setSizePolicy(sizePolicy); gridGroup->setMargin(margin); - const bool leftToRightArrangement = (settings->arrangement() == "LeftToRight"); + const bool leftToRightArrangement = (settings->arrangement() == QListView::LeftToRight); new QLabel(i18n("Arrangement:"), gridGroup); m_arrangementBox = new QComboBox(gridGroup); m_arrangementBox->addItem(i18n("Left to right")); @@ -193,11 +195,26 @@ void IconsViewSettingsPage::applySettings() const int fontSize = m_fontSizeBox->value(); - QString arrangement = (m_arrangementBox->currentIndex() == 0) ? - "LeftToRight" : - "TopToBottom"; + const int arrangement = (m_arrangementBox->currentIndex() == 0) ? + QListView::LeftToRight : + QListView::TopToBottom; + settings->setArrangement(arrangement); - //DolphinSettings::instance().calculateGridSize(m_textWidthBox->currentIndex()); + + // TODO: this is just a very rough testing code to calculate the grid + // width and height + int gridWidth = defaultSize; + int gridHeight = defaultSize; + if (arrangement == QListView::TopToBottom) { + gridWidth += 96; + gridHeight += 64; + } + else { + gridWidth += 256; + } + + settings->setGridWidth(gridWidth); + settings->setGridHeight(gridHeight); settings->setFontFamily(m_fontFamilyBox->currentFont().family()); settings->setFontSize(fontSize); -- cgit v1.3