summaryrefslogtreecommitdiff
authorzecke <zecke>2002-07-07 15:43:37 (UTC)
committer zecke <zecke>2002-07-07 15:43:37 (UTC)
commit72497e9298d84a711114bb49e3c9454fabca50db (patch) (unidiff)
treed6ec0825551a496418c3a1dbc7e688f7e0813866
parent1d6f229e63930e7af2b691a4715dd94649257048 (diff)
downloadopie-72497e9298d84a711114bb49e3c9454fabca50db.zip
opie-72497e9298d84a711114bb49e3c9454fabca50db.tar.gz
opie-72497e9298d84a711114bb49e3c9454fabca50db.tar.bz2
Make the Grid Variabel
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 30afe64..0ced256 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -234,33 +234,33 @@ public:
234 QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); 234 QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file());
235 return fa.lastModified().secsTo(fb.lastModified()); 235 return fa.lastModified().secsTo(fb.lastModified());
236 } 236 }
237 case Type: 237 case Type:
238 return a->type().compare(b->type()); 238 return a->type().compare(b->type());
239 } 239 }
240 return 0; 240 return 0;
241 } 241 }
242 242
243protected: 243protected:
244 244
245 void styleChange( QStyle &old ) 245 void styleChange( QStyle &old )
246 { 246 {
247 QIconView::styleChange( old ); 247 QIconView::styleChange( old );
248 //### duplicated code from LauncherView constructor 248 //### duplicated code from LauncherView constructor
249 int dw = QApplication::desktop()->width(); 249 int dw = QApplication::desktop()->width();
250 setGridX( (dw-13-style().scrollBarExtent().width())/3 ); // tweaked for 8pt+dw=176 and 10pt+dw=240 250 setGridX( (dw-13-style().scrollBarExtent().width())/ (dw/80) ); // tweaked for 8pt+dw=176 and 10pt+dw=240
251 } 251 }
252 252
253private: 253private:
254 QList<AppLnk> hidden; 254 QList<AppLnk> hidden;
255 QDict<void> mimes; 255 QDict<void> mimes;
256 QDict<void> cats; 256 QDict<void> cats;
257 SortMethod sortmeth; 257 SortMethod sortmeth;
258 QRegExp tf; 258 QRegExp tf;
259 int cf; 259 int cf;
260 QIconViewItem* bsy; 260 QIconViewItem* bsy;
261 bool ike; 261 bool ike;
262 262
263}; 263};
264 264
265 265
266bool LauncherView::bsy=FALSE; 266bool LauncherView::bsy=FALSE;
@@ -419,33 +419,33 @@ bool LauncherIconView::removeLink(const QString& linkfile)
419 } 419 }
420 } 420 }
421 return did; 421 return did;
422} 422}
423 423
424LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) 424LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
425 : QVBox( parent, name, fl ) 425 : QVBox( parent, name, fl )
426{ 426{
427 icons = new LauncherIconView( this ); 427 icons = new LauncherIconView( this );
428 setFocusProxy(icons); 428 setFocusProxy(icons);
429 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); 429 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
430 430
431 int dw = QApplication::desktop()->width(); 431 int dw = QApplication::desktop()->width();
432 icons->setItemsMovable( FALSE ); 432 icons->setItemsMovable( FALSE );
433 icons->setAutoArrange( TRUE ); 433 icons->setAutoArrange( TRUE );
434 icons->setSorting( TRUE ); 434 icons->setSorting( TRUE );
435 icons->setGridX( (dw-13-style().scrollBarExtent().width())/3 ); // tweaked for 8pt+dw=176 and 10pt+dw=240 435 icons->setGridX( (dw-13-style().scrollBarExtent().width())/ (dw/80) ); // tweaked for 8pt+dw=176 and 10pt+dw=240
436 icons->setGridY( fontMetrics().height()*2+24 ); 436 icons->setGridY( fontMetrics().height()*2+24 );
437 icons->setFrameStyle( QFrame::NoFrame ); 437 icons->setFrameStyle( QFrame::NoFrame );
438 icons->setSpacing( 4 ); 438 icons->setSpacing( 4 );
439 icons->setMargin( 0 ); 439 icons->setMargin( 0 );
440 icons->setSelectionMode( QIconView::Multi ); 440 icons->setSelectionMode( QIconView::Multi );
441 icons->setBackgroundMode( PaletteBase ); 441 icons->setBackgroundMode( PaletteBase );
442 442
443 connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)), 443 connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)),
444 SLOT(itemClicked(int, QIconViewItem *)) ); 444 SLOT(itemClicked(int, QIconViewItem *)) );
445 connect( icons, SIGNAL(selectionChanged()), 445 connect( icons, SIGNAL(selectionChanged()),
446 SLOT(selectionChanged()) ); 446 SLOT(selectionChanged()) );
447 connect( icons, SIGNAL(returnPressed(QIconViewItem *)), 447 connect( icons, SIGNAL(returnPressed(QIconViewItem *)),
448 SLOT(returnPressed(QIconViewItem *)) ); 448 SLOT(returnPressed(QIconViewItem *)) );
449 connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)), 449 connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)),
450 SLOT(itemPressed(int, QIconViewItem *)) ); 450 SLOT(itemPressed(int, QIconViewItem *)) );
451 451
@@ -453,37 +453,37 @@ LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
453} 453}
454 454
455LauncherView::~LauncherView() 455LauncherView::~LauncherView()
456{ 456{
457} 457}
458 458
459void LauncherView::setToolsEnabled(bool y) 459void LauncherView::setToolsEnabled(bool y)
460{ 460{
461 if ( !y != !tools ) { 461 if ( !y != !tools ) {
462 if ( y ) { 462 if ( y ) {
463 tools = new QHBox(this); 463 tools = new QHBox(this);
464 464
465 // Type filter 465 // Type filter
466 typemb = new MenuButton(tools); 466 typemb = new MenuButton(tools);
467 typemb->setLabel(tr("Type: %1")); 467 typemb->setLabel(tr("Type: %1"));
468 typemb->setFixedHeight ( 20 ); 468 typemb->setFixedHeight ( 20 );
469 469
470 // Category filter 470 // Category filter
471 catmb = new CategorySelect(tools); 471 catmb = new CategorySelect(tools);
472 catmb->setFixedHeight ( 20 ); 472 catmb->setFixedHeight ( 20 );
473 473
474 updateTools(); 474 updateTools();
475 tools->show(); 475 tools->show();
476 } else { 476 } else {
477 delete tools; 477 delete tools;
478 tools = 0; 478 tools = 0;
479 } 479 }
480 } 480 }
481} 481}
482 482
483void LauncherView::updateTools() 483void LauncherView::updateTools()
484{ 484{
485 disconnect( typemb, SIGNAL(selected(const QString&)), 485 disconnect( typemb, SIGNAL(selected(const QString&)),
486 this, SLOT(showType(const QString&)) ); 486 this, SLOT(showType(const QString&)) );
487 disconnect( catmb, SIGNAL(signalSelected(int)), 487 disconnect( catmb, SIGNAL(signalSelected(int)),
488 this, SLOT(showCategory(int)) ); 488 this, SLOT(showCategory(int)) );
489 489