87 , m_resourceProvider(viewManager->canvasResourceProvider())
88 , m_viewManager(viewManager)
91 Q_ASSERT(viewManager != 0);
99 KAcceleratorManager::setNoAccel(
this);
101 setWindowTitle(i18n(
"Painter's Toolchest"));
105 KConfigGroup grp = KSharedConfig::openConfig()->group(
"krita").group(
"Toolbar BrushesAndStuff");
106 int iconsize = grp.readEntry(
"IconSize", 22);
108 int buttonsize = grp.readEntry(
"ButtonSize", 32);
200 int menuPadding = 20;
243 sliderWidth = 150 * logicalDpiX() / 96;
246 sliderWidth = 120 * logicalDpiX() / 96;
249 for (
int i = 0; i < 5; ++i) {
266 i18nc(
"{n} is the number value, % is the percent sign",
"Opacity: {n}%"));
268 i18nc(
"{n} is the number value, % is the percent sign",
"Flow: {n}%"));
269 slSize->setPrefix(QString(
"%1 ").arg(i18n(
"Size:")));
270 slRotation->setPrefix(QString(
"%1 ").arg(i18n(
"Rotation:")));
271 slPatternSize->
setPrefix(QString(
"%1 ").arg(i18n(
"Pattern Scale:")));
286 slOpacity->setSingleStep(5);
287 slOpacity->setMinimumWidth(qMax(sliderWidth, slOpacity->
sizeHint().width()));
288 slOpacity->setFixedHeight(buttonsize);
293 slFlow->setSingleStep(5);
294 slFlow->setMinimumWidth(qMax(sliderWidth, slFlow->
sizeHint().width()));
295 slFlow->setFixedHeight(buttonsize);
301 slSize->setSingleStep(1);
303 slSize->setSuffix(i18n(
" px"));
304 slSize->setMinimumWidth(qMax(sliderWidth, slSize->
sizeHint().width()));
305 slSize->setFixedHeight(buttonsize);
309 slRotation->
setRange(-360.0, 360.0);
310 slRotation->setMinimumWidth(qMax(sliderWidth, slRotation->sizeHint().width()));
313 slPatternSize->
setRange(0.0, 2.0, 2);
321 slPatternSize->setMinimumWidth(qMax(sliderWidth, slPatternSize->
sizeHint().width()));
322 slPatternSize->setFixedHeight(buttonsize);
350 QHBoxLayout* baseLayout =
new QHBoxLayout(
this);
353 baseLayout->setSpacing(4);
354 baseLayout->setContentsMargins(0, 0, 0, 0);
363 m_layout->setContentsMargins(0, 0, 0, 0);
365 QWidget* compositeActions =
new QWidget(
this);
366 QHBoxLayout* compositeLayout =
new QHBoxLayout(compositeActions);
371 compositeLayout->setSpacing(4);
372 compositeLayout->setContentsMargins(0, 0, 0, 0);
376 QWidgetAction * action;
378 action =
new QWidgetAction(
this);
380 action->setText(i18n(
"Brush composite"));
381 action->setDefaultWidget(compositeActions);
383 action =
new QWidgetAction(
this);
387 connect(action, SIGNAL(triggered()),
m_sliderChooser[0], SLOT(showPopupWidget()));
390 action =
new QWidgetAction(
this);
394 connect(action, SIGNAL(triggered()),
m_sliderChooser[1], SLOT(showPopupWidget()));
397 action =
new QWidgetAction(
this);
401 connect(action, SIGNAL(triggered()),
m_sliderChooser[2], SLOT(showPopupWidget()));
404 action =
new QWidgetAction(
this);
408 connect(action, SIGNAL(triggered()),
m_sliderChooser[3], SLOT(showPopupWidget()));
411 action =
new QWidgetAction(
this);
415 connect(action, SIGNAL(triggered()),
m_sliderChooser[4], SLOT(showPopupWidget()));
418 action =
new QWidgetAction(
this);
423 action =
new QWidgetAction(
this);
428 action =
new QWidgetAction(
this);
434 action =
new QWidgetAction(
this);
441 action =
new QWidgetAction(
this);
447 QWidget* mirrorActions =
new QWidget(
this);
448 QHBoxLayout* mirrorLayout =
new QHBoxLayout(mirrorActions);
453 mirrorLayout->setSpacing(4);
454 mirrorLayout->setContentsMargins(0, 0, 0, 0);
456 action =
new QWidgetAction(
this);
458 action->setDefaultWidget(mirrorActions);
461 action =
new QWidgetAction(
this);
465 connect(action, SIGNAL(triggered()),
m_workspaceWidget, SLOT(showPopupWidget()));
466 workspacePopup->addAction(action);
485 action =
new QWidgetAction(
this);
498 Q_FOREACH (
const QString & paintopId, keys) {