mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
* GuiRef: improve filter UI
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33271 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d3487d106c
commit
f6e81bbb95
@ -68,10 +68,10 @@ GuiRef::GuiRef(GuiView & lv)
|
|||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
connect(referenceED, SIGNAL(textChanged(QString)),
|
connect(referenceED, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
connect(findLE, SIGNAL(returnPressed()),
|
connect(findLE, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(on_searchPB_clicked()));
|
this, SLOT(filterLabels()));
|
||||||
connect(csFindCB, SIGNAL(clicked()),
|
connect(csFindCB, SIGNAL(clicked()),
|
||||||
this, SLOT(on_searchPB_clicked()));
|
this, SLOT(filterLabels()));
|
||||||
connect(nameED, SIGNAL(textChanged(QString)),
|
connect(nameED, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
connect(refsTW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
|
connect(refsTW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
|
||||||
@ -202,7 +202,6 @@ void GuiRef::groupToggled()
|
|||||||
|
|
||||||
void GuiRef::updateClicked()
|
void GuiRef::updateClicked()
|
||||||
{
|
{
|
||||||
findLE->clear();
|
|
||||||
updateRefs();
|
updateRefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,6 +428,9 @@ void GuiRef::redoRefs()
|
|||||||
refsTW->setUpdatesEnabled(true);
|
refsTW->setUpdatesEnabled(true);
|
||||||
refsTW->update();
|
refsTW->update();
|
||||||
|
|
||||||
|
// redo filter
|
||||||
|
filterLabels();
|
||||||
|
|
||||||
// Re-activate the emission of signals by these widgets.
|
// Re-activate the emission of signals by these widgets.
|
||||||
refsTW->blockSignals(false);
|
refsTW->blockSignals(false);
|
||||||
referenceED->blockSignals(false);
|
referenceED->blockSignals(false);
|
||||||
@ -473,17 +475,11 @@ void GuiRef::gotoBookmark()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiRef::on_findLE_textChanged(const QString & text)
|
void GuiRef::filterLabels()
|
||||||
{
|
{
|
||||||
searchPB->setDisabled(text.isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GuiRef::on_searchPB_clicked()
|
|
||||||
{
|
|
||||||
QTreeWidgetItemIterator it(refsTW);
|
|
||||||
Qt::CaseSensitivity cs = csFindCB->isChecked() ?
|
Qt::CaseSensitivity cs = csFindCB->isChecked() ?
|
||||||
Qt::CaseSensitive : Qt::CaseInsensitive;
|
Qt::CaseSensitive : Qt::CaseInsensitive;
|
||||||
|
QTreeWidgetItemIterator it(refsTW);
|
||||||
while (*it) {
|
while (*it) {
|
||||||
(*it)->setHidden(
|
(*it)->setHidden(
|
||||||
(*it)->childCount() == 0
|
(*it)->childCount() == 0
|
||||||
|
@ -34,8 +34,7 @@ public:
|
|||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void changed_adaptor();
|
void changed_adaptor();
|
||||||
void gotoClicked();
|
void gotoClicked();
|
||||||
void on_findLE_textChanged(const QString &);
|
void filterLabels();
|
||||||
void on_searchPB_clicked();
|
|
||||||
void refHighlighted(QTreeWidgetItem *);
|
void refHighlighted(QTreeWidgetItem *);
|
||||||
void selectionChanged();
|
void selectionChanged();
|
||||||
void refSelected(QTreeWidgetItem *);
|
void refSelected(QTreeWidgetItem *);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>386</width>
|
<width>386</width>
|
||||||
<height>479</height>
|
<height>443</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -22,6 +22,49 @@
|
|||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item row="2" column="0" colspan="3" >
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="findKeysLA" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Fil&ter:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="buddy" >
|
||||||
|
<cstring>findLE</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="findLE" >
|
||||||
|
<property name="toolTip" >
|
||||||
|
<string>Enter string to filter the label list</string>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="csFindCB" >
|
||||||
|
<property name="toolTip" >
|
||||||
|
<string>Filter case-sensitively</string>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Case-sensiti&ve</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item row="7" column="0" colspan="3" >
|
<item row="7" column="0" colspan="3" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
@ -305,70 +348,6 @@
|
|||||||
<item row="1" column="0" colspan="3" >
|
<item row="1" column="0" colspan="3" >
|
||||||
<widget class="QTreeWidget" name="refsTW" />
|
<widget class="QTreeWidget" name="refsTW" />
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="3" >
|
|
||||||
<widget class="QFrame" name="frame" >
|
|
||||||
<property name="frameShape" >
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow" >
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<widget class="QCheckBox" name="csFindCB" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Case-sensiti&ve</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QLineEdit" name="findLE" >
|
|
||||||
<property name="toolTip" >
|
|
||||||
<string>Enter the text to search for and press Enter or click the button to search</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<widget class="QPushButton" name="searchPB" >
|
|
||||||
<property name="enabled" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip" >
|
|
||||||
<string>Click or press Enter in the search box to search</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Search</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoDefault" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="findKeysLA" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Searc&h:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buddy" >
|
|
||||||
<cstring>findLE</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
Loading…
Reference in New Issue
Block a user