163 m_d->optionButtonStripMode->addButton(
165 m_d->optionButtonStripMode->button(0)->setChecked(
true);
170 m_d->optionButtonStripAction->addButton(
172 m_d->optionButtonStripAction->addButton(
174 m_d->optionButtonStripAction->addButton(
176 m_d->optionButtonStripAction->addButton(
178 m_d->optionButtonStripAction->button(0)->setChecked(
true);
180 m_d->checkBoxSelectionActionsPanel =
new QCheckBox(i18n(
"Enable Selection Actions Bar"));
181 m_d->checkBoxSelectionActionsPanel->setToolTip(
182 i18n(
"When enabled, any selections will produce a small floating panel of useful selection-related actions."));
187 m_d->checkBoxSelectionActionsPanel->setCheckState(Qt::CheckState::Checked);
189 m_d->checkBoxSelectionActionsPanel->setCheckState(Qt::CheckState::Unchecked);
192 m_d->checkBoxMoveSelectedContent =
new QCheckBox(
193 i18nc(
"The move-selected-content checkbox in selection tool options",
194 "Move Selected Content"));
196 m_d->checkBoxAntiAliasSelection =
new QCheckBox(
197 i18nc(
"The anti-alias checkbox in fill tool options",
"Anti-aliasing"));
200 m_d->sliderGrowSelection->setPrefix(
201 i18nc(
"The 'grow/shrink' spinbox prefix in selection tools options",
204 m_d->sliderGrowSelection->setSoftRange(-40, 40);
205 m_d->sliderGrowSelection->setSuffix(i18n(
" px"));
206 m_d->buttonStopGrowingAtDarkestPixel =
new QToolButton;
207 m_d->buttonStopGrowingAtDarkestPixel->setAutoRaise(
true);
208 m_d->buttonStopGrowingAtDarkestPixel->setCheckable(
true);
210 containerGrowSelection->
appendWidget(
"sliderGrowSelection",
m_d->sliderGrowSelection);
211 containerGrowSelection->
appendWidget(
"buttonStopGrowingAtDarkestPixel",
m_d->buttonStopGrowingAtDarkestPixel);
213 containerGrowSelection->
setWidgetVisible(
"buttonStopGrowingAtDarkestPixel",
false);
215 m_d->sliderFeatherSelection->setPrefix(
216 i18nc(
"The 'feather' spinbox prefix in selection tools options",
219 m_d->sliderFeatherSelection->setSoftRange(0, 40);
220 m_d->sliderFeatherSelection->setSuffix(i18n(
" px"));
225 m_d->optionButtonStripReference->addButton(
227 m_d->optionButtonStripReference->addButton(
230 m_d->optionButtonStripReference->button(0)->setChecked(
true);
233 m_d->widgetLabels->setButtonSize(20);
234 m_d->widgetLabels->setButtonWrapEnabled(
true);
235 m_d->widgetLabels->setMouseDragEnabled(
true);
238 m_d->optionButtonStripMode->button(0)->setToolTip(
239 i18nc(
"@info:tooltip",
"Pixel Selection"));
240 m_d->optionButtonStripMode->button(1)->setToolTip(
241 i18nc(
"@info:tooltip",
"Vector Selection"));
243 m_d->optionButtonStripAction->button(0)->setToolTip(
244 i18nc(
"@info:tooltip",
"Replace"));
245 m_d->optionButtonStripAction->button(1)->setToolTip(
246 i18nc(
"@info:tooltip",
"Intersect"));
247 m_d->optionButtonStripAction->button(2)->setToolTip(
248 i18nc(
"@info:tooltip",
"Add"));
249 m_d->optionButtonStripAction->button(3)->setToolTip(
250 i18nc(
"@info:tooltip",
"Subtract"));
251 m_d->optionButtonStripAction->button(4)->setToolTip(
252 i18nc(
"@info:tooltip",
"Symmetric Difference"));
254 m_d->checkBoxMoveSelectedContent->setToolTip(
255 i18nc(
"@info:tooltip",
"Move Selected Content"));
257 m_d->checkBoxAntiAliasSelection->setToolTip(
258 i18n(
"Smooths the edges of the selection"));
259 m_d->sliderGrowSelection->setToolTip(
260 i18n(
"Grow or shrink the selection by the set amount"));
261 m_d->buttonStopGrowingAtDarkestPixel->setToolTip(
262 i18n(
"Stop growing at the darkest and/or most opaque pixels"));
263 m_d->sliderFeatherSelection->setToolTip(
264 i18n(
"Blur the selection by the set amount"));
266 m_d->optionButtonStripReference->button(0)->setToolTip(
267 i18n(
"Select regions found from the active layer"));
268 m_d->optionButtonStripReference->button(1)->setToolTip(
269 i18n(
"Select regions found from the active group"));
270 m_d->optionButtonStripReference->button(2)->setToolTip(
271 i18n(
"Select regions found from the merging of all layers"));
272 m_d->optionButtonStripReference->button(3)->setToolTip(
273 i18n(
"Select regions found from the merging of layers with specific color labels"));
280 i18nc(
"The 'mode' section label in selection tools options",
287 i18nc(
"The 'action' section label in selection tools options",
294 i18nc(
"The 'reference' section label in selection tools options",
303 appendWidget(
"checkBoxMoveSelectedContent",
m_d->checkBoxMoveSelectedContent);
307 i18nc(
"The 'adjustments' section label in selection tools options",
309 sectionAdjustments->
appendWidget(
"checkBoxAntiAliasSelection",
310 m_d->checkBoxAntiAliasSelection);
311 sectionAdjustments->
appendWidget(
"containerGrowSelection", containerGrowSelection);
313 m_d->sliderFeatherSelection);
318 connect(
m_d->optionButtonStripMode,
321 [
this](
int i,
int c) {
322 m_d->on_optionButtonStripMode_buttonToggled(i, c);
324 connect(
m_d->optionButtonStripAction,
327 [
this](
int i,
int c) {
328 m_d->on_optionButtonStripAction_buttonToggled(i, c);
330 connect(
m_d->checkBoxMoveSelectedContent,
331 SIGNAL(toggled(
bool)),
333 connect(
m_d->checkBoxAntiAliasSelection,
334 SIGNAL(toggled(
bool)),
336 connect(
m_d->sliderGrowSelection,
337 SIGNAL(valueChanged(
int)),
339 connect(
m_d->buttonStopGrowingAtDarkestPixel,
340 SIGNAL(toggled(
bool)),
342 connect(
m_d->sliderFeatherSelection,
343 SIGNAL(valueChanged(
int)),
345 connect(
m_d->optionButtonStripReference,
348 [
this](
int i,
int c) {
349 m_d->on_optionButtonStripReference_buttonToggled(i, c);
351 connect(
m_d->widgetLabels,
352 SIGNAL(selectionChanged()),
356 connect(
m_d->checkBoxSelectionActionsPanel,
357 SIGNAL(toggled(
bool)),