/***************************************************************************
- * 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 *
#ifndef ICONSVIEWSETTINGSPAGE_H
#define ICONSVIEWSETTINGSPAGE_H
-
#include <dolphiniconsview.h>
#include <kvbox.h>
-class QSlider;
+class DolphinMainWindow;
+class KFontRequester;
class QComboBox;
-class QCheckBox;
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
- * @author Peter Penz <peter.penz@gmx.at>
*/
class IconsViewSettingsPage : public KVBox
{
Q_OBJECT
public:
- IconsViewSettingsPage(/*DolphinIconsView::LayoutMode mode,*/
- QWidget* parent);
+ IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent);
virtual ~IconsViewSettingsPage();
/**
*/
void applySettings();
+ /** Restores the settings to default values. */
+ void restoreDefaults();
+
private slots:
- void slotIconSizeChanged(int value);
- void slotPreviewSizeChanged(int value);
+ void openIconSizeDialog();
private:
- //DolphinIconsView::LayoutMode m_mode;
+ void loadSettings();
- QSlider* m_iconSizeSlider;
- PixmapViewer* m_iconSizeViewer;
- QSlider* m_previewSizeSlider;
- PixmapViewer* m_previewSizeViewer;
- QComboBox* m_textWidthBox;
- QComboBox* m_gridSpacingBox;
- QFontComboBox* m_fontFamilyBox;
- QSpinBox* m_fontSizeBox;
- QSpinBox* m_textlinesCountBox;
- QComboBox* m_arrangementBox;
+private:
+ enum
+ {
+ GridSpacingBase = 8,
+ GridSpacingInc = 24,
+ LeftToRightBase = 128,
+ LeftToRightInc = 64,
+ TopToBottomBase = 64,
+ TopToBottomInc = 32
+ };
- /** Returns the icon size for the given slider value. */
- int iconSize(int sliderValue) const;
+ DolphinMainWindow* m_mainWindow;
+ int m_iconSize;
+ int m_previewSize;
- /** Returns the slider value for the given icon size. */
- int sliderValue(int iconSize) const;
+ QPushButton* m_iconSizeButton;
+ QComboBox* m_textWidthBox;
+ KFontRequester* m_fontRequester;
+ QSpinBox* m_textlinesCountBox;
- /**
- * Adjusts the selection of the text width combo box dependant
- * from the grid width and grid height settings.
- */
- void adjustTextWidthSelection();
+ QComboBox* m_arrangementBox;
+ QComboBox* m_gridSpacingBox;
};
#endif