159 m_d->optionButtonStripMode->addButton(
161 m_d->optionButtonStripMode->button(0)->setChecked(
true);
166 m_d->optionButtonStripAction->addButton(
168 m_d->optionButtonStripAction->addButton(
170 m_d->optionButtonStripAction->addButton(
172 m_d->optionButtonStripAction->addButton(
174 m_d->optionButtonStripAction->button(0)->setChecked(
true);
176 m_d->checkBoxSelectionActionsPanel =
new QCheckBox(i18n(
"Enable Selection Actions Bar"));
177 m_d->checkBoxSelectionActionsPanel->setToolTip(
178 i18n(
"When enabled, any selections will produce a small floating panel of useful selection-related actions."));
183 m_d->checkBoxSelectionActionsPanel->setCheckState(Qt::CheckState::Checked);
185 m_d->checkBoxSelectionActionsPanel->setCheckState(Qt::CheckState::Unchecked);
188 m_d->checkBoxMoveSelectedContent =
new QCheckBox(
189 i18nc(
"The move-selected-content checkbox in selection tool options",
190 "Move Selected Content"));
192 m_d->checkBoxAntiAliasSelection =
new QCheckBox(
193 i18nc(
"The anti-alias checkbox in fill tool options",
"Anti-aliasing"));
196 m_d->sliderGrowSelection->setPrefix(
197 i18nc(
"The 'grow/shrink' spinbox prefix in selection tools options",
200 m_d->sliderGrowSelection->setSoftRange(-40, 40);
201 m_d->sliderGrowSelection->setSuffix(i18n(
" px"));
202 m_d->buttonStopGrowingAtDarkestPixel =
new QToolButton;
203 m_d->buttonStopGrowingAtDarkestPixel->setAutoRaise(
true);
204 m_d->buttonStopGrowingAtDarkestPixel->setCheckable(
true);
206 containerGrowSelection->
appendWidget(
"sliderGrowSelection",
m_d->sliderGrowSelection);
207 containerGrowSelection->
appendWidget(
"buttonStopGrowingAtDarkestPixel",
m_d->buttonStopGrowingAtDarkestPixel);
209 containerGrowSelection->
setWidgetVisible(
"buttonStopGrowingAtDarkestPixel",
false);
211 m_d->sliderFeatherSelection->setPrefix(
212 i18nc(
"The 'feather' spinbox prefix in selection tools options",
215 m_d->sliderFeatherSelection->setSoftRange(0, 40);
216 m_d->sliderFeatherSelection->setSuffix(i18n(
" px"));
221 m_d->optionButtonStripReference->addButton(
224 m_d->optionButtonStripReference->button(0)->setChecked(
true);
227 m_d->widgetLabels->setButtonSize(20);
228 m_d->widgetLabels->setButtonWrapEnabled(
true);
229 m_d->widgetLabels->setMouseDragEnabled(
true);
232 m_d->optionButtonStripMode->button(0)->setToolTip(
233 i18nc(
"@info:tooltip",
"Pixel Selection"));
234 m_d->optionButtonStripMode->button(1)->setToolTip(
235 i18nc(
"@info:tooltip",
"Vector Selection"));
237 m_d->optionButtonStripAction->button(0)->setToolTip(
238 i18nc(
"@info:tooltip",
"Replace"));
239 m_d->optionButtonStripAction->button(1)->setToolTip(
240 i18nc(
"@info:tooltip",
"Intersect"));
241 m_d->optionButtonStripAction->button(2)->setToolTip(
242 i18nc(
"@info:tooltip",
"Add"));
243 m_d->optionButtonStripAction->button(3)->setToolTip(
244 i18nc(
"@info:tooltip",
"Subtract"));
245 m_d->optionButtonStripAction->button(4)->setToolTip(
246 i18nc(
"@info:tooltip",
"Symmetric Difference"));
248 m_d->checkBoxMoveSelectedContent->setToolTip(
249 i18nc(
"@info:tooltip",
"Move Selected Content"));
251 m_d->checkBoxAntiAliasSelection->setToolTip(
252 i18n(
"Smooths the edges of the selection"));
253 m_d->sliderGrowSelection->setToolTip(
254 i18n(
"Grow or shrink the selection by the set amount"));
255 m_d->buttonStopGrowingAtDarkestPixel->setToolTip(
256 i18n(
"Stop growing at the darkest and/or most opaque pixels"));
257 m_d->sliderFeatherSelection->setToolTip(
258 i18n(
"Blur the selection by the set amount"));
260 m_d->optionButtonStripReference->button(0)->setToolTip(
261 i18n(
"Select regions found from the active layer"));
262 m_d->optionButtonStripReference->button(1)->setToolTip(
263 i18n(
"Select regions found from the merging of all layers"));
264 m_d->optionButtonStripReference->button(2)->setToolTip(
265 i18n(
"Select regions found from the merging of layers with specific color labels"));
272 i18nc(
"The 'mode' section label in selection tools options",
279 i18nc(
"The 'action' section label in selection tools options",
286 i18nc(
"The 'reference' section label in selection tools options",
294 appendWidget(
"checkBoxMoveSelectedContent",
m_d->checkBoxMoveSelectedContent);
299 i18nc(
"The 'adjustments' section label in selection tools options",
301 sectionAdjustments->
appendWidget(
"checkBoxAntiAliasSelection",
302 m_d->checkBoxAntiAliasSelection);
303 sectionAdjustments->
appendWidget(
"containerGrowSelection", containerGrowSelection);
305 m_d->sliderFeatherSelection);
310 connect(
m_d->optionButtonStripMode,
312 [
this](
int i,
int c) {
313 m_d->on_optionButtonStripMode_buttonToggled(i, c);
315 connect(
m_d->optionButtonStripAction,
317 [
this](
int i,
int c) {
318 m_d->on_optionButtonStripAction_buttonToggled(i, c);
320 connect(
m_d->checkBoxMoveSelectedContent,
321 SIGNAL(toggled(
bool)),
323 connect(
m_d->checkBoxAntiAliasSelection,
324 SIGNAL(toggled(
bool)),
326 connect(
m_d->sliderGrowSelection,
327 SIGNAL(valueChanged(
int)),
329 connect(
m_d->buttonStopGrowingAtDarkestPixel,
330 SIGNAL(toggled(
bool)),
332 connect(
m_d->sliderFeatherSelection,
333 SIGNAL(valueChanged(
int)),
335 connect(
m_d->optionButtonStripReference,
337 [
this](
int i,
int c) {
338 m_d->on_optionButtonStripReference_buttonToggled(i, c);
340 connect(
m_d->widgetLabels,
341 SIGNAL(selectionChanged()),
345 connect(
m_d->checkBoxSelectionActionsPanel,
346 SIGNAL(toggled(
bool)),