45{
46
48 m_d->buttonDistanceMetricChessboard = optionButtonStripDistanceMetric->
addButton(
49 i18nc("Expansion pattern button in propagate colors filter", "Rectangle")
50 );
51 m_d->buttonDistanceMetricCityBlock = optionButtonStripDistanceMetric->
addButton(
52 i18nc("Expansion pattern button in propagate colors filter", "Diamond")
53 );
54 m_d->buttonDistanceMetricEuclidean = optionButtonStripDistanceMetric->
addButton(
55 i18nc("Expansion pattern button in propagate colors filter", "Octagon")
56 );
57 m_d->buttonDistanceMetricEuclidean->setChecked(
true);
58
60 m_d->buttonExpansionModeUnbounded = optionButtonStripExpansionMode->
addButton(
61 i18nc("Expansion distance button in propagate colors filter", "Unrestricted")
62 );
63 m_d->buttonExpansionModeBounded = optionButtonStripExpansionMode->
addButton(
64 i18nc("Expansion distance button in propagate colors filter", "Restricted")
65 );
66 m_d->buttonExpansionModeUnbounded->setChecked(
true);
67
69 m_d->sliderExpansionAmount->
setRange(0.0, 500.0, 2);
70 m_d->sliderExpansionAmount->setSoftMaximum(50.0);
71 m_d->sliderExpansionAmount->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
73 m_d->sliderExpansionAmount,
74 i18nc("The 'maximum distance' slider in propagate colors filter; {n} is the number value, px is the pixels suffix",
75 "Maximum Distance: {n}px")
76 );
77
79 m_d->buttonAlphaChannelModeExpand = optionButtonStripAlphaChannelMode->
addButton(
80 i18nc("Transparency behavior button in propagate colors filter", "Expand")
81 );
82 m_d->buttonAlphaChannelModePreserve = optionButtonStripAlphaChannelMode->
addButton(
83 i18nc("Transparency behavior button in propagate colors filter", "Preserve")
84 );
85 m_d->buttonAlphaChannelModeExpand->setChecked(
true);
86
87
88 m_d->buttonDistanceMetricChessboard->setToolTip(i18n(
"Expand the colors in a rectangular-like way"));
89 m_d->buttonDistanceMetricCityBlock->setToolTip(i18n(
"Expand the colors in a diamond-like way"));
90 m_d->buttonDistanceMetricEuclidean->setToolTip(i18n(
"Expand the colors in a octagonal-like way"));
91
92 m_d->buttonExpansionModeUnbounded->setToolTip(i18n(
"Expand the colors all the way until all transparent regions are filled"));
93 m_d->buttonExpansionModeBounded->setToolTip(i18n(
"Expand the colors only until a specific distance"));
94 m_d->sliderExpansionAmount->setToolTip(i18n(
"Specify the maximum distance to expand when the restricted mode is active"));
95
96 m_d->buttonAlphaChannelModeExpand->setToolTip(i18n(
"Expand the alpha channel as well as the color"));
97 m_d->buttonAlphaChannelModePreserve->setToolTip(i18n(
"Expand only the color, leaving the alpha channel untouched"));
98
99
102
105 i18nc("The 'distance metric' section label in propagate colors filter dialog", "Expansion Pattern")
106 );
108 sectionDistanceMetric->
appendWidget(
"optionButtonStripDistanceMetric", optionButtonStripDistanceMetric);
109 m_d->optionWidget->appendWidget(
"sectionDistanceMetric", sectionDistanceMetric);
110
111 QWidget *separator1 = new QWidget;
112 separator1->setFixedHeight(5);
113 m_d->optionWidget->appendWidget(
"separator1", separator1);
114
117 i18nc("The 'expansion mode' section label in propagate colors filter dialog", "Expansion Distance")
118 );
120 sectionExpansionMode->
appendWidget(
"optionButtonStripExpansionMode", optionButtonStripExpansionMode);
121 sectionExpansionMode->
appendWidget(
"sliderExpansionAmount",
m_d->sliderExpansionAmount);
122 m_d->optionWidget->appendWidget(
"sectionExpansionMode", sectionExpansionMode);
123
124 QWidget *separator2 = new QWidget;
125 separator2->setFixedHeight(5);
126 m_d->optionWidget->appendWidget(
"separator2", separator2);
127
130 i18nc("The 'transparency behavior' section label in propagate colors filter dialog", "Transparency Behavior")
131 );
133 sectionAlphaChannelMode->
appendWidget(
"optionButtonStripAlphaChannelMode", optionButtonStripAlphaChannelMode);
134 m_d->optionWidget->appendWidget(
"sectionAlphaChannelMode", sectionAlphaChannelMode);
135
136 QVBoxLayout *layoutMain = new QVBoxLayout;
137 layoutMain->setContentsMargins(0, 0, 0, 0);
138 layoutMain->setSpacing(0);
139 layoutMain->addWidget(
m_d->optionWidget, 0);
140 layoutMain->addStretch(1);
141
142 setLayout(layoutMain);
143
144 connect(optionButtonStripDistanceMetric,
146 this,
148 connect(optionButtonStripExpansionMode,
150 this,
153 connect(optionButtonStripAlphaChannelMode,
155 this,
157}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
void setText(QSpinBox *spinBox, const QStringView textTemplate)