mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 16:37:28 +00:00
small refactoring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23876 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1f2cee9589
commit
f23773c8c5
@ -263,24 +263,27 @@ void GuiSymbols::on_categoryCO_activated(QString const & text)
|
||||
{
|
||||
if (!categoryFilterCB->isChecked())
|
||||
updateSymbolList(false);
|
||||
else if (used_blocks.find(text) != used_blocks.end())
|
||||
symbolsLW->scrollToItem(used_blocks[text],
|
||||
QAbstractItemView::PositionAtTop);
|
||||
else
|
||||
scrollToItem(text);
|
||||
}
|
||||
|
||||
|
||||
void GuiSymbols::on_categoryFilterCB_toggled(bool on)
|
||||
{
|
||||
updateSymbolList(on);
|
||||
if (on) {
|
||||
QString const category = categoryCO->currentText();
|
||||
if (used_blocks.find(category) != used_blocks.end())
|
||||
symbolsLW->scrollToItem(used_blocks[category],
|
||||
QAbstractItemView::PositionAtTop);
|
||||
}
|
||||
if (on)
|
||||
scrollToItem(categoryCO->currentText());
|
||||
}
|
||||
|
||||
|
||||
void GuiSymbols::scrollToItem(QString const & category)
|
||||
{
|
||||
if (used_blocks.find(category) != used_blocks.end()) {
|
||||
symbolsLW->scrollToItem(used_blocks[category],
|
||||
QAbstractItemView::PositionAtTop);
|
||||
}
|
||||
}
|
||||
|
||||
void GuiSymbols::updateSymbolList(bool update_combo)
|
||||
{
|
||||
QString category = categoryCO->currentText();
|
||||
|
@ -51,6 +51,7 @@ public Q_SLOTS:
|
||||
void on_chosenLE_textChanged(QString const &);
|
||||
|
||||
private:
|
||||
void scrollToItem(QString const & category);
|
||||
/** update the widgets (symbol browser, category combo)
|
||||
* \p combo indicates if the combo box has to be refreshed
|
||||
* as well (which is rather expensive)
|
||||
|
Loading…
x
Reference in New Issue
Block a user