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}
 
KisOptionButtonStripoptionButtonStripAction {nullptr}
 
KisOptionButtonStripoptionButtonStripMode {nullptr}
 
KisOptionButtonStripoptionButtonStripReference {nullptr}
 
KisSelectionOptionsq
 
KisSliderSpinBoxsliderFeatherSelection {nullptr}
 
KisSliderSpinBoxsliderGrowSelection {nullptr}
 
KisColorLabelSelectorWidgetwidgetLabels {nullptr}
 

Detailed Description

Definition at line 29 of file kis_selection_options.cc.

Member Function Documentation

◆ actionToButtonIndex()

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

Definition at line 52 of file kis_selection_options.cc.

53 {
54 switch (action) {
56 return 0;
58 return 1;
59 case SELECTION_ADD:
60 return 2;
62 return 3;
64 return 4;
65 default:
66 return 0;
67 }
68 }
@ 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 70 of file kis_selection_options.cc.

71 {
72 switch (index) {
73 case 0:
74 return SELECTION_REPLACE;
75 case 1:
77 case 2:
78 return SELECTION_ADD;
79 case 3:
80 return SELECTION_SUBTRACT;
81 case 4:
83 default:
84 return SELECTION_REPLACE;
85 }
86 }

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

◆ buttonIndexToMode()

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

Definition at line 47 of file kis_selection_options.cc.

48 {
49 return index == 0 ? PIXEL_SELECTION : SHAPE_PROTECTION;
50 }
@ 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 AllLayers;
109 case 2:
110 return ColorLabeledLayers;
111 default:
112 return CurrentLayer;
113 }
114 }

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

◆ modeToButtonIndex()

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

Definition at line 42 of file kis_selection_options.cc.

43 {
44 return mode == PIXEL_SELECTION ? 0 : 1;
45 }
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 126 of file kis_selection_options.cc.

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

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

135 {
136 if (!checked) {
137 return;
138 }
141 KisOptionCollectionWidgetWithHeader *sectionReference =
143 "sectionReference");
144 sectionReference->setWidgetVisible("widgetLabels",
147
149 }
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 88 of file kis_selection_options.cc.

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

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

Member Data Documentation

◆ buttonStopGrowingAtDarkestPixel

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

Definition at line 37 of file kis_selection_options.cc.

37{nullptr};

◆ checkBoxAntiAliasSelection

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

Definition at line 35 of file kis_selection_options.cc.

35{nullptr};

◆ optionButtonStripAction

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

Definition at line 34 of file kis_selection_options.cc.

34{nullptr};

◆ optionButtonStripMode

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

Definition at line 33 of file kis_selection_options.cc.

33{nullptr};

◆ optionButtonStripReference

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

Definition at line 39 of file kis_selection_options.cc.

39{nullptr};

◆ q

KisSelectionOptions* KisSelectionOptions::Private::q

Definition at line 32 of file kis_selection_options.cc.

◆ sliderFeatherSelection

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

Definition at line 38 of file kis_selection_options.cc.

38{nullptr};

◆ sliderGrowSelection

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

Definition at line 36 of file kis_selection_options.cc.

36{nullptr};

◆ widgetLabels

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

Definition at line 40 of file kis_selection_options.cc.

40{nullptr};

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