┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/iconsviewsettingspage.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-27 20:46:21 +0000
committerPeter Penz <[email protected]>2007-02-27 20:46:21 +0000
commitf8dd060cadecd9f4c36b79d53dbae706dadf99f6 (patch)
treeecc4dbc1066658782ead831fae94b6b8ccde1c36 /src/iconsviewsettingspage.cpp
parent6c4e3aee2a65969d25813d9809bffca23fbe18d3 (diff)
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
Diffstat (limited to 'src/iconsviewsettingspage.cpp')
-rw-r--r--src/iconsviewsettingspage.cpp29
1 files changed, 23 insertions, 6 deletions
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 <klocale.h>
#include <kvbox.h>
+#include <QListView>
+
#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);