]> cloud.milkyroute.net Git - dolphin.git/blob - src/iconsviewsettingspage.h
Use a KIO Job for applying the view properties recursively to sub directories.
[dolphin.git] / src / iconsviewsettingspage.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
3 * peter.penz@gmx.at *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21 #ifndef ICONSVIEWSETTINGSPAGE_H
22 #define ICONSVIEWSETTINGSPAGE_H
23
24
25 #include <dolphiniconsview.h>
26 #include <kvbox.h>
27
28 class QSlider;
29 class QComboBox;
30 class QCheckBox;
31 class QPushButton;
32 class QSpinBox;
33 class QFontComboBox;
34 class PixmapViewer;
35
36 /**
37 * @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
38 * of the Dolphin settings dialog.
39 *
40 * Allows to set:
41 * - icon size
42 * - preview size
43 * - text width
44 * - grid spacing
45 * - font family
46 * - font size
47 * - number of text lines
48 * - arrangement
49 *
50 * @see DolphinIconsViewSettings
51 * @author Peter Penz <peter.penz@gmx.at>
52 */
53 class IconsViewSettingsPage : public KVBox
54 {
55 Q_OBJECT
56
57 public:
58 IconsViewSettingsPage(/*DolphinIconsView::LayoutMode mode,*/
59 QWidget* parent);
60 virtual ~IconsViewSettingsPage();
61
62 /**
63 * Applies the settings for the icons view.
64 * The settings are persisted automatically when
65 * closing Dolphin.
66 */
67 void applySettings();
68
69 private slots:
70 void slotIconSizeChanged(int value);
71 void slotPreviewSizeChanged(int value);
72
73 private:
74 //DolphinIconsView::LayoutMode m_mode;
75
76 QSlider* m_iconSizeSlider;
77 PixmapViewer* m_iconSizeViewer;
78 QSlider* m_previewSizeSlider;
79 PixmapViewer* m_previewSizeViewer;
80 QComboBox* m_textWidthBox;
81 QComboBox* m_gridSpacingBox;
82 QFontComboBox* m_fontFamilyBox;
83 QSpinBox* m_fontSizeBox;
84 QSpinBox* m_textlinesCountBox;
85 QComboBox* m_arrangementBox;
86
87 /** Returns the icon size for the given slider value. */
88 int iconSize(int sliderValue) const;
89
90 /** Returns the slider value for the given icon size. */
91 int sliderValue(int iconSize) const;
92
93 /**
94 * Adjusts the selection of the text width combo box dependant
95 * from the grid width and grid height settings.
96 */
97 void adjustTextWidthSelection();
98 };
99
100 #endif