mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 22:15:37 +00:00
focus search input field when opening search subview (Fixes #2534)
This commit is contained in:
parent
7f12fc4770
commit
c9d519f36c
4 changed files with 20 additions and 1 deletions
|
@ -153,6 +153,11 @@ void CSVTools::SearchBox::setEditLock (bool locked)
|
|||
mReplace.setEnabled (!locked);
|
||||
}
|
||||
|
||||
void CSVTools::SearchBox::focus()
|
||||
{
|
||||
mInput.currentWidget()->setFocus();
|
||||
}
|
||||
|
||||
void CSVTools::SearchBox::modeSelected (int index)
|
||||
{
|
||||
switch (index)
|
||||
|
@ -172,6 +177,8 @@ void CSVTools::SearchBox::modeSelected (int index)
|
|||
break;
|
||||
}
|
||||
|
||||
mInput.currentWidget()->setFocus();
|
||||
|
||||
updateSearchButton();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ namespace CSVTools
|
|||
|
||||
void setEditLock (bool locked);
|
||||
|
||||
void focus();
|
||||
|
||||
private slots:
|
||||
|
||||
void modeSelected (int index);
|
||||
|
|
|
@ -60,6 +60,12 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|||
}
|
||||
}
|
||||
|
||||
void CSVTools::SearchSubView::showEvent (QShowEvent *event)
|
||||
{
|
||||
CSVDoc::SubView::showEvent (event);
|
||||
mSearchBox.focus();
|
||||
}
|
||||
|
||||
CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||
: CSVDoc::SubView (id), mDocument (document), mLocked (false)
|
||||
{
|
||||
|
@ -83,7 +89,7 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
|||
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
||||
|
||||
connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest()));
|
||||
|
||||
|
||||
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
||||
this, SLOT (stateChanged (int, CSMDoc::Document *)));
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ namespace CSVTools
|
|||
private:
|
||||
|
||||
void replace (bool selection);
|
||||
|
||||
protected:
|
||||
|
||||
void showEvent (QShowEvent *event);
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue