mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
focus search input field when opening search subview (Fixes #2534)
This commit is contained in:
parent
7f12fc4770
commit
c9d519f36c
@ -153,6 +153,11 @@ void CSVTools::SearchBox::setEditLock (bool locked)
|
|||||||
mReplace.setEnabled (!locked);
|
mReplace.setEnabled (!locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVTools::SearchBox::focus()
|
||||||
|
{
|
||||||
|
mInput.currentWidget()->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
void CSVTools::SearchBox::modeSelected (int index)
|
void CSVTools::SearchBox::modeSelected (int index)
|
||||||
{
|
{
|
||||||
switch (index)
|
switch (index)
|
||||||
@ -172,6 +177,8 @@ void CSVTools::SearchBox::modeSelected (int index)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mInput.currentWidget()->setFocus();
|
||||||
|
|
||||||
updateSearchButton();
|
updateSearchButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ namespace CSVTools
|
|||||||
|
|
||||||
void setEditLock (bool locked);
|
void setEditLock (bool locked);
|
||||||
|
|
||||||
|
void focus();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void modeSelected (int index);
|
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)
|
CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||||
: CSVDoc::SubView (id), mDocument (document), mLocked (false)
|
: 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&)));
|
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
||||||
|
|
||||||
connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest()));
|
connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest()));
|
||||||
|
|
||||||
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
||||||
this, SLOT (stateChanged (int, CSMDoc::Document *)));
|
this, SLOT (stateChanged (int, CSMDoc::Document *)));
|
||||||
|
|
||||||
|
@ -32,6 +32,10 @@ namespace CSVTools
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
void replace (bool selection);
|
void replace (bool selection);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
void showEvent (QShowEvent *event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user