]> cloud.milkyroute.net Git - dolphin.git/blob - src/iconsviewsettingspage.h
commited initial version of Dolphin
[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 #include <q3vbox.h>
25 #include <dolphiniconsview.h>
26
27 class QSlider;
28 class QComboBox;
29 class QCheckBox;
30 class QPushButton;
31 class QSpinBox;
32 class KFontCombo;
33 class PixmapViewer;
34
35 /**
36 * @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
37 * of the Dolphin settings dialog.
38 *
39 * Allows to set:
40 * - icon size
41 * - preview size
42 * - text width
43 * - grid spacing
44 * - font family
45 * - font size
46 * - number of text lines
47 * - arrangement
48 *
49 * @see DolphinIconsViewSettings
50 * @author Peter Penz <peter.penz@gmx.at>
51 */
52 class IconsViewSettingsPage : public Q3VBox
53 {
54 Q_OBJECT
55
56 public:
57 IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
58 QWidget* parent);
59 virtual ~IconsViewSettingsPage();
60
61 /**
62 * Applies the settings for the icons view.
63 * The settings are persisted automatically when
64 * closing Dolphin.
65 */
66 void applySettings();
67
68 private slots:
69 void slotIconSizeChanged(int value);
70 void slotPreviewSizeChanged(int value);
71
72 private:
73 DolphinIconsView::LayoutMode m_mode;
74
75 QSlider* m_iconSizeSlider;
76 PixmapViewer* m_iconSizeViewer;
77 QSlider* m_previewSizeSlider;
78 PixmapViewer* m_previewSizeViewer;
79 QComboBox* m_textWidthBox;
80 QComboBox* m_gridSpacingBox;
81 KFontCombo* m_fontFamilyBox;
82 QSpinBox* m_fontSizeBox;
83 QSpinBox* m_textlinesCountBox;
84 QComboBox* m_arrangementBox;
85
86 /** Returns the icon size for the given slider value. */
87 int iconSize(int sliderValue) const;
88
89 /** Returns the slider value for the given icon size. */
90 int sliderValue(int iconSize) const;
91
92 /**
93 * Adjusts the selection of the text width combo box dependant
94 * from the grid width and grid height settings.
95 */
96 void adjustTextWidthSelection();
97 };
98
99 #endif