author | leseb <leseb> | 2002-04-06 22:20:19 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-04-06 22:20:19 (UTC) |
commit | 75bc9d885aa131334a0b906a1a58134740c40783 (patch) (side-by-side diff) | |
tree | 08a05fe92e1e2f1dc67604f9040bf669e5b4c84a /noncore | |
parent | 8e092bf08c2873dcdec4694573cf715b7a590e41 (diff) | |
download | opie-75bc9d885aa131334a0b906a1a58134740c40783.zip opie-75bc9d885aa131334a0b906a1a58134740c40783.tar.gz opie-75bc9d885aa131334a0b906a1a58134740c40783.tar.bz2 |
- Save album in PNG format instead of XPM
- Small fixes
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 12 | ||||
-rw-r--r-- | noncore/graphics/drawpad/newpagedialog.cpp | 22 | ||||
-rw-r--r-- | noncore/graphics/drawpad/newpagedialog.h | 4 |
4 files changed, 24 insertions, 16 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index aae9ab0..1375792 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -155,2 +155,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pRectangleToolButton->setPopup(rectanglePopupMenu); + m_pRectangleToolButton->setPopupDelay(0); @@ -170,2 +171,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pEllipseToolButton->setPopup(ellipsePopupMenu); + m_pEllipseToolButton->setPopupDelay(0); diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 8818c03..b8a1c2e 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -56,2 +56,3 @@ private: ulong m_dataLenght; + QString m_dataFormat; QList<QPixmap> m_pixmaps; @@ -82,2 +83,7 @@ bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QS m_dataLenght = atts.value("length").toULong(); + m_dataFormat = atts.value("format"); + + if (m_dataFormat.isEmpty()) { + m_dataFormat = "XPM"; + } } @@ -135,3 +141,3 @@ bool DrawPadCanvasXmlHandler::characters(const QString& ch) QImage image; - image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, "XPM"); + image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, m_dataFormat); @@ -217,3 +223,3 @@ void DrawPadCanvas::save(QIODevice* ioDevice) QBuffer buffer(byteArray); - QImageIO imageIO(&buffer, "XPM"); + QImageIO imageIO(&buffer, "PNG"); @@ -228,3 +234,3 @@ void DrawPadCanvas::save(QIODevice* ioDevice) - textStream << " <data length=\"" << byteArray.size() << "\">"; + textStream << " <data length=\"" << byteArray.size() << "\" format=\"PNG\">"; diff --git a/noncore/graphics/drawpad/newpagedialog.cpp b/noncore/graphics/drawpad/newpagedialog.cpp index b1b26ef..5c31978 100644 --- a/noncore/graphics/drawpad/newpagedialog.cpp +++ b/noncore/graphics/drawpad/newpagedialog.cpp @@ -22,4 +22,4 @@ -NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundColor, - const QColor& backgroundColor, QWidget* parent, const char* name) +NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, + const QColor& brushColor, QWidget* parent, const char* name) : QDialog(parent, name, true) @@ -28,4 +28,4 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundCo - m_foregroundColor = foregroundColor; - m_backgroundColor = backgroundColor; + m_penColor = penColor; + m_brushColor = brushColor; @@ -42,7 +42,7 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundCo - m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Contents"), this); + m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Background"), this); QRadioButton* whiteColorRadioButton = new QRadioButton(tr("White"), m_pContentButtonGroup); - QRadioButton* foregroundColorRadioButton = new QRadioButton(tr("Foreground Color"), m_pContentButtonGroup); - QRadioButton* backgroundColorRadioButton = new QRadioButton(tr("Background Color"), m_pContentButtonGroup); + QRadioButton* penColorRadioButton = new QRadioButton(tr("Pen Color"), m_pContentButtonGroup); + QRadioButton* brushColorRadioButton = new QRadioButton(tr("Brush Color"), m_pContentButtonGroup); @@ -64,4 +64,4 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundCo contentLayout->addWidget(whiteColorRadioButton); - contentLayout->addWidget(foregroundColorRadioButton); - contentLayout->addWidget(backgroundColorRadioButton); + contentLayout->addWidget(penColorRadioButton); + contentLayout->addWidget(brushColorRadioButton); @@ -92,6 +92,6 @@ const QColor& NewPageDialog::selectedColor() case 1: - return (m_foregroundColor); + return (m_penColor); break; case 2: - return (m_backgroundColor); + return (m_brushColor); break; diff --git a/noncore/graphics/drawpad/newpagedialog.h b/noncore/graphics/drawpad/newpagedialog.h index f418340..d680394 100644 --- a/noncore/graphics/drawpad/newpagedialog.h +++ b/noncore/graphics/drawpad/newpagedialog.h @@ -38,4 +38,4 @@ private: - QColor m_foregroundColor; - QColor m_backgroundColor; + QColor m_penColor; + QColor m_brushColor; |