Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSelectionOptions::Private Class Reference

Public Member Functions

int actionToButtonIndex (SelectionAction action) const
 
SelectionAction buttonIndexToAction (int index) const
 
SelectionMode buttonIndexToMode (int index) const
 
ReferenceLayers buttonIndexToReferenceLayers (int index) const
 
int modeToButtonIndex (SelectionMode mode) const
 
void on_optionButtonStripAction_buttonToggled (int index, bool checked)
 
void on_optionButtonStripMode_buttonToggled (int index, bool checked)
 
void on_optionButtonStripReference_buttonToggled (int index, bool checked)
 
int referenceLayersToButtonIndex (ReferenceLayers action) const
 

Public Attributes

QToolButton * buttonStopGrowingAtDarkestPixel {nullptr}
 
QCheckBox * checkBoxAntiAliasSelection {nullptr}
 
QCheckBox * checkBoxMoveSelectedContent {nullptr}
 
QCheckBox * checkBoxSelectionActionsPanel {nullptr}
 
KisOptionButtonStripoptionButtonStripAction {nullptr}
 
KisOptionButtonStripoptionButtonStripMode {nullptr}
 
KisOptionButtonStripoptionButtonStripReference {nullptr}
 
KisSelectionOptionsq
 
KisSliderSpinBoxsliderFeatherSelection {nullptr}
 
KisSliderSpinBoxsliderGrowSelection {nullptr}
 
KisColorLabelSelectorWidgetwidgetLabels {nullptr}
 

Detailed Description

Definition at line 25 of file kis_selection_options.cc.

Member Function Documentation

◆ actionToButtonIndex()

int KisSelectionOptions::Private::actionToButtonIndex ( SelectionAction action) const
inline

Definition at line 50 of file kis_selection_options.cc.

51 {
52 switch (action) {
54 return 0;
56 return 1;
57 case SELECTION_ADD:
58 return 2;
60 return 3;
62 return 4;
63 default:
64 return 0;
65 }
66 }
@ SELECTION_REPLACE
@ SELECTION_INTERSECT
@ SELECTION_SYMMETRICDIFFERENCE
@ SELECTION_SUBTRACT
@ SELECTION_ADD
SelectionAction action() const

References KisSelectionOptions::action(), SELECTION_ADD, SELECTION_INTERSECT, SELECTION_REPLACE, SELECTION_SUBTRACT, and SELECTION_SYMMETRICDIFFERENCE.

◆ buttonIndexToAction()

SelectionAction KisSelectionOptions::Private::buttonIndexToAction ( int index) const
inline

Definition at line 68 of file kis_selection_options.cc.

69 {
70 switch (index) {
71 case 0:
72 return SELECTION_REPLACE;
73 case 1:
75 case 2:
76 return SELECTION_ADD;
77 case 3:
78 return SELECTION_SUBTRACT;
79 case 4:
81 default:
82 return SELECTION_REPLACE;
83 }
84 }

References SELECTION_ADD, SELECTION_INTERSECT, SELECTION_REPLACE, SELECTION_SUBTRACT, and SELECTION_SYMMETRICDIFFERENCE.

◆ buttonIndexToMode()

SelectionMode KisSelectionOptions::Private::buttonIndexToMode ( int index) const
inline

Definition at line 45 of file kis_selection_options.cc.

46 {
47 return index == 0 ? PIXEL_SELECTION : SHAPE_PROTECTION;
48 }
@ PIXEL_SELECTION
@ SHAPE_PROTECTION

References PIXEL_SELECTION, and SHAPE_PROTECTION.

◆ buttonIndexToReferenceLayers()

ReferenceLayers KisSelectionOptions::Private::buttonIndexToReferenceLayers ( int index) const
inline

Definition at line 100 of file kis_selection_options.cc.

101 {
102 switch (index) {
103 case 0:
104 return CurrentLayer;
105 case 1:
106 return AllLayers;
107 case 2:
108 return ColorLabeledLayers;
109 default:
110 return CurrentLayer;
111 }
112 }

References KisSelectionOptions::AllLayers, KisSelectionOptions::ColorLabeledLayers, and KisSelectionOptions::CurrentLayer.

◆ modeToButtonIndex()

int KisSelectionOptions::Private::modeToButtonIndex ( SelectionMode mode) const
inline

Definition at line 40 of file kis_selection_options.cc.

41 {
42 return mode == PIXEL_SELECTION ? 0 : 1;
43 }
SelectionMode mode() const

References KisSelectionOptions::mode(), and PIXEL_SELECTION.

◆ on_optionButtonStripAction_buttonToggled()

void KisSelectionOptions::Private::on_optionButtonStripAction_buttonToggled ( int index,
bool checked )
inline

Definition at line 124 of file kis_selection_options.cc.

125 {
126 if (!checked) {
127 return;
128 }
129 Q_EMIT q->actionChanged(buttonIndexToAction(index));
130 }
SelectionAction buttonIndexToAction(int index) const
void actionChanged(SelectionAction action)

