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}
 
KisOptionButtonStrip * optionButtonStripAction {nullptr}
 
KisOptionButtonStrip * optionButtonStripMode {nullptr}
 
KisOptionButtonStrip * optionButtonStripReference {nullptr}
 
KisSelectionOptions * q
 
KisSliderSpinBox * sliderFeatherSelection {nullptr}
 
KisSliderSpinBox * sliderGrowSelection {nullptr}
 
KisColorLabelSelectorWidget * widgetLabels {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 102 of file kis_selection_options.cc.

103 {
104 switch (index) {
105 case 0:
106 return CurrentLayer;
107 case 1:
108 return CurrentGroup;
109 case 2:
110 return AllLayers;
111 case 3:
112 return ColorLabeledLayers;
113 default:
114 return CurrentLayer;
115 }
116 }

References KisSelectionOptions::AllLayers, KisSelectionOptions::ColorLabeledLayers, KisSelectionOptions::CurrentGroup, 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 128 of file kis_selection_options.cc.

129 {
130 if (!checked) {
131 return;
132 }
133 Q_EMIT q->actionChanged(buttonIndexToAction(index));
134 }
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 118 of file kis_selection_options.cc.

119 {
120 if (!checked) {
121 return;
122 }
123 const SelectionMode mode = buttonIndexToMode(index);
125 Q_EMIT q->modeChanged(mode);
126 }
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 136 of file kis_selection_options.cc.

137 {
138 if (!checked) {
139 return;
140 }
143 KisOptionCollectionWidgetWithHeader *sectionReference =
145 "sectionReference");
146 sectionReference->setWidgetVisible("widgetLabels",
149
151 }
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 CurrentGroup:
92 return 1;
93 case AllLayers:
94 return 2;
96 return 3;
97 default:
98 return 0;
99 }
100 }

References KisSelectionOptions::action(), KisSelectionOptions::AllLayers, KisSelectionOptions::ColorLabeledLayers, KisSelectionOptions::CurrentGroup, 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: