-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 | |||
@@ -154,4 +154,5 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
154 | 154 | ||
155 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); | 155 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); |
156 | m_pRectangleToolButton->setPopupDelay(0); | ||
156 | 157 | ||
157 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); | 158 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); |
@@ -169,4 +170,5 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
169 | 170 | ||
170 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); | 171 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); |
172 | m_pEllipseToolButton->setPopupDelay(0); | ||
171 | 173 | ||
172 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadIconSet("drawpad/fill.png"), QString::null, 0, this); | 174 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadIconSet("drawpad/fill.png"), QString::null, 0, this); |
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 | |||
@@ -55,4 +55,5 @@ private: | |||
55 | State m_state; | 55 | State m_state; |
56 | ulong m_dataLenght; | 56 | ulong m_dataLenght; |
57 | QString m_dataFormat; | ||
57 | QList<QPixmap> m_pixmaps; | 58 | QList<QPixmap> m_pixmaps; |
58 | }; | 59 | }; |
@@ -81,4 +82,9 @@ bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QS | |||
81 | m_state = InData; | 82 | m_state = InData; |
82 | m_dataLenght = atts.value("length").toULong(); | 83 | m_dataLenght = atts.value("length").toULong(); |
84 | m_dataFormat = atts.value("format"); | ||
85 | |||
86 | if (m_dataFormat.isEmpty()) { | ||
87 | m_dataFormat = "XPM"; | ||
88 | } | ||
83 | } | 89 | } |
84 | 90 | ||
@@ -134,5 +140,5 @@ bool DrawPadCanvasXmlHandler::characters(const QString& ch) | |||
134 | 140 | ||
135 | QImage image; | 141 | QImage image; |
136 | image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, "XPM"); | 142 | image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, m_dataFormat); |
137 | 143 | ||
138 | QPixmap* pixmap = new QPixmap(image.width(), image.height()); | 144 | QPixmap* pixmap = new QPixmap(image.width(), image.height()); |
@@ -216,5 +222,5 @@ void DrawPadCanvas::save(QIODevice* ioDevice) | |||
216 | QByteArray byteArray; | 222 | QByteArray byteArray; |
217 | QBuffer buffer(byteArray); | 223 | QBuffer buffer(byteArray); |
218 | QImageIO imageIO(&buffer, "XPM"); | 224 | QImageIO imageIO(&buffer, "PNG"); |
219 | 225 | ||
220 | buffer.open(IO_WriteOnly); | 226 | buffer.open(IO_WriteOnly); |
@@ -227,5 +233,5 @@ void DrawPadCanvas::save(QIODevice* ioDevice) | |||
227 | ::compress((uchar*)byteArrayZipped.data(), &size, (uchar*)byteArray.data(), byteArray.size()); | 233 | ::compress((uchar*)byteArrayZipped.data(), &size, (uchar*)byteArray.data(), byteArray.size()); |
228 | 234 | ||
229 | textStream << " <data length=\"" << byteArray.size() << "\">"; | 235 | textStream << " <data length=\"" << byteArray.size() << "\" format=\"PNG\">"; |
230 | 236 | ||
231 | static const char hexchars[] = "0123456789abcdef"; | 237 | static const char hexchars[] = "0123456789abcdef"; |
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 | |||
@@ -21,12 +21,12 @@ | |||
21 | #include <qspinbox.h> | 21 | #include <qspinbox.h> |
22 | 22 | ||
23 | NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundColor, | 23 | NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, |
24 | const QColor& backgroundColor, QWidget* parent, const char* name) | 24 | const QColor& brushColor, QWidget* parent, const char* name) |
25 | : QDialog(parent, name, true) | 25 | : QDialog(parent, name, true) |
26 | { | 26 | { |
27 | setCaption(tr("New Page")); | 27 | setCaption(tr("New Page")); |
28 | 28 | ||
29 | m_foregroundColor = foregroundColor; | 29 | m_penColor = penColor; |
30 | m_backgroundColor = backgroundColor; | 30 | m_brushColor = brushColor; |
31 | 31 | ||
32 | QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Page Size"), this); | 32 | QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Page Size"), this); |
@@ -41,9 +41,9 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundCo | |||
41 | m_pHeightSpinBox->setValue(height); | 41 | m_pHeightSpinBox->setValue(height); |
42 | 42 | ||
43 | m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Contents"), this); | 43 | m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Background"), this); |
44 | 44 | ||
45 | QRadioButton* whiteColorRadioButton = new QRadioButton(tr("White"), m_pContentButtonGroup); | 45 | QRadioButton* whiteColorRadioButton = new QRadioButton(tr("White"), m_pContentButtonGroup); |
46 | QRadioButton* foregroundColorRadioButton = new QRadioButton(tr("Foreground Color"), m_pContentButtonGroup); | 46 | QRadioButton* penColorRadioButton = new QRadioButton(tr("Pen Color"), m_pContentButtonGroup); |
47 | QRadioButton* backgroundColorRadioButton = new QRadioButton(tr("Background Color"), m_pContentButtonGroup); | 47 | QRadioButton* brushColorRadioButton = new QRadioButton(tr("Brush Color"), m_pContentButtonGroup); |
48 | 48 | ||
49 | m_pContentButtonGroup->setButton(0); | 49 | m_pContentButtonGroup->setButton(0); |
@@ -63,6 +63,6 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& foregroundCo | |||
63 | 63 | ||
64 | contentLayout->addWidget(whiteColorRadioButton); | 64 | contentLayout->addWidget(whiteColorRadioButton); |
65 | contentLayout->addWidget(foregroundColorRadioButton); | 65 | contentLayout->addWidget(penColorRadioButton); |
66 | contentLayout->addWidget(backgroundColorRadioButton); | 66 | contentLayout->addWidget(brushColorRadioButton); |
67 | 67 | ||
68 | mainLayout->addWidget(sizeGroupBox); | 68 | mainLayout->addWidget(sizeGroupBox); |
@@ -91,8 +91,8 @@ const QColor& NewPageDialog::selectedColor() | |||
91 | break; | 91 | break; |
92 | case 1: | 92 | case 1: |
93 | return (m_foregroundColor); | 93 | return (m_penColor); |
94 | break; | 94 | break; |
95 | case 2: | 95 | case 2: |
96 | return (m_backgroundColor); | 96 | return (m_brushColor); |
97 | break; | 97 | break; |
98 | default: | 98 | default: |
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 | |||
@@ -37,6 +37,6 @@ private: | |||
37 | QSpinBox* m_pHeightSpinBox; | 37 | QSpinBox* m_pHeightSpinBox; |
38 | 38 | ||
39 | QColor m_foregroundColor; | 39 | QColor m_penColor; |
40 | QColor m_backgroundColor; | 40 | QColor m_brushColor; |
41 | 41 | ||
42 | QButtonGroup* m_pContentButtonGroup; | 42 | QButtonGroup* m_pContentButtonGroup; |