Commit cc48ee0a authored by Kai Koehne's avatar Kai Koehne
Browse files

Outline: Disable filter button if no filters are available

Fixes that the filter button could be 'checked' for a cpp file.
parent 88bcb982
......@@ -39,7 +39,6 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
m_filterButton->setPopupMode(QToolButton::InstantPopup);
m_filterMenu = new QMenu(m_filterButton);
m_filterButton->setMenu(m_filterMenu);
connect(m_filterMenu, SIGNAL(aboutToShow()), this, SLOT(updateFilterMenu()));
Core::EditorManager *editorManager = Core::EditorManager::instance();
connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)),
......@@ -108,6 +107,7 @@ void OutlineWidgetStack::updateFilterMenu()
m_filterMenu->addAction(filterAction);
}
}
m_filterButton->setEnabled(!m_filterMenu->actions().isEmpty());
}
void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor)
......@@ -138,6 +138,8 @@ void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor)
addWidget(newWidget);
setCurrentWidget(newWidget);
}
updateFilterMenu();
}
}
......
......@@ -31,10 +31,10 @@ public:
private:
bool isCursorSynchronized() const;
QWidget *dummyWidget() const;
void updateFilterMenu();
private slots:
void toggleCursorSynchronization();
void updateFilterMenu();
void updateCurrentEditor(Core::IEditor *editor);
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment