7
7
* Description : setup Image Editor tab.
9
* Copyright (C) 2004-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
9
* Copyright (C) 2004-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
11
* This program is free software; you can redistribute it
12
12
* and/or modify it under the terms of the GNU General
109
109
RDoubleNumInput* underExposurePcents;
110
110
RDoubleNumInput* overExposurePcents;
112
const QString SetupEditor::SetupEditorPriv::configGroupName("ImageViewer Settings");
113
const QString SetupEditor::SetupEditorPriv::configUseThemeBackgroundColorEntry("UseThemeBackgroundColor");
114
const QString SetupEditor::SetupEditorPriv::configBackgroundColorEntry("BackgroundColor");
115
const QString SetupEditor::SetupEditorPriv::configFullScreenHideToolBarEntry("FullScreen Hide ToolBar");
116
const QString SetupEditor::SetupEditorPriv::configFullScreenHideThumbBarEntry("FullScreenHideThumbBar");
117
const QString SetupEditor::SetupEditorPriv::configUnderExposureColorEntry("UnderExposureColor");
118
const QString SetupEditor::SetupEditorPriv::configOverExposureColorEntry("OverExposureColor");
119
const QString SetupEditor::SetupEditorPriv::configUnderExposurePercentsEntry("UnderExposurePercentsEntry");
120
const QString SetupEditor::SetupEditorPriv::configOverExposurePercentsEntry("OverExposurePercentsEntry");
121
const QString SetupEditor::SetupEditorPriv::configExpoIndicatorModeEntry("ExpoIndicatorMode");
113
const QString SetupEditor::Private::configGroupName("ImageViewer Settings");
114
const QString SetupEditor::Private::configUseThemeBackgroundColorEntry("UseThemeBackgroundColor");
115
const QString SetupEditor::Private::configBackgroundColorEntry("BackgroundColor");
116
const QString SetupEditor::Private::configFullScreenHideToolBarEntry("FullScreen Hide ToolBar");
117
const QString SetupEditor::Private::configFullScreenHideThumbBarEntry("FullScreenHideThumbBar");
118
const QString SetupEditor::Private::configUnderExposureColorEntry("UnderExposureColor");
119
const QString SetupEditor::Private::configOverExposureColorEntry("OverExposureColor");
120
const QString SetupEditor::Private::configUnderExposurePercentsEntry("UnderExposurePercentsEntry");
121
const QString SetupEditor::Private::configOverExposurePercentsEntry("OverExposurePercentsEntry");
122
const QString SetupEditor::Private::configExpoIndicatorModeEntry("ExpoIndicatorMode");
123
124
// --------------------------------------------------------
125
SetupEditor::SetupEditor(QWidget* parent)
126
: QScrollArea(parent), d(new SetupEditorPriv)
126
SetupEditor::SetupEditor(QWidget* const parent)
127
: QScrollArea(parent), d(new Private)
128
129
QWidget* panel = new QWidget(viewport());
129
130
setWidget(panel);
136
137
QGroupBox* interfaceOptionsGroup = new QGroupBox(i18n("Interface Options"), panel);
137
138
QVBoxLayout* gLayout1 = new QVBoxLayout(interfaceOptionsGroup);
139
d->themebackgroundColor = new QCheckBox(i18n("&Use theme background color"),
140
interfaceOptionsGroup);
140
d->themebackgroundColor = new QCheckBox(i18n("&Use theme background color"), interfaceOptionsGroup);
142
142
d->themebackgroundColor->setWhatsThis(i18n("Enable this option to use the background theme "
143
143
"color in the image editor area."));
145
d->colorBox = new KHBox(interfaceOptionsGroup);
146
QLabel* backgroundColorlabel = new QLabel(i18n("&Background color:"), d->colorBox);
147
d->backgroundColor = new KColorButton(d->colorBox);
145
d->colorBox = new KHBox(interfaceOptionsGroup);
146
QLabel* backgroundColorlabel = new QLabel(i18n("&Background color:"), d->colorBox);
147
d->backgroundColor = new KColorButton(d->colorBox);
148
148
backgroundColorlabel->setBuddy(d->backgroundColor);
149
149
d->backgroundColor->setWhatsThis(i18n("Customize the background color to use "
150
150
"in the image editor area."));
152
d->hideToolBar = new QCheckBox(i18n("H&ide toolbar in fullscreen mode"), interfaceOptionsGroup);
153
d->hideThumbBar = new QCheckBox(i18n("Hide &thumbbar in fullscreen mode"), interfaceOptionsGroup);
152
d->hideToolBar = new QCheckBox(i18n("H&ide toolbar in fullscreen mode"), interfaceOptionsGroup);
153
d->hideThumbBar = new QCheckBox(i18n("Hide &thumbbar in fullscreen mode"), interfaceOptionsGroup);
155
155
gLayout1->addWidget(d->themebackgroundColor);
156
156
gLayout1->addWidget(d->colorBox);
162
162
// --------------------------------------------------------
164
QGroupBox* exposureOptionsGroup = new QGroupBox(i18n("Exposure Indicators"), panel);
165
QVBoxLayout* gLayout2 = new QVBoxLayout(exposureOptionsGroup);
164
QGroupBox* exposureOptionsGroup = new QGroupBox(i18n("Exposure Indicators"), panel);
165
QVBoxLayout* gLayout2 = new QVBoxLayout(exposureOptionsGroup);
167
KHBox* underExpoBox = new KHBox(exposureOptionsGroup);
168
QLabel* underExpoColorlabel = new QLabel(i18n("&Under-exposure color:"), underExpoBox);
169
d->underExposureColor = new KColorButton(underExpoBox);
167
KHBox* underExpoBox = new KHBox(exposureOptionsGroup);
168
QLabel* underExpoColorlabel = new QLabel(i18n("&Under-exposure color:"), underExpoBox);
169
d->underExposureColor = new KColorButton(underExpoBox);
170
170
underExpoColorlabel->setBuddy(d->underExposureColor);
171
171
d->underExposureColor->setWhatsThis(i18n("Customize color used in image editor to identify "
172
172
"under-exposed pixels."));
174
KHBox* underPcentBox = new KHBox(exposureOptionsGroup);
175
QLabel* underExpoPcentlabel = new QLabel(i18n("Under-exposure percents:"), underPcentBox);
176
d->underExposurePcents = new RDoubleNumInput(underPcentBox);
174
KHBox* underPcentBox = new KHBox(exposureOptionsGroup);
175
QLabel* underExpoPcentlabel = new QLabel(i18n("Under-exposure percents:"), underPcentBox);
176
d->underExposurePcents = new RDoubleNumInput(underPcentBox);
177
177
d->underExposurePcents->setDecimals(1);
178
178
d->underExposurePcents->input()->setRange(0.1, 5.0, 0.1, true);
179
179
d->underExposurePcents->setDefaultValue(1.0);
181
181
d->underExposurePcents->setWhatsThis(i18n("Adjust the percents of the bottom of image histogram "
182
182
"which will be used to check under exposed pixels."));
184
KHBox* overExpoBox = new KHBox(exposureOptionsGroup);
185
QLabel* overExpoColorlabel = new QLabel(i18n("&Over-exposure color:"), overExpoBox);
186
d->overExposureColor = new KColorButton(overExpoBox);
184
KHBox* overExpoBox = new KHBox(exposureOptionsGroup);
185
QLabel* overExpoColorlabel = new QLabel(i18n("&Over-exposure color:"), overExpoBox);
186
d->overExposureColor = new KColorButton(overExpoBox);
187
187
overExpoColorlabel->setBuddy(d->overExposureColor);
188
188
d->overExposureColor->setWhatsThis(i18n("Customize color used in image editor to identify "
189
189
"over-exposed pixels."));
191
KHBox* overPcentBox = new KHBox(exposureOptionsGroup);
192
QLabel* overExpoPcentlabel = new QLabel(i18n("Over-exposure percents:"), overPcentBox);
193
d->overExposurePcents = new RDoubleNumInput(overPcentBox);
191
KHBox* overPcentBox = new KHBox(exposureOptionsGroup);
192
QLabel* overExpoPcentlabel = new QLabel(i18n("Over-exposure percents:"), overPcentBox);
193
d->overExposurePcents = new RDoubleNumInput(overPcentBox);
194
194
d->overExposurePcents->setDecimals(1);
195
195
d->overExposurePcents->input()->setRange(0.1, 5.0, 0.1, true);
196
196
d->overExposurePcents->setDefaultValue(1.0);
198
198
d->overExposurePcents->setWhatsThis(i18n("Adjust the percents of the top of image histogram "
199
199
"which will be used to check over exposed pixels."));
201
d->expoIndicatorMode = new QCheckBox(i18n("Indicate exposure as pure color"), exposureOptionsGroup);
201
d->expoIndicatorMode = new QCheckBox(i18n("Indicate exposure as pure color"), exposureOptionsGroup);
202
202
d->overExposureColor->setWhatsThis(i18n("If this option is enabled, over- and under-exposure indicators will be displayed "
203
203
"only when pure white and pure black color matches, as all color components match "
204
204
"the condition in the same time. "
214
214
if (!d->preview.isNull())
216
d->expoPreviewHisto->updateData(d->preview.bits(), d->preview.width(),
217
d->preview.height(), d->preview.sixteenBit());
216
d->expoPreviewHisto->updateData(d->preview);
220
219
d->expoPreviewHisto->setChannelType(ColorChannels);