References KisSelectionOptions::actionChanged(), buttonIndexToAction(), and q.

◆ on_optionButtonStripMode_buttonToggled()

void KisSelectionOptions::Private::on_optionButtonStripMode_buttonToggled ( int index,
bool checked )
inline

Definition at line 114 of file kis_selection_options.cc.

115 {
116 if (!checked) {
117 return;
118 }
119 const SelectionMode mode = buttonIndexToMode(index);
121 Q_EMIT q->modeChanged(mode);
122 }
SelectionMode
SelectionMode buttonIndexToMode(int index) const
void setAdjustmentsSectionVisible(bool visible)
void modeChanged(SelectionMode mode)

References buttonIndexToMode(), KisSelectionOptions::mode(), KisSelectionOptions::modeChanged(), PIXEL_SELECTION, q, and KisSelectionOptions::setAdjustmentsSectionVisible().

◆ on_optionButtonStripReference_buttonToggled()

void KisSelectionOptions::Private::on_optionButtonStripReference_buttonToggled ( int index,
bool checked )
inline

Definition at line 132 of file kis_selection_options.cc.

133 {
134 if (!checked) {
135 return;
136 }
139 KisOptionCollectionWidgetWithHeader *sectionReference =
141 "sectionReference");
142 sectionReference->setWidgetVisible("widgetLabels",
145
147 }
Wrapper class around a KisOptionCollectionWidget that also provide a header with a title label and an...
void setWidgetVisible(int index, bool visible)
Set the visibility of the widget that is at the given position.
T widgetAs(int index) const
Get the widget that is at the given position casted to some other class.
ReferenceLayers buttonIndexToReferenceLayers(int index) const
ReferenceLayers referenceLayers() const
void referenceLayersChanged(ReferenceLayers referenceLayers)

References buttonIndexToReferenceLayers(), KisSelectionOptions::ColorLabeledLayers, q, KisSelectionOptions::referenceLayers(), KisSelectionOptions::referenceLayersChanged(), KisOptionCollectionWidgetWithHeader::setWidgetVisible(), and KisOptionCollectionWidget::widgetAs().

◆ referenceLayersToButtonIndex()

int KisSelectionOptions::Private::referenceLayersToButtonIndex ( ReferenceLayers action) const
inline

Definition at line 86 of file kis_selection_options.cc.

87 {
88 switch (action) {
89 case CurrentLayer:
90 return 0;
91 case AllLayers:
92 return 1;
94 return 2;
95 default:
96 return 0;
97 }
98 }

References KisSelectionOptions::action(), KisSelectionOptions::AllLayers, KisSelectionOptions::ColorLabeledLayers, and KisSelectionOptions::CurrentLayer.

Member Data Documentation

◆ buttonStopGrowingAtDarkestPixel

QToolButton* KisSelectionOptions::Private::buttonStopGrowingAtDarkestPixel {nullptr}

Definition at line 34 of file kis_selection_options.cc.

34{nullptr};

◆ checkBoxAntiAliasSelection

QCheckBox* KisSelectionOptions::Private::checkBoxAntiAliasSelection {nullptr}

Definition at line 32 of file kis_selection_options.cc.

32{nullptr};

◆ checkBoxMoveSelectedContent

QCheckBox* KisSelectionOptions::Private::checkBoxMoveSelectedContent {nullptr}

Definition at line 31 of file kis_selection_options.cc.

31{nullptr};

◆ checkBoxSelectionActionsPanel

QCheckBox* KisSelectionOptions::Private::checkBoxSelectionActionsPanel {nullptr}

Definition at line 38 of file kis_selection_options.cc.

38{nullptr};

◆ optionButtonStripAction

KisOptionButtonStrip* KisSelectionOptions::Private::optionButtonStripAction {nullptr}

Definition at line 30 of file kis_selection_options.cc.

30{nullptr};

◆ optionButtonStripMode

KisOptionButtonStrip* KisSelectionOptions::Private::optionButtonStripMode {nullptr}

Definition at line 29 of file kis_selection_options.cc.

29{nullptr};

◆ optionButtonStripReference

KisOptionButtonStrip* KisSelectionOptions::Private::optionButtonStripReference {nullptr}

Definition at line 36 of file kis_selection_options.cc.

36{nullptr};

◆ q

KisSelectionOptions* KisSelectionOptions::Private::q

Definition at line 28 of file kis_selection_options.cc.

◆ sliderFeatherSelection

KisSliderSpinBox* KisSelectionOptions::Private::sliderFeatherSelection {nullptr}

Definition at line 35 of file kis_selection_options.cc.

35{nullptr};

◆ sliderGrowSelection

KisSliderSpinBox* KisSelectionOptions::Private::sliderGrowSelection {nullptr}

Definition at line 33 of file kis_selection_options.cc.

33{nullptr};

◆ widgetLabels

KisColorLabelSelectorWidget* KisSelectionOptions::Private::widgetLabels {nullptr}

Definition at line 37 of file kis_selection_options.cc.

37{nullptr};

The documentation for this class was generated from the following file: