/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
- * peter.penz@gmx.at *
+ * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#define ICONSVIEWSETTINGSPAGE_H
#include <dolphiniconsview.h>
-#include <kvbox.h>
+#include <viewsettingspagebase.h>
-class DolphinMainWindow;
-class QSlider;
-class QComboBox;
+class DolphinFontRequester;
class QCheckBox;
+class QComboBox;
class QPushButton;
class QSpinBox;
-class QFontComboBox;
-class PixmapViewer;
/**
* @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
* - preview size
* - text width
* - grid spacing
- * - font family
- * - font size
+ * - font
* - number of text lines
* - arrangement
*
* @see DolphinIconsViewSettings
*/
-class IconsViewSettingsPage : public KVBox
+class IconsViewSettingsPage : public ViewSettingsPageBase
{
Q_OBJECT
public:
- IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent);
+ IconsViewSettingsPage(QWidget* parent);
virtual ~IconsViewSettingsPage();
/**
* The settings are persisted automatically when
* closing Dolphin.
*/
- void applySettings();
+ virtual void applySettings();
+
+ /** Restores the settings to default values. */
+ virtual void restoreDefaults();
private slots:
- void slotIconSizeChanged(int value);
- void slotPreviewSizeChanged(int value);
+ void openIconSizeDialog();
private:
- DolphinMainWindow* m_mainWindow;
- QSlider* m_iconSizeSlider;
- PixmapViewer* m_iconSizeViewer;
- QSlider* m_previewSizeSlider;
- PixmapViewer* m_previewSizeViewer;
+ void loadSettings();
+
+private:
+ enum
+ {
+ GridSpacingBase = 8,
+ GridSpacingInc = 12,
+ LeftToRightBase = 128,
+ LeftToRightInc = 64,
+ TopToBottomBase = 64,
+ TopToBottomInc = 32
+ };
+
+ int m_iconSize;
+ int m_previewSize;
+
+ QPushButton* m_iconSizeButton;
QComboBox* m_textWidthBox;
- QFontComboBox* m_fontFamilyBox;
- QSpinBox* m_fontSizeBox;
+ DolphinFontRequester* m_fontRequester;
QSpinBox* m_textlinesCountBox;
- QComboBox* m_additionalInfo;
QComboBox* m_arrangementBox;
QComboBox* m_gridSpacingBox;
-
- /** Returns the icon size for the given slider value. */
- int iconSize(int sliderValue) const;
-
- /** Returns the slider value for the given icon size. */
- int sliderValue(int iconSize) const;
-
- /**
- * Adjusts the selection of the text width combo box dependant
- * from the grid width and grid height settings.
- */
- void adjustTextWidthSelection();
};
#endif