summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/thumbnailview.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/drawpad/thumbnailview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/thumbnailview.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp
index 1ccf484..d190ffe 100644
--- a/noncore/graphics/drawpad/thumbnailview.cpp
+++ b/noncore/graphics/drawpad/thumbnailview.cpp
@@ -9,26 +9,27 @@
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 * * 11 * *
12 ***************************************************************************/ 12 ***************************************************************************/
13 13
14#include "thumbnailview.h" 14#include "thumbnailview.h"
15 15
16#include "drawpad.h" 16#include "drawpad.h"
17#include "drawpadcanvas.h" 17#include "drawpadcanvas.h"
18#include "newpagedialog.h" 18#include "newpagedialog.h"
19#include "page.h" 19#include "page.h"
20 20
21#include <opie2/oresource.h>
22
21#include <qpe/config.h> 23#include <qpe/config.h>
22#include <qpe/resource.h>
23#include <qpe/timestring.h> 24#include <qpe/timestring.h>
24 25
25#include <qapplication.h> 26#include <qapplication.h>
26#include <qlayout.h> 27#include <qlayout.h>
27#include <qmessagebox.h> 28#include <qmessagebox.h>
28#include <qtoolbutton.h> 29#include <qtoolbutton.h>
29#include <qwhatsthis.h> 30#include <qwhatsthis.h>
30 31
31#define THUMBNAIL_SIZE 48 32#define THUMBNAIL_SIZE 48
32 33
33PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) 34PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent)
34 : QListBoxItem(parent) 35 : QListBoxItem(parent)
@@ -230,50 +231,57 @@ Page* PageListBox::selected() const
230} 231}
231 232
232ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) 233ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name)
233 : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel | Qt::WStyle_ContextHelp) 234 : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel | Qt::WStyle_ContextHelp)
234{ 235{
235 inLoop = false; 236 inLoop = false;
236 237
237 m_pDrawPad = drawPad; 238 m_pDrawPad = drawPad;
238 m_pDrawPadCanvas = drawPadCanvas; 239 m_pDrawPadCanvas = drawPadCanvas;
239 240
240 setCaption(tr("DrawPad - Thumbnail View")); 241 setCaption(tr("DrawPad - Thumbnail View"));
241 242
243 bool useBigIcon = qApp->desktop()->size().width() > 330;
244
242 QToolButton* newPageButton = new QToolButton(this); 245 QToolButton* newPageButton = new QToolButton(this);
243 newPageButton->setIconSet(Resource::loadIconSet("new")); 246 newPageButton->setUsesBigPixmap( useBigIcon );
247 newPageButton->setPixmap(Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon));
244 newPageButton->setAutoRaise(true); 248 newPageButton->setAutoRaise(true);
245 connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); 249 connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage()));
246 QWhatsThis::add( newPageButton, tr( "Click here to add a new sheet." ) ); 250 QWhatsThis::add( newPageButton, tr( "Click here to add a new sheet." ) );
247 251
248 QToolButton* clearPageButton = new QToolButton(this); 252 QToolButton* clearPageButton = new QToolButton(this);
249 clearPageButton->setIconSet(Resource::loadIconSet("drawpad/clear")); 253 clearPageButton->setUsesBigPixmap( useBigIcon );
254 clearPageButton->setPixmap(Opie::Core::OResource::loadPixmap("drawpad/clear", Opie::Core::OResource::SmallIcon));
250 clearPageButton->setAutoRaise(true); 255 clearPageButton->setAutoRaise(true);
251 connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); 256 connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage()));
252 QWhatsThis::add( clearPageButton, tr( "Click here to erase the current sheet." ) ); 257 QWhatsThis::add( clearPageButton, tr( "Click here to erase the current sheet." ) );
253 258
254 QToolButton* deletePageButton = new QToolButton(this); 259 QToolButton* deletePageButton = new QToolButton(this);
255 deletePageButton->setIconSet(Resource::loadIconSet("trash")); 260 deletePageButton->setUsesBigPixmap( useBigIcon );
261 deletePageButton->setPixmap(Opie::Core::OResource::loadPixmap("trash", Opie::Core::OResource::SmallIcon));
256 deletePageButton->setAutoRaise(true); 262 deletePageButton->setAutoRaise(true);
257 connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); 263 connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage()));
258 QWhatsThis::add( deletePageButton, tr( "Click here to remove the current sheet." ) ); 264 QWhatsThis::add( deletePageButton, tr( "Click here to remove the current sheet." ) );
259 265
260 m_pMovePageUpButton = new QToolButton(this); 266 m_pMovePageUpButton = new QToolButton(this);
261 m_pMovePageUpButton->setIconSet(Resource::loadIconSet("up")); 267 m_pMovePageUpButton->setUsesBigPixmap( useBigIcon );
268 m_pMovePageUpButton->setPixmap(Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon));
262 m_pMovePageUpButton->setAutoRaise(true); 269 m_pMovePageUpButton->setAutoRaise(true);
263 connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); 270 connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp()));
264 QWhatsThis::add( m_pMovePageUpButton, tr( "Click here to move the current sheet up one position in the list." ) ); 271 QWhatsThis::add( m_pMovePageUpButton, tr( "Click here to move the current sheet up one position in the list." ) );
265 272
266 m_pMovePageDownButton = new QToolButton(this); 273 m_pMovePageDownButton = new QToolButton(this);
267 m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down")); 274 m_pMovePageDownButton->setUsesBigPixmap( useBigIcon );
275 m_pMovePageDownButton->setPixmap(Opie::Core::OResource::loadPixmap("down", Opie::Core::OResource::SmallIcon));
268 m_pMovePageDownButton->setAutoRaise(true); 276 m_pMovePageDownButton->setAutoRaise(true);
269 connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); 277 connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown()));
270 QWhatsThis::add( m_pMovePageDownButton, tr( "Click here to move the current sheet down one position in the list." ) ); 278 QWhatsThis::add( m_pMovePageDownButton, tr( "Click here to move the current sheet down one position in the list." ) );
271 279
272 m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this); 280 m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this);
273 connect(m_pPageListBox, SIGNAL(selectionChanged()), this, SLOT(changePage())); 281 connect(m_pPageListBox, SIGNAL(selectionChanged()), this, SLOT(changePage()));
274 282
275 QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); 283 QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4);
276 QHBoxLayout* buttonLayout = new QHBoxLayout(0); 284 QHBoxLayout* buttonLayout = new QHBoxLayout(0);
277 285
278 buttonLayout->addWidget(newPageButton); 286 buttonLayout->addWidget(newPageButton);
279 buttonLayout->addWidget(clearPageButton); 287 buttonLayout->addWidget(clearPageButton);