]> Shamusworld >> Repos - architektonas/blobdiff - src/penwidget.cpp
GUI functionality fixes.
[architektonas] / src / penwidget.cpp
index 2a557e39d150f54ab48e080eace9d234d0425aee..4bd966af36e2af3cf3ac4e1f8c1d7a893f768f33 100644 (file)
@@ -29,6 +29,14 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false)
        QLabel * l1 = new QLabel(tr("Width:"));
        QLabel * l2 = new QLabel(tr("RGB:"));
        QLabel * l3 = new QLabel(tr("Style:"));
+       QToolButton * qtb = new QToolButton(this);
+
+       QAction * action = new QAction(QIcon(":/res/pen-stamp.png"), tr(""), this);
+       action->setToolTip(tr("Stamp Selected"));
+       action->setStatusTip(tr("Stamp selected objects with pen attributes."));
+       action->setShortcut(QKeySequence(tr("p,p")));
+//     action->setCheckable(checkable);
+       qtb->setDefaultAction(action);
 
        style->insertItem(1, tr("Solid"));
        style->insertItem(2, tr("Dash"));
@@ -63,6 +71,7 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false)
        hbox1->addWidget(blue, 0, Qt::AlignLeft);
        hbox1->addWidget(l3, 0, Qt::AlignLeft);
        hbox1->addWidget(style, 0, Qt::AlignLeft);
+       hbox1->addWidget(qtb, 0, Qt::AlignLeft);
        hbox1->addStretch(1);
 
        setLayout(hbox1);
@@ -72,6 +81,7 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false)
        connect(green, SIGNAL(textEdited(QString)), this, SLOT(HandleGreenSelected(QString)));
        connect(blue, SIGNAL(textEdited(QString)), this, SLOT(HandleBlueSelected(QString)));
        connect(style, SIGNAL(currentIndexChanged(int)), this, SLOT(HandleStyleSelected(int)));
+       connect(qtb, SIGNAL(triggered(QAction *)), this, SLOT(HandleStamp(QAction *)));
 }
 
 
@@ -175,3 +185,9 @@ void PenWidget::HandleBlueSelected(QString text)
        emit ColorSelected(Global::penColor);
 }
 
+
+void PenWidget::HandleStamp(QAction * /* action */)
+{
+       emit StampSelected();
+}
+