86 , m_resourceProvider(viewManager->canvasResourceProvider())
87 , m_viewManager(viewManager)
90 Q_ASSERT(viewManager != 0);
98 KAcceleratorManager::setNoAccel(
this);
100 setWindowTitle(i18n(
"Painter's Toolchest"));
104 KConfigGroup grp = KSharedConfig::openConfig()->group(
"krita").group(
"Toolbar BrushesAndStuff");
105 int iconsize = grp.readEntry(
"IconSize", 22);
107 int buttonsize = grp.readEntry(
"ButtonSize", 32);
199 int menuPadding = 20;
242 sliderWidth = 150 * logicalDpiX() / 96;
245 sliderWidth = 120 * logicalDpiX() / 96;
248 for (
int i = 0; i < 5; ++i) {
265 i18nc(
"{n} is the number value, % is the percent sign",
"Opacity: {n}%"));
267 i18nc(
"{n} is the number value, % is the percent sign",
"Flow: {n}%"));
268 slSize->setPrefix(QString(
"%1 ").arg(i18n(
"Size:")));
269 slRotation->setPrefix(QString(
"%1 ").arg(i18n(
"Rotation:")));
270 slPatternSize->
setPrefix(QString(
"%1 ").arg(i18n(
"Pattern Scale:")));
285 slOpacity->setSingleStep(5);
286 slOpacity->setMinimumWidth(qMax(sliderWidth, slOpacity->
sizeHint().width()));
287 slOpacity->setFixedHeight(buttonsize);
292 slFlow->setSingleStep(5);
293 slFlow->setMinimumWidth(qMax(sliderWidth, slFlow->
sizeHint().width()));
294 slFlow->setFixedHeight(buttonsize);
300 slSize->setSingleStep(1);
302 slSize->setSuffix(i18n(
" px"));
303 slSize->setMinimumWidth(qMax(sliderWidth, slSize->
sizeHint().width()));
304 slSize->setFixedHeight(buttonsize);
308 slRotation->
setRange(-360.0, 360.0);
309 slRotation->setMinimumWidth(qMax(sliderWidth, slRotation->sizeHint().width()));
312 slPatternSize->
setRange(0.0, 2.0, 2);
320 slPatternSize->setMinimumWidth(qMax(sliderWidth, slPatternSize->
sizeHint().width()));
321 slPatternSize->setFixedHeight(buttonsize);
349 QHBoxLayout* baseLayout =
new QHBoxLayout(
this);
352 baseLayout->setSpacing(4);
353 baseLayout->setContentsMargins(0, 0, 0, 0);
362 m_layout->setContentsMargins(0, 0, 0, 0);
364 QWidget* compositeActions =
new QWidget(
this);
365 QHBoxLayout* compositeLayout =
new QHBoxLayout(compositeActions);
370 compositeLayout->setSpacing(4);
371 compositeLayout->setContentsMargins(0, 0, 0, 0);
375 QWidgetAction * action;
377 action =
new QWidgetAction(
this);
379 action->setText(i18n(
"Brush composite"));
380 action->setDefaultWidget(compositeActions);
382 action =
new QWidgetAction(
this);
389 action =
new QWidgetAction(
this);
396 action =
new QWidgetAction(
this);
403 action =
new QWidgetAction(
this);
410 action =
new QWidgetAction(
this);
417 action =
new QWidgetAction(
this);
422 action =
new QWidgetAction(
this);
427 action =
new QWidgetAction(
this);
433 action =
new QWidgetAction(
this);
440 action =
new QWidgetAction(
this);
446 QWidget* mirrorActions =
new QWidget(
this);
447 QHBoxLayout* mirrorLayout =
new QHBoxLayout(mirrorActions);
452 mirrorLayout->setSpacing(4);
453 mirrorLayout->setContentsMargins(0, 0, 0, 0);
455 action =
new QWidgetAction(
this);
457 action->setDefaultWidget(mirrorActions);
460 action =
new QWidgetAction(
this);
465 workspacePopup->addAction(action);
484 action =
new QWidgetAction(
this);
497 Q_FOREACH (
const QString & paintopId, keys) {