49 m_d->chkLod =
new QCheckBox(
this);
51 m_d->btnLod =
new QPushButton(
this);
52 m_d->btnLod->setFlat(
true);
58 m_d->thresholdMenu.reset(
new QMenu());
59 m_d->thresholdMenu->addSection(i18n(
"Enable after:"));
61 m_d->btnLod->setContextMenuPolicy(Qt::CustomContextMenu);
62 connect(
m_d->btnLod, SIGNAL(customContextMenuRequested(QPoint)),
69 m_d->thresholdSlider->setValue(100);
70 m_d->thresholdSlider->setSingleStep(1);
71 m_d->thresholdSlider->setExponentRatio(3.0);
72 m_d->thresholdSlider->setSuffix(i18n(
" px"));
73 m_d->thresholdSlider->setBlockUpdateSignalOnDrag(
true);
75 QWidgetAction *sliderAction =
new QWidgetAction(
this);
76 sliderAction->setDefaultWidget(
m_d->thresholdSlider);
78 m_d->thresholdMenu->addAction(sliderAction);
81 QHBoxLayout *layout =
new QHBoxLayout(
this);
82 layout->setSpacing(0);
83 layout->addWidget(
m_d->chkLod);
84 layout->addWidget(
m_d->btnLod);
125 QString blockersText;
127 blockersText.append(
"<li>");
128 blockersText.append(
id.name());
129 blockersText.append(
"</li>");
132 toolTip = i18nc(
"@info:tooltip",
133 "<p>Instant Preview Mode is "
134 "disabled by the following options:"
135 "<ul>%1</ul></p>", blockersText);
138 const qreal effectiveBrushSize =
m_d->model->effectiveBrushSize.get();
139 const qreal sizeThreshold =
m_d->model->lodSizeThreshold();
141 toolTip = i18nc(
"@info:tooltip",
142 "<p>Instant Preview Mode is "
143 "disabled by instant preview threshold. "
144 "Please right-click here to change the threshold"
145 "<ul><li>Brush size %1</li>"
146 "<li>Threshold: %2</li></ul></p>",
147 effectiveBrushSize, sizeThreshold);
151 QString limitationsText;
153 limitationsText.append(
"<li>");
154 limitationsText.append(
id.name());
155 limitationsText.append(
"</li>");
158 toolTip = i18nc(
"@info:tooltip",
159 "<p>Instant Preview may look different "
160 "from the final result. In case of troubles "
161 "try disabling the following options:"
162 "<ul>%1</ul></p>", limitationsText);
164 toolTip = i18nc(
"@info:tooltip",
"<p>Instant Preview Mode is available</p>");
168 i18n(
"(Instant Preview)*") : i18n(
"Instant Preview");
176 m_d->btnLod->setFont(font);
177 m_d->btnLod->setText(text);
178 m_d->btnLod->setToolTip(toolTip);
187 m_d->chkLod->setChecked(
false);
190 m_d->chkLod->setChecked(isLodUserAllowed);