author | harlekin <harlekin> | 2002-02-23 22:47:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-23 22:47:25 (UTC) |
commit | f1c800025cf759ca0d6257a42f548216d217b16b (patch) (unidiff) | |
tree | 42aa7b339aad4b6dcfc6b17d4931febbb17b591d | |
parent | 9f9006e0257e3d4c5d66331a7d6061c8a5da164b (diff) | |
download | opie-f1c800025cf759ca0d6257a42f548216d217b16b.zip opie-f1c800025cf759ca0d6257a42f548216d217b16b.tar.gz opie-f1c800025cf759ca0d6257a42f548216d217b16b.tar.bz2 |
make the two bottom menus the same height (the buttons)
-rw-r--r-- | core/launcher/launcherview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 0df949e..764f088 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -395,132 +395,134 @@ bool LauncherIconView::removeLink(const QString& linkfile) | |||
395 | if ( l->linkFileKnown() && l->linkFile() == linkfile || l->file() == linkfile | 395 | if ( l->linkFileKnown() && l->linkFile() == linkfile || l->file() == linkfile |
396 | || dl.isValid() && dl.file() == l->file() ) { | 396 | || dl.isValid() && dl.file() == l->file() ) { |
397 | delete item; | 397 | delete item; |
398 | did = TRUE; | 398 | did = TRUE; |
399 | } | 399 | } |
400 | item = (LauncherItem*)item->nextItem(); | 400 | item = (LauncherItem*)item->nextItem(); |
401 | } | 401 | } |
402 | QListIterator<AppLnk> it(hidden); | 402 | QListIterator<AppLnk> it(hidden); |
403 | while ((l=it.current())) { | 403 | while ((l=it.current())) { |
404 | ++it; | 404 | ++it; |
405 | if ( l->linkFileKnown() && l->linkFile() == linkfile | 405 | if ( l->linkFileKnown() && l->linkFile() == linkfile |
406 | || l->file() == linkfile | 406 | || l->file() == linkfile |
407 | || dl.isValid() && dl.file() == l->file() ) { | 407 | || dl.isValid() && dl.file() == l->file() ) { |
408 | hidden.removeRef(l); | 408 | hidden.removeRef(l); |
409 | did = TRUE; | 409 | did = TRUE; |
410 | } | 410 | } |
411 | } | 411 | } |
412 | return did; | 412 | return did; |
413 | } | 413 | } |
414 | 414 | ||
415 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) | 415 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) |
416 | : QVBox( parent, name, fl ) | 416 | : QVBox( parent, name, fl ) |
417 | { | 417 | { |
418 | icons = new LauncherIconView( this ); | 418 | icons = new LauncherIconView( this ); |
419 | setFocusProxy(icons); | 419 | setFocusProxy(icons); |
420 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); | 420 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); |
421 | 421 | ||
422 | int dw = QApplication::desktop()->width(); | 422 | int dw = QApplication::desktop()->width(); |
423 | icons->setItemsMovable( FALSE ); | 423 | icons->setItemsMovable( FALSE ); |
424 | icons->setAutoArrange( TRUE ); | 424 | icons->setAutoArrange( TRUE ); |
425 | icons->setSorting( TRUE ); | 425 | icons->setSorting( TRUE ); |
426 | icons->setGridX( (dw-13-style().scrollBarExtent().width())/3 ); // tweaked for 8pt+dw=176 and 10pt+dw=240 | 426 | icons->setGridX( (dw-13-style().scrollBarExtent().width())/3 ); // tweaked for 8pt+dw=176 and 10pt+dw=240 |
427 | icons->setGridY( fontMetrics().height()*2+24 ); | 427 | icons->setGridY( fontMetrics().height()*2+24 ); |
428 | icons->setFrameStyle( QFrame::NoFrame ); | 428 | icons->setFrameStyle( QFrame::NoFrame ); |
429 | icons->setSpacing( 4 ); | 429 | icons->setSpacing( 4 ); |
430 | icons->setMargin( 0 ); | 430 | icons->setMargin( 0 ); |
431 | icons->setSelectionMode( QIconView::Multi ); | 431 | icons->setSelectionMode( QIconView::Multi ); |
432 | icons->setBackgroundMode( PaletteBase ); | 432 | icons->setBackgroundMode( PaletteBase ); |
433 | 433 | ||
434 | connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)), | 434 | connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)), |
435 | SLOT(itemClicked(int, QIconViewItem *)) ); | 435 | SLOT(itemClicked(int, QIconViewItem *)) ); |
436 | connect( icons, SIGNAL(selectionChanged()), | 436 | connect( icons, SIGNAL(selectionChanged()), |
437 | SLOT(selectionChanged()) ); | 437 | SLOT(selectionChanged()) ); |
438 | connect( icons, SIGNAL(returnPressed(QIconViewItem *)), | 438 | connect( icons, SIGNAL(returnPressed(QIconViewItem *)), |
439 | SLOT(returnPressed(QIconViewItem *)) ); | 439 | SLOT(returnPressed(QIconViewItem *)) ); |
440 | connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)), | 440 | connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)), |
441 | SLOT(itemPressed(int, QIconViewItem *)) ); | 441 | SLOT(itemPressed(int, QIconViewItem *)) ); |
442 | 442 | ||
443 | tools = 0; | 443 | tools = 0; |
444 | } | 444 | } |
445 | 445 | ||
446 | LauncherView::~LauncherView() | 446 | LauncherView::~LauncherView() |
447 | { | 447 | { |
448 | } | 448 | } |
449 | 449 | ||
450 | void LauncherView::setToolsEnabled(bool y) | 450 | void LauncherView::setToolsEnabled(bool y) |
451 | { | 451 | { |
452 | if ( !y != !tools ) { | 452 | if ( !y != !tools ) { |
453 | if ( y ) { | 453 | if ( y ) { |
454 | tools = new QHBox(this); | 454 | tools = new QHBox(this); |
455 | 455 | ||
456 | // Type filter | 456 | // Type filter |
457 | typemb = new MenuButton(tools); | 457 | typemb = new MenuButton(tools); |
458 | typemb->setLabel(tr("Type: %1")); | 458 | typemb->setLabel(tr("Type: %1")); |
459 | 459 | typemb->setFixedHeight ( 20 ); | |
460 | |||
460 | // Category filter | 461 | // Category filter |
461 | catmb = new CategorySelect(tools); | 462 | catmb = new CategorySelect(tools); |
462 | 463 | catmb->setFixedHeight ( 20 ); | |
464 | |||
463 | updateTools(); | 465 | updateTools(); |
464 | tools->show(); | 466 | tools->show(); |
465 | } else { | 467 | } else { |
466 | delete tools; | 468 | delete tools; |
467 | tools = 0; | 469 | tools = 0; |
468 | } | 470 | } |
469 | } | 471 | } |
470 | } | 472 | } |
471 | 473 | ||
472 | void LauncherView::updateTools() | 474 | void LauncherView::updateTools() |
473 | { | 475 | { |
474 | disconnect( typemb, SIGNAL(selected(const QString&)), | 476 | disconnect( typemb, SIGNAL(selected(const QString&)), |
475 | this, SLOT(showType(const QString&)) ); | 477 | this, SLOT(showType(const QString&)) ); |
476 | disconnect( catmb, SIGNAL(signalSelected(int)), | 478 | disconnect( catmb, SIGNAL(signalSelected(int)), |
477 | this, SLOT(showCategory(int)) ); | 479 | this, SLOT(showCategory(int)) ); |
478 | 480 | ||
479 | icons->updateCategoriesAndMimeTypes(); | 481 | icons->updateCategoriesAndMimeTypes(); |
480 | 482 | ||
481 | QString prev; | 483 | QString prev; |
482 | 484 | ||
483 | // Type filter | 485 | // Type filter |
484 | QStringList types; | 486 | QStringList types; |
485 | types << tr("All"); | 487 | types << tr("All"); |
486 | types << "--"; | 488 | types << "--"; |
487 | types += icons->mimeTypes(); | 489 | types += icons->mimeTypes(); |
488 | prev = typemb->currentText(); | 490 | prev = typemb->currentText(); |
489 | typemb->clear(); | 491 | typemb->clear(); |
490 | typemb->insertItems(types); | 492 | typemb->insertItems(types); |
491 | typemb->select(prev); | 493 | typemb->select(prev); |
492 | 494 | ||
493 | Categories cats( 0 ); | 495 | Categories cats( 0 ); |
494 | cats.load( categoryFileName() ); | 496 | cats.load( categoryFileName() ); |
495 | QArray<int> vl( 0 ); | 497 | QArray<int> vl( 0 ); |
496 | catmb->setCategories( vl, "Document View", tr("Document View") ); | 498 | catmb->setCategories( vl, "Document View", tr("Document View") ); |
497 | catmb->setRemoveCategoryEdit( TRUE ); | 499 | catmb->setRemoveCategoryEdit( TRUE ); |
498 | catmb->setAllCategories( TRUE ); | 500 | catmb->setAllCategories( TRUE ); |
499 | 501 | ||
500 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); | 502 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); |
501 | connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); | 503 | connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); |
502 | } | 504 | } |
503 | 505 | ||
504 | void LauncherView::sortBy(int s) | 506 | void LauncherView::sortBy(int s) |
505 | { | 507 | { |
506 | icons->setSortMethod((LauncherIconView::SortMethod)s); | 508 | icons->setSortMethod((LauncherIconView::SortMethod)s); |
507 | } | 509 | } |
508 | 510 | ||
509 | void LauncherView::showType(const QString& t) | 511 | void LauncherView::showType(const QString& t) |
510 | { | 512 | { |
511 | if ( t == tr("All") ) { | 513 | if ( t == tr("All") ) { |
512 | icons->setTypeFilter("",TRUE); | 514 | icons->setTypeFilter("",TRUE); |
513 | } else { | 515 | } else { |
514 | icons->setTypeFilter(t+"/*",TRUE); | 516 | icons->setTypeFilter(t+"/*",TRUE); |
515 | } | 517 | } |
516 | } | 518 | } |
517 | 519 | ||
518 | void LauncherView::showCategory( int c ) | 520 | void LauncherView::showCategory( int c ) |
519 | { | 521 | { |
520 | icons->setCategoryFilter( c, TRUE ); | 522 | icons->setCategoryFilter( c, TRUE ); |
521 | } | 523 | } |
522 | 524 | ||
523 | void LauncherView::resizeEvent(QResizeEvent *e) | 525 | void LauncherView::resizeEvent(QResizeEvent *e) |
524 | { | 526 | { |
525 | QVBox::resizeEvent( e ); | 527 | QVBox::resizeEvent( e ); |
526 | if ( e->size().width() != e->oldSize().width() ) | 528 | if ( e->size().width() != e->oldSize().width() ) |