]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/iconsviewsettingspage.h
There are some extractable strings in subdirs too.
[dolphin.git] / src / iconsviewsettingspage.h
index aa106ef27b7df9438f252e0b864621def185a00a..c7f3123abc8219fc92ad5535bdac0c76456e654a 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  *
 #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
@@ -42,19 +38,18 @@ class PixmapViewer;
  * - 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();
 
     /**
@@ -62,38 +57,38 @@ public:
      * 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