-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 @@ -427,68 +427,70 @@ LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) icons->setGridY( fontMetrics().height()*2+24 ); icons->setFrameStyle( QFrame::NoFrame ); icons->setSpacing( 4 ); icons->setMargin( 0 ); icons->setSelectionMode( QIconView::Multi ); icons->setBackgroundMode( PaletteBase ); connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)), SLOT(itemClicked(int, QIconViewItem *)) ); connect( icons, SIGNAL(selectionChanged()), SLOT(selectionChanged()) ); connect( icons, SIGNAL(returnPressed(QIconViewItem *)), SLOT(returnPressed(QIconViewItem *)) ); connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)), SLOT(itemPressed(int, QIconViewItem *)) ); tools = 0; } LauncherView::~LauncherView() { } void LauncherView::setToolsEnabled(bool y) { if ( !y != !tools ) { if ( y ) { tools = new QHBox(this); // Type filter typemb = new MenuButton(tools); typemb->setLabel(tr("Type: %1")); - + typemb->setFixedHeight ( 20 ); + // Category filter catmb = new CategorySelect(tools); - + catmb->setFixedHeight ( 20 ); + updateTools(); tools->show(); } else { delete tools; tools = 0; } } } void LauncherView::updateTools() { disconnect( typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&)) ); disconnect( catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int)) ); icons->updateCategoriesAndMimeTypes(); QString prev; // Type filter QStringList types; types << tr("All"); types << "--"; types += icons->mimeTypes(); prev = typemb->currentText(); typemb->clear(); typemb->insertItems(types); typemb->select(prev); Categories cats( 0 ); cats.load( categoryFileName() ); |