48 m_d->chkLod =
new QCheckBox(
this);
50 m_d->btnLod =
new QPushButton(
this);
51 m_d->btnLod->setFlat(
true);
56 m_d->thresholdMenu.reset(
new QMenu());
57 m_d->thresholdMenu->addSection(i18n(
"Enable after:"));
59 m_d->btnLod->setContextMenuPolicy(Qt::CustomContextMenu);
60 connect(
m_d->btnLod, SIGNAL(customContextMenuRequested(QPoint)),
67 m_d->thresholdSlider->setValue(100);
68 m_d->thresholdSlider->setSingleStep(1);
69 m_d->thresholdSlider->setExponentRatio(3.0);
70 m_d->thresholdSlider->setSuffix(i18n(
" px"));
71 m_d->thresholdSlider->setBlockUpdateSignalOnDrag(
true);
73 QWidgetAction *sliderAction =
new QWidgetAction(
this);
74 sliderAction->setDefaultWidget(
m_d->thresholdSlider);
76 m_d->thresholdMenu->addAction(sliderAction);
79 QHBoxLayout *layout =
new QHBoxLayout(
this);
80 layout->setSpacing(0);
81 layout->addWidget(
m_d->chkLod);
82 layout->addWidget(
m_d->btnLod);
123 QString blockersText;
125 blockersText.append(
"<li>");
126 blockersText.append(
id.name());
127 blockersText.append(
"</li>");
130 toolTip = i18nc(
"@info:tooltip",
131 "<p>Instant Preview Mode is "
132 "disabled by the following options:"
133 "<ul>%1</ul></p>", blockersText);
136 const qreal effectiveBrushSize =
m_d->model->effectiveBrushSize.get();
137 const qreal sizeThreshold =
m_d->model->lodSizeThreshold();
139 toolTip = i18nc(
"@info:tooltip",
140 "<p>Instant Preview Mode is "
141 "disabled by instant preview threshold. "
142 "Please right-click here to change the threshold"
143 "<ul><li>Brush size %1</li>"
144 "<li>Threshold: %2</li></ul></p>",
145 effectiveBrushSize, sizeThreshold);
149 QString limitationsText;
151 limitationsText.append(
"<li>");
152 limitationsText.append(
id.name());
153 limitationsText.append(
"</li>");
156 toolTip = i18nc(
"@info:tooltip",
157 "<p>Instant Preview may look different "
158 "from the final result. In case of troubles "
159 "try disabling the following options:"
160 "<ul>%1</ul></p>", limitationsText);
162 toolTip = i18nc(
"@info:tooltip",
"<p>Instant Preview Mode is available</p>");
166 i18n(
"(Instant Preview)*") : i18n(
"Instant Preview");
174 m_d->btnLod->setFont(font);
175 m_d->btnLod->setText(text);
176 m_d->btnLod->setToolTip(toolTip);
185 m_d->chkLod->setChecked(
false);
188 m_d->chkLod->setChecked(isLodUserAllowed);