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 * 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 49 of file kis_selection_options.cc.

50 {
51 switch (action) {
53 return 0;
55 return 1;
56 case SELECTION_ADD:
57 return 2;
59 return 3;
61 return 4;
62 default:
63 return 0;
64 }
65 }
@ 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 67 of file kis_selection_options.cc.

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

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

◆ buttonIndexToMode()

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

Definition at line 44 of file kis_selection_options.cc.

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

References PIXEL_SELECTION, and SHAPE_PROTECTION.

◆ buttonIndexToReferenceLayers()

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

Definition at line 99 of file kis_selection_options.cc.

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

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

◆ modeToButtonIndex()

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

Definition at line 39 of file kis_selection_options.cc.

40 {
41 return mode == PIXEL_SELECTION ? 0 : 1;
42 }
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 123 of file kis_selection_options.cc.

124 {
125 if (!checked) {
126 return;
127 }
128 Q_EMIT q->actionChanged(buttonIndexToAction(index));
129 }
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 113 of file kis_selection_options.cc.

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

132 {
133 if (!checked) {
134 return;
135 }
138 KisOptionCollectionWidgetWithHeader *sectionReference =
140 "sectionReference");
141 sectionReference->setWidgetVisible("widgetLabels",
144
146 }
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 85 of file kis_selection_options.cc.

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

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

Member Data Documentation

◆ buttonStopGrowingAtDarkestPixel

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

Definition at line 33 of file kis_selection_options.cc.

33{nullptr};

◆ checkBoxAntiAliasSelection

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

Definition at line 31 of file kis_selection_options.cc.

31{nullptr};

◆ checkBoxSelectionActionsPanel

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

Definition at line 37 of file kis_selection_options.cc.

37{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 35 of file kis_selection_options.cc.

35{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 34 of file kis_selection_options.cc.

34{nullptr};

◆ sliderGrowSelection

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

Definition at line 32 of file kis_selection_options.cc.

32{nullptr};

◆ widgetLabels

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

Definition at line 36 of file kis_selection_options.cc.

36{nullptr};

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