]>
cloud.milkyroute.net Git - dolphin.git/blob - src/iconsizegroupbox.cpp
1 /***************************************************************************
2 * Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "iconsizegroupbox.h"
24 #include <QGridLayout>
28 IconSizeGroupBox::IconSizeGroupBox(QWidget
* parent
) :
29 QGroupBox(i18nc("@title:group", "Icon Size"), parent
),
30 m_defaultSizeSlider(0),
31 m_previewSizeSlider(0)
33 QLabel
* defaultLabel
= new QLabel(i18nc("@label:listbox", "Default:"), this);
34 m_defaultSizeSlider
= new QSlider(Qt::Horizontal
, this);
35 m_defaultSizeSlider
->setPageStep(1);
36 m_defaultSizeSlider
->setTickPosition(QSlider::TicksBelow
);
37 connect(m_defaultSizeSlider
, SIGNAL(sliderMoved(int)),
38 this, SIGNAL(defaultSizeChanged(int)));
40 QLabel
* previewLabel
= new QLabel(i18nc("@label:listbox", "Preview:"), this);
41 m_previewSizeSlider
= new QSlider(Qt::Horizontal
, this);
42 m_previewSizeSlider
->setPageStep(1);
43 m_previewSizeSlider
->setTickPosition(QSlider::TicksBelow
);
44 connect(m_previewSizeSlider
, SIGNAL(sliderMoved(int)),
45 this, SIGNAL(defaultSizeChanged(int)));
47 QGridLayout
* layout
= new QGridLayout(this);
48 layout
->addWidget(defaultLabel
, 0, 0);
49 layout
->addWidget(m_defaultSizeSlider
, 0, 1);
50 layout
->addWidget(previewLabel
, 1, 0);
51 layout
->addWidget(m_previewSizeSlider
, 1, 1);
54 IconSizeGroupBox::~IconSizeGroupBox()
58 void IconSizeGroupBox::setDefaultSizeRange(int min
, int max
)
60 m_defaultSizeSlider
->setRange(min
, max
);
63 void IconSizeGroupBox::setPreviewSizeRange(int min
, int max
)
65 m_previewSizeSlider
->setRange(min
, max
);
68 void IconSizeGroupBox::setDefaultSizeValue(int value
)
70 m_defaultSizeSlider
->setValue(value
);
73 int IconSizeGroupBox::defaultSizeValue() const
75 return m_defaultSizeSlider
->value();
78 void IconSizeGroupBox::setPreviewSizeValue(int value
)
80 m_previewSizeSlider
->setValue(value
);
83 int IconSizeGroupBox::previewSizeValue() const
85 return m_previewSizeSlider
->value();
88 #include "iconsizegroupbox.moc"