]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/iconsviewsettingspage.h
Forwardport 773570:
[dolphin.git] / src / iconsviewsettingspage.h
index 7d67bc79c244137b15e51f46b6ec2fa8dacbb021..f45a14fd6989184cccf33df8d15a1e6d8c45241d 100644 (file)
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   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 QComboBox;
+class DolphinMainWindow;
+class KFontRequester;
 class QCheckBox;
+class QComboBox;
 class QPushButton;
 class QSpinBox;
-class QFontComboBox;
-class PixmapViewer;
 
 /**
  * @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
@@ -42,20 +39,18 @@ class PixmapViewer;
  * - 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(QWidget* parent);
+    IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent);
     virtual ~IconsViewSettingsPage();
 
     /**
@@ -65,35 +60,37 @@ public:
      */
     void applySettings();
 
+    /** Restores the settings to default values. */
+    void restoreDefaults();
+
 private slots:
-    void slotIconSizeChanged(int value);
-    void slotPreviewSizeChanged(int value);
+    void openIconSizeDialog();
 
 private:
-    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
+    };
+
+    DolphinMainWindow* m_mainWindow;
+    int m_iconSize;
+    int m_previewSize;
+
+    QPushButton* m_iconSizeButton;
     QComboBox* m_textWidthBox;
-    QFontComboBox* m_fontFamilyBox;
-    QSpinBox* m_fontSizeBox;
+    KFontRequester* 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