Changeset View
Changeset View
Standalone View
Standalone View
src/itemviews/palettebriefview.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the * | 15 | * along with this program; if not, write to the * | ||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
18 | *********************************************************************************/ | 18 | *********************************************************************************/ | ||
19 | 19 | | |||
20 | #include "palettebriefview.h" | 20 | #include "palettebriefview.h" | ||
21 | 21 | | |||
22 | #include <QtGui/QLayout> | 22 | #include <QLayout> | ||
23 | #include <QtGui/QHeaderView> | 23 | #include <QHeaderView> | ||
24 | #include <QtGui/QSlider> | 24 | #include <QSlider> | ||
25 | #include <QtGui/QCheckBox> | 25 | #include <QCheckBox> | ||
26 | #include <QPushButton> | ||||
26 | 27 | | |||
27 | #include <KLocalizedString> | 28 | #include <KLocalizedString> | ||
28 | #include <KPushButton> | | |||
29 | #include <KColorCells> | 29 | #include <KColorCells> | ||
30 | 30 | | |||
31 | #include "colorutil.h" | 31 | #include "colorutil.h" | ||
32 | #include "palettemodel.h" | 32 | #include "palettemodel.h" | ||
33 | 33 | | |||
34 | PaletteBriefView::PaletteBriefView(PaletteModel * model, QWidget * parent) | 34 | PaletteBriefView::PaletteBriefView(PaletteModel * model, QWidget * parent) | ||
35 | : QWidget(parent) | 35 | : QWidget(parent) | ||
36 | , m_model(model) | 36 | , m_model(model) | ||
37 | { | 37 | { | ||
38 | m_quickNavigationCheckBox = new QCheckBox(this); | 38 | m_quickNavigationCheckBox = new QCheckBox(this); | ||
39 | m_quickNavigationCheckBox->setText(i18n("Use mouse")); | 39 | m_quickNavigationCheckBox->setText(i18n("Use mouse")); | ||
40 | m_quickNavigationCheckBox->setChecked(false); | 40 | m_quickNavigationCheckBox->setChecked(false); | ||
41 | m_quickNavigationCheckBox->setToolTip(i18n("It will be disabled automatically when clicking over a item")); | 41 | m_quickNavigationCheckBox->setToolTip(i18n("It will be disabled automatically when clicking over a item")); | ||
42 | 42 | | |||
43 | m_showCommentsCheckBox = new QCheckBox(this); | 43 | m_showCommentsCheckBox = new QCheckBox(this); | ||
44 | m_showCommentsCheckBox->setText(i18n("Show comments")); | 44 | m_showCommentsCheckBox->setText(i18n("Show comments")); | ||
45 | m_showCommentsCheckBox->setChecked(false); | 45 | m_showCommentsCheckBox->setChecked(false); | ||
46 | m_showCommentsCheckBox->setToolTip(i18n("If checked, views will be synchronized")); | 46 | m_showCommentsCheckBox->setToolTip(i18n("If checked, views will be synchronized")); | ||
47 | 47 | | |||
48 | m_setColumnSlider = new QSlider(Qt::Horizontal, this); | 48 | m_setColumnSlider = new QSlider(Qt::Horizontal, this); | ||
49 | m_setColumnSlider->setSingleStep(1); | 49 | m_setColumnSlider->setSingleStep(1); | ||
50 | m_setColumnSlider->setPageStep(1); | 50 | m_setColumnSlider->setPageStep(1); | ||
51 | m_setColumnSlider->setTickInterval(1); | 51 | m_setColumnSlider->setTickInterval(1); | ||
52 | 52 | | |||
53 | m_zoomOutButton = new KPushButton(KIcon("zoom-out"), QString(), this); | 53 | m_zoomOutButton = new QPushButton(QIcon::fromTheme("zoom-out"), QString(), this); | ||
54 | 54 | | |||
55 | m_zoomInButton = new KPushButton(KIcon("zoom-in"), QString(), this); | 55 | m_zoomInButton = new QPushButton(QIcon::fromTheme("zoom-in"), QString(), this); | ||
56 | 56 | | |||
57 | m_colorCells = new KColorCells(this, 0, 1); | 57 | m_colorCells = new KColorCells(this, 0, 1); | ||
58 | m_colorCells->setAcceptDrops(false); | 58 | m_colorCells->setAcceptDrops(false); | ||
59 | // WARNING Can't enabled drag support it disable mousetracking ... | 59 | // WARNING Can't enabled drag support it disable mousetracking ... | ||
60 | //m_colorCells->setAcceptDrags(true); | 60 | //m_colorCells->setAcceptDrags(true); | ||
61 | m_colorCells->setMouseTracking(true); | 61 | m_colorCells->setMouseTracking(true); | ||
62 | m_colorCells->setSelectionMode(QAbstractItemView::NoSelection); | 62 | m_colorCells->setSelectionMode(QAbstractItemView::NoSelection); | ||
63 | 63 | | |||
▲ Show 20 Lines • Show All 285 Lines • ▼ Show 20 Line(s) | 347 | { | |||
349 | finalValue = Palette::MIN_PREFERRED_COLUMNS; | 349 | finalValue = Palette::MIN_PREFERRED_COLUMNS; | ||
350 | } | 350 | } | ||
351 | 351 | | |||
352 | m_colorCells->setColumnCount(finalColumns); | 352 | m_colorCells->setColumnCount(finalColumns); | ||
353 | 353 | | |||
354 | m_setColumnSlider->setRange(Palette::MIN_PREFERRED_COLUMNS, finalColumns); | 354 | m_setColumnSlider->setRange(Palette::MIN_PREFERRED_COLUMNS, finalColumns); | ||
355 | m_setColumnSlider->setValue(finalValue); | 355 | m_setColumnSlider->setValue(finalValue); | ||
356 | } | 356 | } | ||
357 | | ||||
358 | #include "palettebriefview.moc" | |