FillTab::FillTab(QWidget *parent) : DialogTab(parent), _multiEdit(false) { setupUi(this); setTabTitle(tr("Fill")); _style->addItem("NoBrush", (int)Qt::NoBrush); _style->addItem("SolidPattern", (int)Qt::SolidPattern); _style->addItem("Dense1Pattern", (int)Qt::Dense1Pattern); _style->addItem("Dense2Pattern", (int)Qt::Dense2Pattern); _style->addItem("Dense3Pattern", (int)Qt::Dense3Pattern); _style->addItem("Dense4Pattern", (int)Qt::Dense4Pattern); _style->addItem("Dense5Pattern", (int)Qt::Dense5Pattern); _style->addItem("Dense6Pattern", (int)Qt::Dense6Pattern); _style->addItem("Dense7Pattern", (int)Qt::Dense7Pattern); _style->addItem("HorPattern", (int)Qt::HorPattern); _style->addItem("VerPattern", (int)Qt::VerPattern); _style->addItem("CrossPattern", (int)Qt::CrossPattern); _style->addItem("BDiagPattern", (int)Qt::BDiagPattern); _style->addItem("FDiagPattern", (int)Qt::FDiagPattern); _style->addItem("DiagCrossPattern", (int)Qt::DiagCrossPattern); connect(_color, SIGNAL(changed(const QColor &)), this, SIGNAL(modified())); connect(_style, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified())); connect(_gradientEditor, SIGNAL(changed(const QGradient &)), this, SIGNAL(modified())); connect(_gradientReset, SIGNAL(pressed()), this, SIGNAL(modified())); connect(_useGradient, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); connect(_gradientReset, SIGNAL(pressed()), _gradientEditor, SLOT(resetGradient())); connect(_useGradient, SIGNAL(stateChanged(int)), this, SLOT(updateButtons())); updateButtons(); }
void DkTransferToolBar::createIcons() { // user needs to decide... //this->setIconSize(QSize(16,16)); toolBarIcons.resize(icon_toolbar_end); toolBarIcons[icon_toolbar_reset] = ICON("", ":/nomacs/img/gradient-reset.png"); toolBarIcons[icon_toolbar_pipette] = ICON("", ":/nomacs/img/pipette.png"); toolBarIcons[icon_toolbar_save] = ICON("", ":/nomacs/img/save.png"); if (!DkSettings::display.defaultIconColor || DkSettings::app.privateMode) { // now colorize the icons toolBarIcons[icon_toolbar_reset].addPixmap(DkImage::colorizePixmap(toolBarIcons[icon_toolbar_reset].pixmap(100, QIcon::Normal, QIcon::Off), DkSettings::display.iconColor), QIcon::Normal, QIcon::Off); toolBarIcons[icon_toolbar_pipette].addPixmap(DkImage::colorizePixmap(toolBarIcons[icon_toolbar_pipette].pixmap(100, QIcon::Normal, QIcon::Off), DkSettings::display.iconColor), QIcon::Normal, QIcon::Off); toolBarIcons[icon_toolbar_save].addPixmap(DkImage::colorizePixmap(toolBarIcons[icon_toolbar_save].pixmap(100, QIcon::Normal, QIcon::Off), DkSettings::display.iconColor), QIcon::Normal, QIcon::Off); } toolBarActions.resize(toolbar_end); toolBarActions[toolbar_reset] = new QAction(toolBarIcons[icon_toolbar_reset], tr("Reset"), this); toolBarActions[toolbar_reset]->setStatusTip(tr("Resets the Pseudo Color function")); connect(toolBarActions[toolbar_reset], SIGNAL(triggered()), this, SLOT(resetGradient())); //toolBarActions[toolbar_reset]->setToolTip("was geht?"); toolBarActions[toolbar_pipette] = new QAction(toolBarIcons[icon_toolbar_pipette], tr("Select Color"), this); toolBarActions[toolbar_pipette]->setStatusTip(tr("Adds a slider at the selected color value")); toolBarActions[toolbar_pipette]->setCheckable(true); toolBarActions[toolbar_pipette]->setChecked(false); connect(toolBarActions[toolbar_pipette], SIGNAL(triggered(bool)), this, SLOT(pickColor(bool))); toolBarActions[toolbar_save] = new QAction(toolBarIcons[icon_toolbar_save], tr("Save Gradient"), this); toolBarActions[toolbar_save]->setStatusTip(tr("Saves the current Gradient")); connect(toolBarActions[toolbar_save], SIGNAL(triggered()), this, SLOT(saveGradient())); addActions(toolBarActions.toList()); }